欢迎来到天天文库
浏览记录
ID:39156501
大小:20.02 KB
页数:4页
时间:2019-06-25
《mapgis67二次开发学习笔记》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、MAPGIS67二次开发学习笔记1.问题:文件-新建工程,文件-打开工程,实现代码处于DOC下,只是调用了VC的函数OnFileNew()和OnFileOpen(),如何实现打开mapgis工程的呢?答案:实现这个的具体操作在stringtable里面,只需修改参数即可,函数的话用VC的API函数即可。2.问题:如何控制一步一步打开程序界面。答案:主资源文件CPP,初始化组件库,初始化登录对话框,创建模板,add模板,创建窗口,ShowWindow,UpDateWindow。BOOLCFireMapApp::
2、InitInstance(){if(CoInitialize(NULL)!=0){AfxMessageBox("初始化COM支持库失败!");exit(1);}dengludeng;deng.DoModal();//CLogo*dlg=newCLogo();//dlg->Create(IDD_LOGO);//dlg->ShowWindow(SW_SHOW);//dlg->UpdateWindow();//Sleep(2000);AfxEnableControlContainer();//Standardini
3、tialization//Ifyouarenotusingthesefeaturesandwishtoreducethesize//ofyourfinalexecutable,youshouldremovefromthefollowing//thespecificinitializationroutinesyoudonotneed.#ifdef_AFXDLLEnable3dControls();//CallthiswhenusingMFCinasharedDLL#elseEnable3dControlsSta
4、tic();//CallthiswhenlinkingtoMFCstatically#endif//Changetheregistrykeyunderwhichoursettingsarestored.//TODO:Youshouldmodifythisstringtobesomethingappropriate//suchasthenameofyourcompanyororganization.SetRegistryKey(_T("LocalAppWizard-GeneratedApplications")
5、);LoadStdProfileSettings(6);//LoadstandardINIfileoptions(includingMRU)//Registertheapplication'sdocumenttemplates.Documenttemplates//serveastheconnectionbetweendocuments,framewindowsandviews.m_pPrjEditTemplate=newCMultiDocTemplate(IDR_MENU_MAPGIS,RUNTIME_CL
6、ASS(CFireMapDoc),RUNTIME_CLASS(CChildFrame),//customMDIchildframeRUNTIME_CLASS(CFireMapView));AddDocTemplate(m_pPrjEditTemplate);//createmainMDIFramewindowCMainFrame*pMainFrame=newCMainFrame;if(!pMainFrame->LoadFrame(IDR_MAINFRAME))returnFALSE;m_pMainWnd=pM
7、ainFrame;//Parsecommandlineforstandardshellcommands,DDE,fileopenCCommandLineInfocmdInfo;ParseCommandLine(cmdInfo);if(cmdInfo.m_strFileName.IsEmpty())cmdInfo.m_nShellCommand=CCommandLineInfo::FileNothing;elsecmdInfo.m_nShellCommand=CCommandLineInfo::FileOpen
8、;//Dispatchcommandsspecifiedonthecommandlineif(!ProcessShellCommand(cmdInfo))returnFALSE;//Themainwindowhasbeeninitialized,soshowandupdateit.pMainFrame->ShowWindow(SW_SHOWMAXIMIZED);pMainFrame->UpdateW
此文档下载收益归作者所有