新建gui插件:
- 新建项目→MFC DLL orsViewerExt_Common
- (可选操作)修改 orsViewerExt_Common.cpp和.h文件为orsViewerExt_Common.h和dllMain.cpp文件
- 添加菜单、icon、dialog等资源
- dllMain中,添加OnCmdMsg函数
- 新建orsViewerExt_Common类,继承 orsIViewerExtension orsObjectBase,实现函数
virtual void SetImageSource( orsIImageSource *pImg ); virtual bool create( orsIFrameWnd *frameWnd ); virtual bool pluginMenu( orsIFrameWnd *frameWnd ); virtual LRESULT windowProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
- 调用ORS_OBJECT_IMP2宏
- dllmain中实现菜单触发
- orsViewerExt_Common类中实现菜单事件
- 拷贝orsXPlugin.cpp到项目中,修改插件名等。