InterPagesChaption Link
Beginner's Lessonn (A)

API User Target Laboratory

Basic Archive Lecture

********************
http://www32.tok2.com/home/Hukuoka/cgi-bin/counter9/g_counter.cgi
Cを翻訳するにあたって、注意点や、互換点をBasicに比較します。Basicは、CommonGateWayInterfaceほど難しいプログラミングですが、初心者向けに作られているべーシックは、頭文字の意味は、ビギナーのBであり、まず初めにプログラミングを教習するのに、学校などの支援もあり、捕捉されます。Cからは、本格的なアプリケーションプログラミングインターフェイスをもち、専門学校以上で教習できます。
Translate of C hit Tips with Point Decision After Compare Basic, Basic Difference of Common Gate Way Interface(CGI NetWork Programming) Equivalent Level It,Make on Biginner's Edition Basic is Prefix of B mean is by Easy with Biginner's,First Plan Learn Program Starter Support School Use Target It,C Bigin Expart have API with Professional School Over Learn C . 

一方向の評価
C
if(D==0){D=1;}
Basic
IF D=0 Then D=1
表記の注意点は、Cは、等価評価することに、==と2文字使うほか、ステートメントにあたるifに条件枠を数括弧”()”つかい、中括弧”{}”の中には、条件が成立した場合、書かれたコードを実行します。ここでは、変数”D”が”0”と等価の場合、変数”D”に”1”を代入しています。最後の区切りは、Cは何時も”;”セミコロンを使い、セミコロンで区切ってあれば、2行を1行にセミコロン2つを1行で表記できます。
This wrote Statement Funcion Appointment is C is Equivalent by "==" Dublue Equal Symbol use else hit Statement "if" at Terms Trim Border of "()" use After Middle Class Border "{}" to Contein Complate Terms in Case,Wrote Program Code on Execute, This Section "D" Variable by Equivalent "0" in Case "D" Variable In put "1", Last Divition is C by SemiCoron "" Carrige and 1 Line Addition Program Code Can Wrote It .



二方向の評価
C
if(D==1){D=0;} else {D=1;}
Basic
IF D=1 Then D=0 ELSE D=1
これは、2巡すれば、変数”D”は、”0”になります。この構文は、変数”D”が”1”の時、変数”D”を”0”に初期化します。二方向評価するにあたり、このコードは、1以下1以上で変数”D”を”1”とします。構文をセミコロンで区切ります。
This is 2 come round by "D" Variable Equivalent Value is "0" Result, This Word is "D" Variable is Then "D" Variable Bigin Setting of "0", Hit 2 Way Decision less than with more than by "D" Variable "1" Value,This String word is Shut SemiCoron .

多方向の評価
C
if(D==0){D=1} else if(D==1){D=0;} else {D=1;}
Basic
IF D=0 Then D=1 Else IF D=1 THen D=0 Else D=1
3段階の評価は、値”0”と”1”だけです。値が”0”の時、変数”D”を”1”とし、”D”が”1”であれば”0”に反転します、もし、値”0”と”1”以外が代入に値したときは、”0”と”1”以外の場合、変数”D”を”1”に設定後、2巡から、2方向の評価となります。
3 Way Decision is Value "0" and Value "1" Only, Then Value by "0" to "D" Variable Reply "1" Vakye,Then Value by "1" to "0" Reversed,IF Case is Out Of Value with not "0" or "1" to "D" Variable Set Value "1" After Repeat Count 1 ForWard Run 2 Count After 2 Way Decision .


繰り返し
C
int D=9;while (D>=0){D--;}
Basic
LET D=9:WHILE(D>=0):D=D-1:WEND
関数のintとLETの違いに注目してください。Cは、プロトタイプ宣言を必要としており、明確なキャストで有っても、型変換はできません。よって、数字型のintに数字変数”D”に”9”から始まり、関数”while”と”WHILE”の大文字と小文字は区別されるケースセンシティブを採用しています。”while”関数により、”D”が”0”と等価かそれ以上の時繰り返し、ベーシックは、同じ様に見えても、違う点は、コロンとセミコロンの使い方に注意してください。ベーシックは、必ず、”WEND”で折り返し点を確認していますが、Cは、関数”WEND”がありませんが、”{}”によって中身を実行すると、Dをデクリメントするにあたり、ここもベーシックと表記の違いを注意してください。Cは、”D−−”と、することで、べーシックの表記では、”D=D−1”としなければなりません。
This Compare Function "int" and "LET" Defficult Pointment Attention,C by Declaration Need It,Exactness have by Cast No Exchange,Therefore Number Value of "int" Bigin "D" Variable Start"9" Repeat "-1" Value Morethan Between Statement Function "while" by Capital Letter size Compare Reverse Capital Letter size Each Difference Adoption "CaseSencitive",Basic is Look at Something by Diffierence "coron" and "SemiCoron" Attention use It,Basic must Repeat End at Need Carrige "WEND" System Check Compare C Nothing "WEND" Function by Turn Point,Middle Quart "{}" in Execute After "D" Variable Value Hit Decrement,This Location by Attention Compare Basic and C Difference,C is "D--" Equivalent Basic must "D=D-1" .

繰り返し2
C
for(int D=9;D>=0;D--){TextOut(hdc,D*16,0,D,1);D--;}
Basic
FOR D=9 TO 0 Step -1:LOCATION 0,0:PRINT D:NEXT
今度は、少し高度なCの繰り返しに挑戦してみました。”int”を”for”の内部で宣言され、変数"D”が”0”以上の間、変数”D”は、一づつ数を減らし”0”の値の後止まります。”{}”の中のコードは、Cの”TextOut”は、ベーシックの”PRINT”に相当するものです、”TextOut”にて、Dの値をカウントダウンします。ベーシックで、デクリメントを行うにあたり、”STEP"パラメーターを”−1”は、1づつ設定しなければなりません。
This Round is Any High Repeat by C Challenged,Declaration Private Internal Satement Function from "for" in "int" Function Declaration "D" Variable,"D" Variable MoreThan "0" Between by CountDown Result is LessThan "O" Stop, Middle Quate "{}" InSide Programming Code is Development Language "C" by "TextOut" Function is Equivalent Basic Language "PRINT" Function Value, Basic Declement Execute "Step" Parameter "-1" is must Each Setting .

繰り返し3
C
int D;do{TextOut(hdc,D*16,0,D,sizeof(D));D++;}while(D<10);
Basic
LET D:WHILE(D<10):LOCATION 0,0:PRINT D:D=D+1:WEND

こんどは、Cによる”do”に開始し、テキストアウト関数にて、ハンドル”hdc”と、変数”D”のバイト数を”sizeof”関数でデータ容量を量り、文字数と同じ文字の長さを指定しています。ベーシックは、”LOCATION”関数で”PRINT”の位置が動きません。今度は、Cが”while”で閉じている事が、”WEND”との違いです、変数”D”のインクリメントは必ず必要です。加算しないと、”for”関数と違い、無限ループに陥ります。
This Stage is Development Language by C and Begin "do" Start ForWard "TextOut" Function by with "hdc" HANDLE and Variable "D" Value Count of Byte by "sizeof" System Call Code,String Text Length SomeOne,Basic is "LOCATION" Function Show "PRINT" Function No Move It,This Round C is Close of "while" Function,This Thing Compare "WEND" Difference, "D" Variable Need Inclinement, This "do" Difficlut "for" Statement Function and No Count Addition Value is Endless Loop .

配列と文字列
C
int IdNum[10] ; char Names[25] ; float Coordinate[100][11] ; char Comeon[30]="Yes Go" ;
Basic
DIM IDNUM(10):DIM NAMES$(25):DIM COORDINATE(100,11):DIM COMEON$(30):LET COMEON$(1)="Y":LET COMEON$(2)="e":LET COMEON$(3)="s":LET COMEON$(4)=" ":LET COMEON$(5)="G":LET COMEON$(6)="o"
Cとベーシックの違いは”char”が1字づつのカウントを”30”回数えるほか、合わせるためには、煩雑です。”COMEON$(1)=”Y” ”と出来るほか、ベーシックの配列変数は、文字数に制限がないので、”COMEON$(1)=”Yes Go””とすることもできます。”float”にて宣言されているのは、ベーシックの”DIM”関数に相当する、2次元配列です。これを”DIM”は、”(100,11)”とします。
C Development Language Difference Basic to "char" by 1 Count to "30" Hit Count Else Combain Thing are Bad, "COMEON$(1)="Y" " Can It, Else Basic is Arregement Variable is Word Count No Count,This Thing is Can Easy by "COMEON$(1)="Yes Go"" , Declaration "float" Function is Doublue Dimention Variable is Arregement, This is by "DIM" Equivalent "(100,11)" Decision .

クラスの定義
C Only
Class And_Day {Public: And_Day(int YY,int MM,int DD);void ShowDay;~And_Day;Private: int Year,Mounth,Day; }
”〜”チルダにて、宣言後の自作関数を削除します。他のクラスに継承するためのパブリックが設けられています。パブリックは、引数を持つAnd_Day”クラスであり、YYとMMとDDで継承されます。”void”は実行型関数を意味し、”CONST”は、固定値で有る事を意味しています。一つ一つ宣言することもできますが、”int”型は、一つで一斉に定義できます。”int”型は、”Year,Mounth,Day”として宣言できますが、プライベートは、内部変数で使われるので、クラス内部で使われる値なので、他のクラスに干渉関係がありません。実行型の”void”と判定型の”BOOL”と、パラメーター型の”int”があります。主に引数を引かない”void”は、メンバ関数他を、メンバ変数と言います。”return”関数で戻り値を持ち実行後の結果を引数を返します。主に”void”は、戻り値の必要無いグラフィック制御等に使われています。
Destructer Type Tilder Declaration Behind Make My Function at Deleate,Other Class Inheritance by "Public:" Install,"Public:" is Pull Value of Parameter have Exist Class "And_Day", Variable "YY","MM","DD" in Inheritance to New Class,"void" is Execute Function Mean UnderStand,"const" is Fix Control Value Mean UnderStand,Many One Can Declartion Each Difference,"int" Type Fuction is Can All in One Definition,"int" Type Function is Can Variable "Year","Mounth","Day" Value by Declartion Execute And Too,"Private:" Was Inside Used Class Value, Other Class Relation No Bridge,Execute Type "void" Type and Reverse and Reverse "BOOL" Type Value and "int" Type Exsistance, No Return Value "void" is Member Function and Other Class Factor Return Value with Member Variable,"return" Function have Return Value and Result Execute Pull Value,Mainning "void" by No Return Control Graphics Userful .

列挙型
C
enum coloring {Red="Red",Yellow="Yellow",Green="Green",Blue="Blue",Violet="Violet"};void main(){coloring Favorite; Farvorite=Violet;}
Basic
DIM COLORING$(5):LET COLORING$(1)="Red":LET COLORING$(2)="Yellow":LET COLORING$(3)="Green":LET COLORING$(4)="Blue":LET COLORING$(5)="Violet":FAVORITE$=COLORING$(5)
Basic
DIM COLORING$(1,1,1,1,1):LET COLORING$(1,0,0,0,0)="Red":LET COLORING$(0,1,0,0,0)="Yellow":LET COLORING$(0,0,1,0,0)="Green":LET COLORING$(0,0,0,1,0)="Blue":LET COLORING$(0,0,0,0,1)="Violet":LET FAVORITE$="COLORING$(0,0,0,0,1)

一個づつの定数で、深い配列が可能です。”enum”は、ベーシックで、”DIM”関数で、DIM A$(1,1,1,1,1)とすることもでき、一定の互換性があります。多次元配列を1までの定数として、複数列挙が可能ですが、本コードは、BasicとCの解釈は変わりません。ベーシックでも列挙はできますが、前のベーシックの方がスマートです。
Many one Can Fix Value with High Arragement,"enum" is Equivalent Baisc "DIM","DIM" Function Can "DIM A$(1,1,1,1,1)" Compatible, This Function Can Many Dimention Arragement Made List of Variable Value,This Code Program is Basic and C Development Language is No Change UnderStand,Basic "DIM" Function Can Made List of
Value,BackWard Basic by Smart .

ポインタデストラクタ
C
numOne=new int[10];
if (numOne)
{
delete [] numOne;
}
C
GetPointer() *numOne;
numOne = new GetPointer(1,2,3);
int i;
i=numOne->GetPointer();
numOne.delete;
Basic
DIM NUMONE$(100):ERASE NUMONE$
最初のものは、動的に”int”型で10バイト確保し、”if”関数にて”numOne”が否定系でなければ、”delete”関数にて、取得バイト数にかかわらず、”numOne”を削除します。次のものは、ポインタを用いた例です、”numOne”のクラス”GetPointer”を呼び出し、”numOne”のポインタに置き換わります。また、動的に”numOne”に”GetPointer”が取得され、変数”i”を宣言し、”i”に、”numOne”は、”GetPointer”クラスにポインタします。最後に、デストラクタとして、”numOne”が削除されます。
Begin Thing Dynamic "int" Type Function by 10Byte Get It,"if" Statement Function by "numOne" No not at delete No Much Arragement Value,Next Thing is Use Pointer Exsample,"numOne" Call Class "GetPointer()" and Replacement "numOne",Declare Variable Value "i" withon Pointer "GetPointer()" Class "numOne" It,Lasted Destractor delete This "numOne" Pointer.


論理演算
C
if (!hwnd)
{
HWND hwnd;
}

Basic
IF NOT HWND=0 THEN HWND=1

C
BOOL Reversible;
if (Reversible==-1||Reversible==0)
{
delete Reversible;
}


Basic
IF REVERSIBLE=0 THEN REVERSIBLE=-1 ELSE REVERSIBLE=0
IF REVERSIBLE=-1 OR 0 TH
EN ERESE REVERSIBLE

C
int X,Y,Measure;
BOOL bFlag;
X++;
Y++;
Measure=(X*Y);

LabelBegin:

if (X && Y)
{
bFlag=TRUE;
}
Else
{
bFlag=FALSE;
}
if (hdc)
{
TextOut(hdc,0,0,bFlag,sizeof(bFlag));
}
else
{
HDC hdc;
Goto LabelBegin: ;
}

Basic
LET X=0:LET Y=0:LET MEASURE=0
X=X+:Y=Y+1
*LABELBEGIN
IF X=Y THEN BFLAG=0 ELSE BFLAG=-1
LOCATE 0,0:PRINT BFLAG
GOTO *LABELBEGIN

”NOT”(否定)は、”if”関数にて”hwnd”が空の時、”HWND”ハンドルを、”hwnd”にコピーコントラクスタします。”OR”は”||”で連結され、どちらか、一つ正の時、if Statement内を”中括弧{}”で囲まれたものを実行します。”BOOL”値は”0”と”−1”の何れかでTUREと、FALSEです。”BOOL”値がある場合”delete”関数で削除されます。”AND”は、”&&”を使って結ばれます。ifの結果がXとYが同じであれば、”bFLAG”にTRUE、それ以外であれば”bFlag”にFALSEを代入します。Basicでは、2変数間の”AND”の指定は必要ありません。”=”で連結します。デバイスコンテキストが存在する場合、座標0,0に、”bFLAG”を表示します。その時、”bFlag”の文字数をsizeof()にて計算します。デバイスコンテキストが無い場合は、HDCコンテキストハンドルをコピーしてラベル”LabelBegin”に移動します。

"Not" by Statement Function "if" to Empty "hwnd" then "HWND" Copy Constractor "hwnd" Loaded."Or" is Linking "||" Deference Only True to Execute Statement "if" and "{}" Between,BOOL is "0" or "-1" at "True" or "False",Exsist by BOOL is Erase Value of BOOL by "delete"."And" is Linking "&&" Used.Result Same "X","Y" Value to "bFlag" at "Ture" Else "False" by Other Value It.Exsit Window Handle Case is Coordinate 0,0 Value on Show Display "bFlag",Then Count Word "bFlag".Nathing DeviceContext Case is Copy DeviceContext "HDC" to "hdc" with Return Label "LabelBegin:" Jump It.Basic is "And" by Bridge "=" No Use "And"."And" Linking "=".


Num. by 000-0006

メッセージループの課題研究のサクセスファイル、MultiDocumentInterfaceで動作確認済み、ソフトは、Test3.exeをダウンロード
宣言の確認と、型変換の無許可の検定済ファイル。これは、メッセージループの完成品。リリースソフトで動作を確認できます。

デバッカとビルド済み合格プログラム VisualC++
ビルドインプロジェクトリリースバージョン1.0
ファイルはリリースソフトNumber.01(Test3.exe)


// MainFrm.cpp : CMainFrame クラスの実装
//

#include "stdafx.h"
#include "test5.h"

#include "MainFrm.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif





// CMainFrame

IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)

BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_WM_CREATE()
ON_COMMAND(ID_FILE_CLOSE, OnFileClose)
END_MESSAGE_MAP()

static UINT indicators[] =
{
ID_SEPARATOR, // ステータス ライン インジケータ
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};


// CMainFrame コンストラクション/デストラクション

CMainFrame::CMainFrame()
{
// TODO: メンバ初期化コードをここに追加してください。
}

CMainFrame::~CMainFrame()
{
}


int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;

if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("ツール バーの作成に失敗しました。\n");
return -1; // 作成できませんでした。
}

if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("ステータス バーの作成に失敗しました。\n");
return -1; // 作成できませんでした。
}
// TODO: ツール バーをドッキング可能にしない場合は、これらの 3 行を削除してください。
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);

return 0;
}

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: この位置で CREATESTRUCT cs を修正して Window クラスまたはスタイルを
// 修正してください。

return TRUE;
}


// CMainFrame 診断

#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}

void CMainFrame::Dump(CDumpContext& dc) const
{
CFrameWnd::Dump(dc);
}

#endif //_DEBUG


// CMainFrame メッセージ ハンドラ

BOOL CMainFrame::LoadFrame(UINT nIDResource, DWORD dwDefaultStyle, CWnd* pParentWnd, CCreateContext* pContext)
{
// 基本クラスが実際の動作を行います。

if (!CFrameWnd::LoadFrame(nIDResource, dwDefaultStyle, pParentWnd, pContext))
{
return FALSE;
}

CWinApp* pApp = AfxGetApp();
if (pApp->m_pMainWnd == NULL)
pApp->m_pMainWnd = this;

// 2 番目のウィンドウで、[ファイル] メニューの [終了] オプションを [閉じる] に置き換えます。
if (AfxGetApp()->m_pMainWnd != this)
{
CMenu *pMenu = GetMenu();
ASSERT(pMenu);
pMenu->ModifyMenu(ID_APP_EXIT, MF_BYCOMMAND | MF_STRING, ID_FILE_CLOSE, "閉じる(&C)");
}

return TRUE;
}
LRESULT CALLBACK MyProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
{
bool nCmdShow=0;


bool InitInstance(bool HINSTANCE,bool nCmdShow);
{
if(!hWnd){return false;}
ShowWindow(hWnd,nCmdShow);return true;
}
int wmEvent ; PAINTSTRUCT ps;HDC hdc;

switch(message)
{

case WM_PAINT:
//long left,top,right,bottom;


hdc=BeginPaint(hWnd,&ps);
MessageBox(hWnd,"HelloWorld","title",MB_OK);
SetBkMode(hdc,OPAQUE);
SetTextColor(hdc,RGB(255,128,128));
SetBkColor(hdc,RGB(0,0,0));

typedef struct lprc
{
long left,top,right,bottom;
}

DrawTextEx(hdc,"HelloWorld2",12,(lprc.left,lprc.top,lprc.right,lprc.bottom),DT_CENTER,true);
EndPaint(hWnd,&ps);return true;

case WM_CREATE:
DrawTextEx(hdc,"HelloWorld2",12, (lprc.left,lprc.top,lprc.right,lprc.bottom),DT_CENTER,true);

case WM_COMMAND:;wmEvent=(HIWORD(wParam));
SetTextColor(hdc,RGB(255,128,128));
DrawTextEx(hdc,"HelloWorld2",12,(lprc.left,lprc.top,lprc.right,lprc.bottom),DT_CENTER,true);


default: return DefWindowProc(hWnd,message,wParam,lParam);

return 0;}
LRESULT CALLBACK About(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam);
{switch(message)
{
case WM_INITDIALOG: return true;

}return false;}}



void CMainFrame::OnFileClose()
{
DestroyWindow();
}





********************







Num. by 000-0001
C(API Reference)Dai's C Laboratory Copy Right 2017.04-


WndProc->((HWND)hwnd,(UINT)message,(WPARAM)wParam,(LPARAM)lParam);
if (message.wParam)
{
wLength=(int)lstrlen(message.wParam)*8;
hLength=(int)lstrlen(message.wParam)*16;
countWord=(int)lstrlen(message.wParam);
SetRect(lprect,0,0,wLength,hLength);
DrawText(hdc,message.wParam,countWord,lprect,NULL);
}
else
{
massege &wParam;
if (!wParam)
{
WPARAM *wParam;
wParam=new Char[100];
}

}


Num. by 000-0001

今回は、WndProc(ウインドウプロシージャ)に対して、ポインタを指定します。”hwnd”ウインドウハンドルは、(HWND)キャストされています。メッセージは、キーボードストロークで整数値でキャストする2バイトの(UINT)キャストです。WPARAMとLPARAMパラメーターを引用します。UINTの条件が、”wParam”にオーバーライドされていない時、elseに、WPARAMのポインタ(*)に”wParam”を指定して、wParamにnew演算子にてキーボードストロークを100回分のキーボード入力をします。ifにて、”massage.wParam”にオーバーライドが、真で有れば文字の幅(8ピクセル)、文字の高さ(16ピクセル)、文字の数を、wLength,hLength,countWord各lstrenにて求めます。SetRectにて四角形の座標を入力して、レクトの形に合わせて、自動で文字幅を合わせられます。DrawText関数にて、事前に設定したパラメーターを入力します。
This Appointment is Pointer to WndProc withon Cast Settings,message is Get Key Borad Stroke Matrix 16Bit Cast of UINT,Call WPARAM and LPARAM,This Terms by No OverRide with Execute Then Though and else in WPARAM Pointer is (*) Marks with "wParam" on That by "new" Function and "Char" of KeyBorad Stroke Input Infometion Count to 100,User Reply Typing This Function ask it,if Statement by that "message.wParam" to OverRide is case in True as Word Width(x8),Word Height(x16),Word Count(Equivalent),But Variable(wLength and hLength and countWord) Execute in case by API (lstren) to Result Decision,Square of Rect In Put Coordinate Infomation,Automation Font Word Size at Fit Word,Behind Thing Settings Paramater InPut to DrawText(API).

C(API Reference)Dai's C Laboratory Copy Right 2017.04-

Num. by 000-0002

//PromptType Declaration

HANDLE* hFile;

HANDLE CreateFile
(
LPCTSTR lpFileName,DWORD dwDesiredAccess,DWORD dwShareMode,LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDistribution,DWORD dwFlagsAndAttributes,HANDLE hTemplateFile
);

//Parameter Settings

LPCTSTR lpFileName="NewSequential_Read_Write";
DWORD dwDesiredAccess=(GENERIC_READ|GENERIC_WRITE);
DWORD dwShareMode=(FILE_SHARE_WRITE);
LPSECURITY lpSecurityAttributes=NULL;
DWORD dwCreationDistribution=(CREATE_ALWAYS);
DWORD dwFlagsAndAttributes=(FILE_FLAG_SEQUENTIAL_SCAN);
HANDLEA hTemplateFile=NULL;


//CreateFile Execute
hFile=CreateFile
(
lpFileName,dwDesiredAccess,dwShareMode,lpSecurityAttributes,
dwCreationDistribution,dwFlagsAndAttributes,hTemplateFile
);

if(!ar)
{
CArchive * ar;
CArchive &ar;
}
lpBuffer<<LPCVOID<<CArchive.ar[]

nNumberOfBytesWrite=(DWORD) sizeof(lpBuffer)

BOOL WriteFile(HANDLE hFile,LPCVOID lpBuffer,DWORD nNumberOfBytesWrite,
LPDWORD lpNumberOfBytesWritten,LPOVERLAPPED lpOverlapped);
if(!lpBuffer)
{
lpBuffer<<LPCVIOD<<CArchive &ar[]
}

lpNmuberOfByteRead=(LPWORD)sizeof(lpBuffer);

BOOL ReadFile(HANDLE hFile,LPVOID lpBuffer,DWORD nNumberOfByteToRead,
LPDWORD lpNumberOfByteRead,LPOVERLAPPED lpOverlapped);

ar[].delete;
hFile[].delete

Num. by 000-0002

ファイルのオープンをする論文です。主にこのソースは、クリエイトファイルのプロトタイプ宣言を行っている他、全ての数値にパラメーターを代入しています。実行される直前に変数が空になりません。アーカイブを使ってストリーミングをしていない場合は、フレームワークからCArchiveにarにポインタし、これを、lpBufferにLPCVIOD形式で、CArchiveからストリーミングされます。arは参照されます。ストリーミング後のlpBufferにsizeofを指定して、ファイルサイズを計算しています。<<コマンドで配列を一斉に読み書きするため、配列子の[ ]は省略されません。最後にarとhFileにdeleteでデストラクタでポインタを最後に削除しておくようにします。

Decision Report of File Open,Main Source is PromtType Declare by Execute else All Value to In Put,No Empty Case Execute is Behind Now.No Use Streaming Case is by Pointer CArchive in Frame Work It.But lpBuffer is Type LPVOID Change Format,Reference Many Place ar,This Open File is sizeof Target lpBuffer in Total Size.Streaming Command is Execute << by at the same time,But Arregement "[ ] " is No Skip.Last is ar and hFile at Desstruct Release of Memory by delete and Mean.

C(API Reference)Dai's C Laboratory Copy Right 2017.04-

Num. by 000-0003

MSG*message;

[module(name=method1)];

struct method1
{
[switch_type(int), switch_is(message)] union members;
{
[case (256),int];
{
if(GetKeyState(17)<0)
{lstrcpy(ctrl,"ON");}
else{lstrcpy(ctrl,"OFF");}

if(GetKeyState(16)<0)
{lstrcpy(shift,"ON");}
else{lstrcpy(shift,"OFF");}


if(GetKeyState(20)<0)
{lstrcpy(caps,"ON");}
else{lstrcpy(caps,"OFF");}

wsprintf(scripts,"MessageCord= %0x , Ctrl = s% , Shift = s% , Caps= s%" , lpMsg , ctrl , shift , caps ) ;
InvalidateRect(hWnd,NULL,TRUE);
break;
}

[case (15),int];
{
hWnd=BeginPaint(hWnd,&ps);
lstrcat(scripts,lpMsg);
TextOut(hWnd,0,0,scripts,lstrlen(scripts));
EndPaint(hWnd,&ps);
break;
}
[case (2),int];
{
PostQuitMessage(0);
};
TranslateMessage(MSG message);
};};




文字コードとドグルの判定により、押下の判定と、文字コードをscriptsにwsprintfにて初期化文字列したものに加え、wParam.messageをMSGとコピーコントラクスタを置き、、*ポインタで、lpMsgを宣言します。ウインドウが描画されるとき、WM_PAINTが実行され、hWnd、ウインドウハンドルに、架空のペイントストラクトに参照して、連動して書き換えます。開始描画が宣言されたあと、scriptsと、lpMsgを追加合成し、実際に、文字コードが、入力した文字に変換されるように翻訳(Translate)を行います。TextOutにて、hWndハンドルに加え、座標を0,0に縦横をセットし、scriptsと、scripts文字数を記述し、TextOutで文字列が出力されます。開始したのは、終わりの宣言をもって、描画を終え、return 0 ; とします。この点でエラーは無いということです。主に此のプログラムは、GetKeyboardStateで入力されたのを、ドグルされていれば、0(Fault:偽)、−1(True:真)と成る、BOOL判定です。是を、GetKeyboardStateと比較することによって、押下されているか判定し、また、システムキー以外の文字位置の場合は、Aであれば文字コードは、其れの位置に相当するソフトキーボードの&H0041であり¥であれば&HFFE5と成ります。ソフトキーボードは、IMEパットで読み出せます。文字コードは、4桁の16進数ですから0からFまであります。また、Translate後の文字コードは、字に変換されるので、&H0041であれば、「A」と同じ文字に直されます。閉じるボタンを押したときは、PostQuitMessage(0);にて、終了処理を取ります。テキストアウトは、インバリデートレクトにて、hWndのハンドルで開始描画し、長方形の取得を、NULLは、領域全体に対して、次のTRUEは、画面を消去して、文字列を描画します。


User's Typing This Program of Terms Hit Out with Push Down,Word Cord Hit Down in Result,Foundation Text Format Insert Variable Value on Conteiner by wsprintf.Copy Construct Copy Template to MSG by wParam.message,Declaration *Pointer to lpMsg.This Program is in Drawing Then Execute WM_PAINT,Add hWnd,WindowHandle and Empty PaintStruct Reference Linking Wote,That Same Times is Begin Paint Drawing Text View of Show Display,scripts[80] Addition Translate Key Cord x0041 at "A".Text Drawing Coordinate Horizontal,Vertical is 0 and 0 Start Setting,with scripts,Addition Count Out Number,Begin and End Drawing is Result return 0;This is No Mistake Result 0.Mainning This Program is Type and Type by GetKeyboardState That Thing Typed Result Hit Down Switch On is Fault(0),True(-1) and Bool Hit Count,Type by Relation Switch up as Same Thing,Through No System key Hit Down,Passenger No System key is Character "A" is x0041(&H0041) Translate "A" Type Word Changes,Show Soft Key Board Reference IME - Pad by Information,\ is xFFE5 is 2Byte Character.Close Window and End Window by PostQuitMessage(0); with Destroy Window.InvalidateRect Coordinate Full Screen Clear with All Vector Drawing by NULL and TRUE with hWnd Handle.

Num. by 000-0004

ウインドウプロシージャ更新版、動作確認済み雛形
test5.exeダウンロード
400KB以内のソースコード
こちらのものは、マイクロソフト”.NET”動作可能修正済コード。主に、メッセージループの間に、WCEXを定義しないことで動作可能とした。全てのコマンドは、スルーされるよって雛形のみの動作を確認している

test5.cpp
********************



WNDCLASSEX wcex;
wcex.cbSize=sizeof(WNDCLASSEX);
wcex.style=CS_HREDRAW | CS_VERDRAW | CS_DBLCLKS;
wcex.lpfnWndProc=(WNDPROC)WndProc;
wcex.cbClsExtra=0;
wcex.WndExtra=0;
wcex.hInstance=hInstance;
wcex.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wcex.hCursor=LoadCursor(NULL,IDC_ARROW);
wcex.hbrBackgrpund=(HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMNenuName=NULL;
wcex.lpszClassName="ModelAPP";
wcex.hIconSm=LoadIcon(NULL,IDI_APPLICATION);
RegisterClassEx(&wcwex);

hWnd=CreateWindow(wcex.lpszClassName,WS_OVERLAPPEDWINDOW,CW_USERDEFAULT,CW_USERDEFAULT,CW_USERDEFAULT,CW_USERDEFAULT,NULL,NULL,hInstance,NULL);

LRESULT CALLBACK MyProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
{
bool nCmdShow=0;


bool InitInstance(bool HINSTANCE,bool nCmdShow);
{
if(!hWnd){return FALSE;}
ShowWindow(hWnd,nCmdShow);return TRUE;
}
int wmEvent ; PAINTSTRUCT ps;HDC hdc;

switch(message)
{

case WM_PAINT:


hdc=BeginPaint(hWnd,&ps);
MessageBox(hWnd,"HelloWorld","title",MB_OK);
SetBkMode(hdc,OPAQUE);
SetTextColor(hdc,RGB(255,128,128));
SetBkColor(hdc,RGB(0,0,0));
TextOut(hdc,0,0,"HelloWorld",lstrlen("HelloWorld"));

screct.left=0;
screct.top=0;
screct.right=640;
screct.bottom=480;

DrawTextEx(hdc,"指数は幾つですか",100,&screct,DT_CENTER,NULL);
EndPaint(hWnd,&ps);return 0;

case WM_CREATE:
hDC=GetDC(hwnd);
GetTextExtentPoint32(hdc,"HelloWorld",10,NULL);
ReleaseDC(hWnd,hdc);
return 0;


TextOut(hdc,0,0,"HelloWorld",10);

case WM_COMMAND:;wmEvent=(HIWORD(wParam));

default: return DefWindowProc(hWnd,message,wParam,lParam);

return 0;}
LRESULT CALLBACK About(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam);
{switch(message)
{
case WM_INITDIALOG: return TRUE;

}return FALSE;}}

ShowWindow(hWnd,nCmdShow);
UpdateWindow(hwnd);
while(GetMessage(&msg,NULL,0,0)){TranslateMessage(&msg);DispatchMessage(&msg);}




stdafx.cpp
********************

#include "stdafx.h"

LRESULT CALLBACK MyProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
{
bool nCmdShow=0;


bool InitInstance(bool HINSTANCE,bool nCmdShow);
{
if(!hWnd){return FALSE;}
ShowWindow(hWnd,nCmdShow);return TRUE;
}
int wmEvent ; PAINTSTRUCT ps;HDC hdc;

switch(message)
{

case WM_PAINT:


hdc=BeginPaint(hWnd,&ps);
MessageBox(hWnd,"HelloWorld","title",MB_OK);
SetBkMode(hdc,OPAQUE);
SetTextColor(hdc,RGB(255,128,128));
SetBkColor(hdc,RGB(0,0,0));
TextOut(hdc,0,0,"HelloWorld",lstrlen("HelloWorld"));
DrawTextEx(hdc,"指数は幾つですか",100,NULL,DT_CENTER,NULL);
EndPaint(hWnd,&ps);return 0;

case WM_CREATE:
SetTextColor(hdc,RGB(255,128,128));
TextOut(hdc,0,0,"HelloWorld",10);

case WM_COMMAND:;wmEvent=(HIWORD(wParam));

default: return DefWindowProc(hWnd,message,wParam,lParam);

return 0;}
LRESULT CALLBACK About(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam);
{switch(message)
{
case WM_INITDIALOG: return TRUE;

}return FALSE;}}

inserted by FC2 system