資源簡介
WINCE的SD卡程序可實現讀寫的代碼 WINCE的SD卡程序可實現讀寫的代碼

代碼片段和文件信息
//?SDTest.cpp?:?Defines?the?entry?point?for?the?application.
//
#include?“stdafx.h“
#include?“SDTest.h“
#include?
#define?MAX_LOADSTRING?100
//?Global?Variables:
HINSTANCE hInst; //?The?current?instance
HWND hwndCB; //?The?command?bar?handle
//?Forward?declarations?of?functions?included?in?this?code?module:
ATOM MyRegisterClass (HINSTANCE?LPTSTR);
BOOL InitInstance (HINSTANCE?int);
LRESULT?CALLBACK WndProc (HWND?UINT?WPARAM?LPARAM);
LRESULT?CALLBACK About (HWND?UINT?WPARAM?LPARAM);
HANDLE?g_hFile?;
DWORD??g_dwNumber?;
BYTE*???g_buffer?;
int????g_length?;?
BOOL???bRet?;?
int?WINAPI?WinMain( HINSTANCE?hInstance
HINSTANCE?hPrevInstance
LPTSTR????lpCmdLine
int???????nCmdShow)
{
MSG?msg;
HACCEL?hAccelTable;
//?Perform?application?initialization:
if?(!InitInstance?(hInstance?nCmdShow))?
{
return?FALSE;
}
hAccelTable?=?LoadAccelerators(hInstance?(LPCTSTR)IDC_SDTEST);
g_hFile?=?NULL?;
g_buffer?=?NULL?;
g_buffer?=?(unsigned?char?*)malloc(64)?;
if??(?NULL?==?g_buffer?)
RETAILMSG(1(TEXT(“Malloc?failed\r\n“)));
//?Main?message?loop:
while?(GetMessage(&msg?NULL?0?0))?
{
if?(!TranslateAccelerator(msg.hwnd?hAccelTable?&msg))?
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return?msg.wParam;
}
//
//??FUNCTION:?MyRegisterClass()
//
//??PURPOSE:?Registers?the?window?class.
//
//??COMMENTS:
//
//????It?is?important?to?call?this?function?so?that?the?application?
//????will?get?‘well?formed‘?small?icons?associated?with?it.
//
ATOM?MyRegisterClass(HINSTANCE?hInstance?LPTSTR?szWindowClass)
{
WNDCLASS wc;
????wc.style =?CS_HREDRAW?|?CS_VREDRAW;
????wc.lpfnWndProc =?(WNDPROC)?WndProc;
????wc.cbClsExtra =?0;
????wc.cbWndExtra =?0;
????wc.hInstance =?hInstance;
????wc.hIcon =?LoadIcon(hInstance?MAKEINTRESOURCE(IDI_SDTEST));
????wc.hCursor =?0;
????wc.hbrBackground =?(HBRUSH)?GetStockobject(WHITE_BRUSH);
????wc.lpszMenuName =?0;
????wc.lpszClassName =?szWindowClass;
return?RegisterClass(&wc);
}
//
//??FUNCTION:?InitInstance(HANDLE?int)
//
//??PURPOSE:?Saves?instance?handle?and?creates?main?window
//
//??COMMENTS:
//
//????In?this?function?we?save?the?instance?handle?in?a?global?variable?and
//????create?and?display?the?main?program?window.
//
BOOL?InitInstance(HINSTANCE?hInstance?int?nCmdShow)
{
HWND hWnd;
TCHAR sztitle[MAX_LOADSTRING]; //?The?title?bar?text
TCHAR szWindowClass[MAX_LOADSTRING]; //?The?window?class?name
hInst?=?hInstance; //?Store?instance?handle?in?our?global?variable
//?Initialize?global?strings
LoadString(hInstance?IDC_SDTEST?szWindowClass?MAX_LOADSTRING);
MyRegisterClass(hInstance?szWindowClass);
LoadString(hInstance?IDS_APP_title?sztitle?MAX_LOADSTRING);
hWnd?=?CreateWindow(szWindowClass?sztitle?WS_VISIBLE
CW_USEDEFAULT?CW_USEDEFAULT?CW_USEDEFAULT?CW_USEDEFAULT?NULL?NULL?hInstan
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????.......???????799??2005-12-22?11:48??SDTest\newres.h
????.......??????2049??2005-12-22?11:48??SDTest\ReadMe.txt
????.......???????865??2005-12-22?11:52??SDTest\resource.h
?????文件?????196560??2008-09-24?07:28??SDTest\SDTest.aps
????.......??????6554??2005-12-22?14:26??SDTest\SDTest.cpp
????.......???????326??2005-12-22?11:48??SDTest\SDTest.h
????.......??????1078??2005-12-22?11:48??SDTest\SDTest.ico
????.......??????3629??2005-12-22?11:52??SDTest\SDTest.rc
?????文件??????58368??2008-09-24?07:36??SDTest\SDTest.vcb
????.......??????1382??2005-12-22?11:53??SDTest\SDTest.vcl
?????文件??????48640??2008-09-24?07:36??SDTest\SDTest.vco
????.......?????11890??2005-12-22?11:48??SDTest\SDTest.vcp
????.......???????540??2005-12-22?11:48??SDTest\SDTest.vcw
????.......???????293??2005-12-22?11:48??SDTest\StdAfx.cpp
????.......???????831??2005-12-22?11:48??SDTest\StdAfx.h
?????目錄??????????0??2008-09-24?07:27??SDTest\ARMV4IRel
?????目錄??????????0??2008-09-24?07:36??SDTest
-----------?---------??----------?-----??----
???????????????333804????????????????????17
評論
共有 條評論