这篇教程C++ AfxSetResourceHandle函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AfxSetResourceHandle函数的典型用法代码示例。如果您正苦于以下问题:C++ AfxSetResourceHandle函数的具体用法?C++ AfxSetResourceHandle怎么用?C++ AfxSetResourceHandle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AfxSetResourceHandle函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AfxGetAppBOOL CParticleEditor::Initialize( ){ CWinApp* pApp = AfxGetApp(); ASSERT(pApp != NULL); if (pApp == NULL) { return FALSE; } // get the apps instance handle for loading resources m_AppInst = AfxGetResourceHandle(); //Direct the application to look in dll for resources AfxSetResourceHandle(ParticleEditorDLL.hModule); // use my string / icon resources // Note IDR_EXAMPLETYPE has to be a unique id even between DLLS // to get the ICONS right on the Window m_DocTemplate = new CMultiDocTemplate(IDR_PARTICLETYPE, RUNTIME_CLASS(CParticleDoc), RUNTIME_CLASS(CParticleFrame), RUNTIME_CLASS(CParticleRenderView)); // put this after setting the menu and accelerators so it won't allocate it's own pApp->AddDocTemplate(m_DocTemplate); // construct resource info m_ObjCollection.name.LoadString(IDS_RESOURCE_NAME); m_ObjCollection.pageIndex = &m_PageIndex; m_ObjCollection.hIcon = (HICON)LoadImage(ParticleEditorDLL.hModule, MAKEINTRESOURCE(IDR_PARTICLETYPE), IMAGE_ICON, 0, 0, LR_CREATEDIBSECTION); VERIFY(m_ObjCollection.hIcon != NULL); // value should be 1 - 1000 // NOTE: Against convention this was set at coding to 31000 even the example is set at 5000 m_ObjCollection.priority = IDR_PARTICLETYPE; m_ObjCollection.extensions = PARTICLE_EXTENSIONS; AfxSetResourceHandle(m_AppInst); return TRUE;}
开发者ID:klhurley,项目名称:ElementalEngine2,代码行数:42,
示例2: ASSERTVOID Language::UnInstallRunLanguage()///设置成保存的资源进程{//卸载资源 // ASSERT(m_hOldInstance!=NULL); if(m_hOldInstance==NULL)return; HINSTANCE hInstal; hInstal=AfxGetResourceHandle(); ASSERT(FreeLibrary(hInstal)); AfxSetResourceHandle(m_hOldInstance); m_hCurrentInstance=m_hOldInstance; m_hOldInstance=NULL; }
开发者ID:uesoft,项目名称:SelEngineVolume,代码行数:11,
示例3: AfxGetResourceHandlevoid CMediaVisDlg::OnSetup(){ int nItem = m_wndList.GetNextItem( -1, LVIS_SELECTED ); if ( nItem < 0 ) return; CString strCLSID = m_wndList.GetItemText( nItem, 1 ); CString strPath = m_wndList.GetItemText( nItem, 2 ); CLSID pCLSID; if ( ! Hashes::fromGuid( strCLSID, &pCLSID ) ) return; if ( ! Plugins.LookupEnable( pCLSID ) ) return; IAudioVisPlugin* pPlugin = NULL; if ( Settings.MediaPlayer.VisCLSID == strCLSID && Settings.MediaPlayer.VisPath == strPath ) { IMediaPlayer* pPlayer = ( m_pFrame != NULL ) ? m_pFrame->GetPlayer() : NULL; if ( pPlayer != NULL ) { pPlayer->GetPlugin( &pPlugin ); if ( pPlugin != NULL ) { pPlugin->Configure(); pPlugin->Release(); return; } } } HINSTANCE hRes = AfxGetResourceHandle(); HRESULT hr = CoCreateInstance( pCLSID, NULL, CLSCTX_ALL, IID_IAudioVisPlugin, (void**)&pPlugin ); AfxSetResourceHandle( hRes ); if ( FAILED( hr ) || pPlugin == NULL ) return; if ( ! strPath.IsEmpty() ) { IWrappedPluginControl* pWrap = NULL; hr = pPlugin->QueryInterface( IID_IWrappedPluginControl, (void**)&pWrap ); if ( SUCCEEDED( hr ) && pWrap != NULL ) { pWrap->Load( CComBSTR( strPath ), 0 ); pWrap->Release(); } } pPlugin->Configure(); pPlugin->Release();}
开发者ID:GetEnvy,项目名称:Envy,代码行数:54,
示例4: OnInitDialog virtual BOOL OnInitDialog() { AfxSetResourceHandle(m_ResourceDllHandle); AfxSetResourceHandle(m_ExeHandle); //call the Trace Dlg and not TabbedBaseTraceDlg because //the dialogs that are displayed on the tab control //should be taken from the Exe resources while the trace dialog //is taken from the Resource Dll CTraceTabBaseDlg::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control }
开发者ID:BlueSpells,项目名称:MapGen,代码行数:20,
示例5: AfxSetResourceHandle//控件绑定void CCompanionTreeCtrl::PreSubclassWindow(){ //加载图片 if (m_ImageList.GetSafeHandle()==NULL) { CBitmap TreeImage; AfxSetResourceHandle(GetModuleHandle(COMPANION_DLL_NAME)); TreeImage.LoadBitmap(IDB_TREE_IMAGE); AfxSetResourceHandle(GetModuleHandle(NULL)); m_ImageList.Create(18,18,ILC_COLOR16|ILC_MASK,0,0); m_ImageList.Add(&TreeImage,RGB(255,0,255)); } SetImageList(&m_ImageList,LVSIL_NORMAL); //设置控件 SetItemHeight(20); SetTextColor(RGB(10,10,10)); SetBkColor(RGB(245,255,205)); SendMessage(WN_SET_LINE_COLOR,0,(LPARAM)RGB(69,69,69)); //插入子项 TV_INSERTSTRUCT InsertInf; memset(&InsertInf,0,sizeof(InsertInf)); InsertInf.item.cchTextMax=128; InsertInf.hInsertAfter=TVI_LAST; InsertInf.item.mask=TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_TEXT|TVIF_PARAM; //游戏好友 InsertInf.item.iImage=IMAGE_FRIEND; InsertInf.item.iSelectedImage=IMAGE_FRIEND; InsertInf.item.pszText=TEXT("游戏好友"); m_hItemFriend=InsertItem(&InsertInf); //厌恶玩家 InsertInf.item.iImage=IMAGE_DETEST; InsertInf.item.iSelectedImage=IMAGE_DETEST; InsertInf.item.pszText=TEXT("游戏黑名单"); m_hItemDetest=InsertItem(&InsertInf); __super::PreSubclassWindow();}
开发者ID:275958081,项目名称:netfox,代码行数:42,
示例6: CHashString//---------------------------------------------------------------------// Function: OnCreate// Description: Called from the main windows create function// Parameters: CMDIFrameWnd *mainWnd = main frames CMDIFrameWnd pointer// Returns: .//---------------------------------------------------------------------void CStateMachineEditor::OnCreate(CMDIFrameWnd *mainWnd){ MENUINFOMESSAGE mim; CBitmap menuBitmap; HINSTANCE appInst; static DWORD msgHash_GetMenuInfo = CHashString(_T("GetMenuInfo")).GetUniqueID(); m_ToolBox->SendMessage(msgHash_GetMenuInfo, sizeof(MENUINFOMESSAGE), &mim); // get the apps instance handle for loading resources appInst = AfxGetResourceHandle(); // now tell the application to look in dll for resources AfxSetResourceHandle(StateMachineEditorDLL.hModule); // we need to mergeMenus VERIFY(MergeMenus(&m_DocTemplate->m_hMenuShared, mim.m_hMenu, _T("&Window"))); // and accelerators VERIFY(MergeAccelerators(&m_DocTemplate->m_hAccelTable, mim.m_hAccel)); mim.m_hAccel = NULL; mim.m_hMenu = NULL; // load up hi-res toolbar icon //menuBitmap.LoadBitmap(IDB_TOOLBAR); // we don't really have to have to toolbar visible do we? //mim.m_MenuRsrc = IDR_STATEMACHINETYPE; //mim.m_MenuBitmap = &menuBitmap; static DWORD msgHash_SetMenuInfo = CHashString(_T("SetMenuInfo")).GetUniqueID(); m_ToolBox->SendMessage(msgHash_SetMenuInfo, sizeof(MENUINFOMESSAGE), &mim); static DWORD msgHash_RegisterResourceCollection = CHashString(_T("RegisterResourceCollection")).GetUniqueID(); m_ToolBox->SendMessage(msgHash_RegisterResourceCollection, sizeof(RESOURCECOLLECTION), &m_ObjCollection); FILETYPECREATIONINFO fileInfo; fileInfo.m_Description = STATEMACHINE_FILE_DESCRIPTION; fileInfo.m_CreationCallback = CStateMachineEditor::StateMachineEditorCreationCallback; static DWORD msgHash_RegisterFileTypeCreationInfo = CHashString(_T("RegisterFileTypeCreationInfo")).GetUniqueID(); m_ToolBox->SendMessage(msgHash_RegisterFileTypeCreationInfo, sizeof( FILETYPECREATIONINFO ), &fileInfo ); AfxSetResourceHandle(appInst);}
开发者ID:klhurley,项目名称:ElementalEngine2,代码行数:47,
示例7: GetWindowTextvoid CTEditCtrlWnd::SetEditFocus(){ if(m_pEditCtrl) { CString strBeforeText; GetWindowText(strBeforeText); m_pEditCtrl->SetBeforText(strBeforeText); } int nGap = 1; CRect rcClient; CString strWindow; if (m_bEnable == TRUE) return; GetClientRect(rcClient); rcClient.DeflateRect(nGap, nGap, nGap, nGap); CRect rt; GetWindowRect(rt); ScreenToClient(rt); HINSTANCE hInstSave = AfxGetResourceHandle(); AfxSetResourceHandle(theApp.m_hInstance); m_pEditCtrl->Create(rcClient, this, IDC_EDIT_MAPLOADEDIT, m_nIntegerLength, m_nRealLength, m_bUseMinus); m_pEditCtrl->SetFont(&m_fontDefault); m_pEditCtrl->IngnoreComma(m_bIgnoreComma); AfxSetResourceHandle(hInstSave); if (m_pEditCtrl->GetSafeHwnd() != NULL) { GetWindowText(strWindow); m_pEditCtrl->SetInit(strWindow); }}
开发者ID:kjkpoi,项目名称:Stock_API,代码行数:41,
示例8: AfxSetResourceHandleBOOL CQuoteReportApp::InitInstance(){ CWinApp::InitInstance(); HINSTANCE hRes = (HINSTANCE)CWinnerApplication::GetModuleHandle(_T("QuoteLang.dll")); if (hRes) { CWinnerApplication::FormatLog(INFO_LOG_LEVEL,QuoteReportLoggerName,"行情报价模块-重设资源句柄为:%x",hRes); AfxSetResourceHandle(hRes); } return TRUE;}
开发者ID:hefen1,项目名称:XCaimi,代码行数:12,
示例9: LoadIconFromModule HICON LoadIconFromModule(UINT uID, LPCTSTR lpzModuleName) { HICON hRet = NULL; HINSTANCE hResOld = SwitchResourceToModule(lpzModuleName); { hRet = LoadIcon(AfxGetResourceHandle(), MAKEINTRESOURCE(uID)); } AfxSetResourceHandle(hResOld); return hRet; };
开发者ID:fffonion,项目名称:V8,代码行数:12,
示例10: GetClientRect//鼠标按下消息void CControlMessage::OnLButtonDown(UINT nFlags, CPoint point){ if (m_SplitWnd.GetSafeHwnd()==NULL) { CRect ClientRect; GetClientRect(&ClientRect); ClientRect.right=__max(ClientRect.right,3); MapWindowPoints(GetParent(),&ClientRect); HINSTANCE hLastHandle=AfxGetResourceHandle(); AfxSetResourceHandle(GetModuleHandle(FACE_DLL_NAME)); if (m_SplitWnd.Create(NULL,NULL,WS_CHILD|WS_VISIBLE,ClientRect,GetParent(),10)) { m_SplitWnd.BringWindowToTop(); SetFocus(); SetCapture(); } AfxSetResourceHandle(hLastHandle); } return;}
开发者ID:liuwanbing,项目名称:liuwanbing,代码行数:22,
示例11: AfxSetResourceHandle//初始化函数BOOL CDlgServerItem::OnInitDialog(){ __super::OnInitDialog(); //设置资源 AfxSetResourceHandle(GetModuleHandle(NULL)); //加载房间 LoadDBServerItem(); return TRUE;}
开发者ID:lonyzone,项目名称:oathx-ogrex-editor,代码行数:13,
示例12: get_dll_resourcevoid get_dll_resource(void){ /* this function changes the resource handle to that of the DLL */ if (resource_counter == 0) { AFX_MODULE_STATE* pModule= AfxGetStaticModuleState(); save_hInstance = AfxGetResourceHandle(); AfxSetResourceHandle(pModule->m_hCurrentResourceHandle); } resource_counter++;}
开发者ID:ZhangYueqiu,项目名称:Script.NET,代码行数:12,
示例13: AfxSetResourceHandlebool GLIShaderDebug::Init(HINSTANCE hInstance, HWND parentWnd, SciTEBase *newScite){ //If already init, return false; if(debugInstance != NULL) { return false; } //Assign the MFC instance handle afxCurrentInstanceHandle = hInstance; AfxSetResourceHandle(hInstance); //Create the instance debugInstance = new GLIShaderDebug(newScite); //Create the dialog window debugInstance->dialogWindow = ::CreateDialog(hInstance, MAKEINTRESOURCE(IDD_GLISHADERDEBUG), parentWnd, ShaderDebugMsg); if(!debugInstance->dialogWindow) { newScite->OutputAppendString("== Unable to init the GLIntercept shader debug window ==/n"); delete debugInstance; debugInstance = NULL; return false; } //Position window HWND parent = GetParent(debugInstance->dialogWindow); if(parent) { RECT parentPos; RECT dialogSize; if(GetWindowRect(parent, &parentPos) && GetWindowRect(debugInstance->dialogWindow, &dialogSize)) { //Position the window to the right of the host window int newW = dialogSize.right - dialogSize.left; int newH = dialogSize.bottom - dialogSize.top; int newX = parentPos.right - (newW/4) + 50; int newY = parentPos.top + 160; //Set the new window position (Don't activate it) SetWindowPos(debugInstance->dialogWindow, HWND_TOP, newX, newY, newW, newH, SWP_NOACTIVATE); } } //Show the window //ShowWindow(debugInstance->dialogWindow, SW_SHOW); return true;}
开发者ID:Shailla,项目名称:jeukitue.moteur,代码行数:53,
示例14: GetRectvoid VDEIODLL_EXPORT_API GetRect(CPoint& Point1,CPoint& Point2,BOOL& bFlag){ AFX_MANAGE_STATE(AfxGetStaticModuleState()); HINSTANCE main_hInstance = AfxGetResourceHandle(); //获取主程序资源句柄 AfxSetResourceHandle(theApp.m_hInstance); //获取dll程序资源句柄 CWVedio Dlg; int ret = Dlg.DoModal(); if (ret == 100) { Dlg.GetPoint(Point1,Point2,bFlag); }}
开发者ID:Strongc,项目名称:game-ui-solution,代码行数:12,
示例15: StartVediovoid VDEIODLL_EXPORT_API StartVedio(CString strFilePath,CString strFileName,int nRate, CPoint Point1,CPoint Point2,int nFlag,HWND GetCurHwnd){ AFX_MANAGE_STATE(AfxGetStaticModuleState()); HINSTANCE main_hInstance = AfxGetResourceHandle(); //获取主程序资源句柄 AfxSetResourceHandle(theApp.m_hInstance); //获取dll程序资源句柄 if(NULL == lpVeioScreen) { lpVeioScreen = new VedioScreen(strFilePath,strFileName,nRate,Point1,Point2,nFlag,GetCurHwnd); lpVeioScreen->StartVedio(); }}
开发者ID:Strongc,项目名称:game-ui-solution,代码行数:12,
示例16: Filter_ShowConfigDlgUSAGEMODE HRESULT Filter_ShowConfigDlg(void* pExistingFilter, const SMSGENTRY* psMsgEntry, ETYPE_BUS eType, UINT nHardware, CWnd* pParent){ //Place this code at the beginning of the export function. //Save previous resource handle and switch to current one. HINSTANCE hInst = AfxGetResourceHandle(); AfxSetResourceHandle(FilterDLL.hResource); HRESULT hResult = S_FALSE; switch (eType) { case CAN: { if (pExistingFilter != NULL) { SFILTERAPPLIED_CAN* pAppliedFilterCan = (SFILTERAPPLIED_CAN*)pExistingFilter; SFILTERAPPLIED_CAN sTempObj; sTempObj.bClone(*pAppliedFilterCan); CFilterConfigDlg omDlg(&sTempObj, psMsgEntry, nHardware, pParent); if (omDlg.DoModal() == IDOK) { pAppliedFilterCan->bClone(sTempObj); hResult = S_OK; } //delete omDlg; } } break; default: { } break; } //Place this at the end of the export function. //switch back to previous resource handle. AfxSetResourceHandle(hInst); return hResult;}
开发者ID:Conti-Meissner,项目名称:busmaster,代码行数:39,
示例17: AfxSetResourceHandle//更新图标VOID CGameServerDlg::UpdateServerLogo(LPCTSTR pszServerDLL){ //加载资源 HINSTANCE hInstance=AfxLoadLibrary(pszServerDLL); //加载图形 if (hInstance!=NULL) { //设置资源 AfxSetResourceHandle(hInstance); //设置资源 CStatic * pServerLogo=(CStatic *)GetDlgItem(IDC_SERVER_LOGO); pServerLogo->SetIcon(::LoadIcon(hInstance,TEXT("SERVER_ICON"))); //释放资源 AfxFreeLibrary(hInstance); AfxSetResourceHandle(GetModuleHandle(NULL)); } return;}
开发者ID:lonyzone,项目名称:whplaza,代码行数:23,
示例18: AfxGetResourceHandlevoid CPlayProfilePage::OnMore(){ int nItem = m_wndList.GetNextItem( -1, LVNI_SELECTED ); if ( nItem == -1 ) return; CXMLElement* pXML = (CXMLElement*)m_wndList.GetItemData( nItem ); CString strText; m_wndClass.GetWindowText( strText ); if ( m_wndClass.FindStringExact( -1, strText ) != CB_ERR && strText.CompareNoCase( "会议类" ) == 0 ) { HINSTANCE hPrevInst = AfxGetResourceHandle(); if ( m_hInstance ) AfxSetResourceHandle( m_hInstance ); CChatPropertiesDlg dlg( pXML->GetParent(), this ); dlg.DoModal(); AfxSetResourceHandle( hPrevInst ); }}
开发者ID:pics860,项目名称:callcenter,代码行数:22,
示例19: CHashString/// Process creating new window command/// /param size - unused/// /param param - unusedDWORD CUndoRedoComponent::OnCreate(DWORD size, void *param){ MENUINFOMESSAGE mim; static DWORD msgHash_GetMenuInfo = CHashString(_T("GetMenuInfo")).GetUniqueID(); m_pToolBox->SendMessage(msgHash_GetMenuInfo, sizeof(MENUINFOMESSAGE),&mim); // get the application instance handle for loading resources HINSTANCE appInst = AfxGetResourceHandle(); // now tell the application to look in dll for resources AfxSetResourceHandle(UndoRedoDLL.hModule); CMenu menu; menu.LoadMenu(IDR_UNDO_MENU); ASSERT(menu.m_hMenu != NULL); // we need to Merge Menus with Undo/Redo items // this code works now, but it may need to be updated for exact filling the menu const int nEditMenuPosition = 1; HMENU hEditMenu = GetSubMenu(mim.m_hMenu, nEditMenuPosition); TCHAR menuName[8]; if (!GetMenuString(mim.m_hMenu, nEditMenuPosition, menuName, RTL_NUMBER_OF(menuName), MF_BYPOSITION) && !_tcscmp(menuName, _T("&Edit"))) { ASSERT(0); } VERIFY(MergeSubPopupMenu(hEditMenu, menu.GetSubMenu(0)->m_hMenu)); // and add accelerators HACCEL hAccel = ::LoadAccelerators(UndoRedoDLL.hResource, MAKEINTRESOURCE(IDR_UNDO_ACCELERATOR)); ASSERT(hAccel != NULL); VERIFY(MergeAccelerators(&mim.m_hAccel, hAccel)); VERIFY(::DestroyAcceleratorTable(hAccel)); // TODO: add shortcut label to menu items static DWORD msgHash_SetMenuInfo = CHashString(_T("SetMenuInfo")).GetUniqueID(); m_pToolBox->SendMessage(msgHash_SetMenuInfo, sizeof(MENUINFOMESSAGE),&mim); AfxSetResourceHandle(appInst); return MSG_HANDLED_PROCEED;}
开发者ID:klhurley,项目名称:ElementalEngine2,代码行数:42,
示例20: AfxGetResourceHandlevoid CMonitorWnd::OnMDIActivate(BOOL bActivate, CWnd* pActivateWnd, CWnd* pDeactivateWnd){ if ( bActivate ) { HINSTANCE hPrevInst = AfxGetResourceHandle(); HINSTANCE hInstance = m_hInstance ? (HINSTANCE)m_hInstance : NULL; if ( hInstance ) AfxSetResourceHandle( hInstance ); ApplyMenu( IDR_MONITORFRAME ); AfxSetResourceHandle( hPrevInst ); wndPanel.SetParent( this ); OnSize( SIZE_INTERNAL, 0, 0 ); } else { DestroyMenu(); } CChildWnd::OnMDIActivate( bActivate, pActivateWnd, pDeactivateWnd );}
开发者ID:pics860,项目名称:callcenter,代码行数:22,
示例21: AfxSetResourceHandle//选择头像bool CFaceSelectControl::GetSelectFaceID(WORD & wFaceID){ //设置资源 AfxSetResourceHandle(GetModuleHandle(AVATAR_CONTROL_DLL_NAME)); //显示窗口 if (DoModal()!=IDOK) return false; //设置变量 wFaceID=m_FaceItemSelectWnd.GetSelectFace(); return true;}
开发者ID:Michael-Z,项目名称:qipai-game,代码行数:14,
示例22: Filter_ShowSelDlgUSAGEMODE HRESULT Filter_ShowSelDlg(CWnd* pParent, CMainEntryList* podMainSubList){ //Place this code at the beginning of the export function. //Save previous resource handle and switch to current one. HINSTANCE hInst = AfxGetResourceHandle(); AfxSetResourceHandle(FilterDLL.hResource); SGUIPARAMS sGuiParams; /* Update GUI related information */ /* 1. Title Name, Main entry combo box name, Name of the list controls */ strcpy_s(sGuiParams.m_acTitleName, MAX_PATH, _("Filter Selection Dialog")); strcpy_s(sGuiParams.m_acMainListName, MAX_PATH, _("Bus")); strcpy_s(sGuiParams.m_acUnSelListName, MAX_PATH, _("Configured Filters")); strcpy_s(sGuiParams.m_acSelListName, MAX_PATH, _("Selected Filters")); /* Whether to combine main entry Id with sub entry name or not*/ sGuiParams.m_bCombine = FALSE; /* What image to be loaded */ sGuiParams.m_pomImageList = new CImageList; sGuiParams.m_pomImageList->Create(IDB_BMP_FILTER, 16, 1, defCOLOR_WHITE); //Icon index to unselected list sGuiParams.m_unUnSelIconIndex = 2; //Icon index to selected list sGuiParams.m_unSelIconIndex = 2; CMainSubListDlg omDlg(pParent, podMainSubList, sGuiParams); INT_PTR nReturn = omDlg.DoModal(); //delete the created list sGuiParams.m_pomImageList->DeleteImageList(); delete sGuiParams.m_pomImageList; //Place this at the end of the export function. //switch back to previous resource handle. AfxSetResourceHandle(hInst); return (HRESULT)nReturn;}
开发者ID:dejanki,项目名称:busmaster,代码行数:39,
示例23: registerAppInfovoid registerAppInfo(HINSTANCE hInstance){ HINSTANCE hPrevInst = AfxGetResourceHandle(); AfxSetResourceHandle(hInstance); USES_CONVERSION; HRESULT hRes = S_OK; CComPtr<IRegistrar> p; hRes = CoCreateInstance(CLSID_Registrar, NULL, CLSCTX_INPROC_SERVER, IID_IRegistrar, (void**)&p); if (SUCCEEDED (hRes)) { TCHAR szRegKey [MAX_PATH]; CString strAutoCADRegistryPath = acrxProductKey (); _tcscpy (szRegKey, strAutoCADRegistryPath); const TCHAR *pszDelimiter = "//"; TCHAR *pszToken = _tcstok (szRegKey, pszDelimiter); const TCHAR *pszIds[] = { "SOFTWARE", "AUTODESK", "AUTOCAD", "RELEASE", "AUTH" }; int nCount = 0; while (NULL != pszToken) { p->AddReplacement (T2OLE(pszIds[nCount]), T2OLE(pszToken)); pszToken = _tcstok (NULL, pszDelimiter); if (NULL == pszToken) break; nCount++; } TCHAR szModule [_MAX_PATH]; GetModuleFileName (hInstance, szModule, MAX_PATH); LPOLESTR pszModule = T2OLE (szModule); p->AddReplacement (T2OLE("MODULE"), pszModule); LPCOLESTR szType = OLESTR ("REGISTRY"); p->ResourceRegister (pszModule, IDR_REGISTRY_APP, szType); } AfxSetResourceHandle(hPrevInst);}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:38,
示例24: AfxGetResourceHandleint CPIDockablePane::OnCreate(LPCREATESTRUCT lpCreateStruct){ if (CDockablePane::OnCreate(lpCreateStruct) == -1) return -1; // TODO: 在此添加您专用的创建代码 CRect rectDummy; rectDummy.SetRectEmpty(); // create child window if (m_pChildWnd->GetSafeHwnd() == NULL) { // save current resource handle HINSTANCE hCurrentInstance = AfxGetResourceHandle(); AfxSetResourceHandle(m_hInstance); m_pChildWnd->Create(NULL, NULL, WS_CHILD | WS_VISIBLE, rectDummy, this, 1000); // restore resource handle AfxSetResourceHandle(hCurrentInstance); } return 0;}
开发者ID:chrisluu,项目名称:Plugin,代码行数:23,
示例25: AfxGetAppvoid CExpiredDlg::FillInControls(){ // Read the key stuff from the registry. CString regName = AfxGetApp()->GetProfileString("Config", "RegName"); CString regCode = AfxGetApp()->GetProfileString("Config", "RegCode"); time_t registrationTime; bool decoded = ValidateRegistrationCode(regCode, regName, registrationTime); if (decoded) { CTime time(registrationTime); CString timeStr = time.Format("%A, %B %d, %Y"); CString str; str.Format("Workspace Whiz is registered to:/n %s/non:/n %s", (LPCTSTR)regName, timeStr); GetDlgItem(IDC_WWRE_TEXT)->SetWindowText(str); SetWindowText("Workspace Whiz Registered Version"); GetDlgItem(IDC_WWRE_EVALUATE)->SetWindowText("Continue"); m_timeLeft.ShowWindow(SW_HIDE); m_timeLeftBar.ShowWindow(SW_HIDE); } else { HINSTANCE oldResourceHandle = AfxGetResourceHandle(); AfxSetResourceHandle(g_instance); CString timeLeftStr; timeLeftStr.LoadString(IDS_WWR_TIMELEFT); CString timeLeftStr2; timeLeftStr2.Format(timeLeftStr, m_numDays); m_timeLeft.SetWindowText(timeLeftStr2); AfxSetResourceHandle(oldResourceHandle); m_timeLeftBar.SetPos(m_numDays); }}
开发者ID:Luomu,项目名称:workspacewhiz,代码行数:37,
示例26: TRACEBOOL CMp3infpApp::InitInstance() { TRACE(_T("CMp3infpApp::InitInstance(0)/n")); theApp.m_hResource = NULL; CString strLangPath; strLangPath = regGetStringEx(HKEY_LOCAL_MACHINE,MP3INFP_REG_ENTRY,_T("path"),_T("c://progra~1//mp3infp")); AddTailYenSign(strLangPath); strLangPath += _T("language//"); CString strLanguage = regGetStringEx(HKEY_CURRENT_USER,MP3INFP_REG_ENTRY,_T("Language"),DEF_SETUP_MAIN_LANGUAGE); strLanguage += _T(".lng"); strLangPath += strLanguage; //theApp.m_hResource = LoadLibraryEx(strLangPath,0,LOAD_LIBRARY_AS_DATAFILE); theApp.m_hResource = LoadLibrary(strLangPath); if(theApp.m_hResource) { AfxSetResourceHandle(theApp.m_hResource); TCHAR tmp[20]; if((LoadString(AfxGetResourceHandle(),IDS_LANGUAGE_VER,tmp,sizeof_array(tmp)) == 0) || (_ttoi(tmp) < LANG_VER) ) { FreeLibrary(theApp.m_hResource); theApp.m_hResource = NULL; } } if(theApp.m_hResource == NULL) { // 言 C++ AfxSocketInit函数代码示例 C++ AfxRegisterWndClass函数代码示例
|