资源描述:
《嵌入式基于wince专辑个人通讯录代码》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、//======================================================================//AlbumDB-AWindowsCEdatabase////WrittenforthebookProgrammingWindowsCE//Copyright(C)2007DouglasBoling//======================================================================#include//ForallthatWindowsst
2、uff#include//ForWindowscontrolsmacros#include//Commoncontrolincludes#include"AlbumDB.h"//Program-specificstuff//Thefileisspecifiedheresothereisnospecialprojectsettings//forwindowsmobilecompiles.#ifdefined(WIN32_PLATFORM_PSPC)#include#pragmacomment(
3、lib,"aygshell")//Linkshelllibformenubar.#endif//----------------------------------------------------------------------//Globaldata//constTCHARszAppName[]=TEXT("AlbumDB");HINSTANCEhInst;//PrograminstancehandleHANDLEg_hDB=INVALID_HANDLE_VALUE;//HandletoalbumdatabaseCEOIDg_oidDB=0;//Obj
4、ectIDofthealbumdatabaseCEGUIDg_guidDB;//GuidfordatabasevolumeCENOTIFYREQUESTcenr;//Notifyrequeststructure.intg_nLastSort=0;//LastsortorderusedCEDBASEINFOEXg_diex;//Sortorderarray//Thesetwovariablesrepresentaone-itemcachefor//thelistviewcontrol.intg_nLastItem=-1;LPBYTEg_pLastRecord=0;
5、//MessagedispatchtableforMainWindowProcconststructdecodeUINTMainMessages[]={WM_CREATE,DoCreateMain,WM_SIZE,DoSizeMain,WM_COMMAND,DoCommandMain,WM_NOTIFY,DoNotifyMain,WM_DESTROY,DoDestroyMain,WM_DBNOTIFICATION,DoDbNotifyMain,};//CommandmessagedispatchforMainWindowProcconststructdecode
6、CMDMainCommandItems[]={IDM_DELDB,DoMainCommandDelDB,IDM_EXIT,DoMainCommandExit,IDM_NEW,DoMainCommandNew,IDM_EDIT,DoMainCommandEdit,IDM_DELETE,DoMainCommandDelete,IDM_SORTNAME,DoMainCommandSort,IDM_SORTARTIST,DoMainCommandSort,IDM_SORTCATEGORY,DoMainCommandSort,IDM_ABOUT,DoMainCommand
7、About,};//Albumcategorystrings;mustbealphabetical.constTCHAR*pszCategories[]={TEXT("Family"),TEXT("Friends"),TEXT("collague"),TEXT("mates")};//======================================================================//Programentrypoint//intWINAPIWinMain(HINSTANCEhInstance,HINSTANCEhPrev
8、Instance,LPW