本文整理汇总了C++中OleUninitialize函数的典型用法代码示例。如果您正苦于以下问题:C++ OleUninitialize函数的具体用法?C++ OleUninitialize怎么用?C++ OleUninitialize使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OleUninitialize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Unregister
bool ISimpleDropTarget::Register(HWND hwnd)
{
if (IsWindow(m_hwnd))
{
Unregister();
}
if (!IsWindow(hwnd)) {
throw L"Tried to register non window for Drag&Drop!";
return false;
}
HRESULT result = OleInitialize(NULL);
if (SUCCEEDED(result)) {
result = RegisterDragDrop(hwnd, this);
if (SUCCEEDED(result)) {
m_hwnd = hwnd;
return true;
}
else
{
RevokeDragDrop(hwnd);
OleUninitialize();
throw L"Drag&Drop already attached to window!";
}
}
else
{
throw L"Drag&Drop already attached to window!";
OleUninitialize();
}
return false;
}
示例2: RenderAllFormats
void Ctrl::ExitWin32()
{
RenderAllFormats();
OleUninitialize();
sFinished = true;
for(int i = 0; i < Windows().GetCount(); i++) {
HWND hwnd = Windows().GetKey(i);
if(hwnd)
::DestroyWindow(hwnd);
}
MSG msg;
while(PeekMsg(msg))
if(msg.message != WM_QUIT)
::PostQuitMessage(0);
#ifndef flagDLL
#ifndef PLATFORM_WINCE
ELOG("ExitWin32 1");
OverwatchEndSession.Set();
ELOG("ExitWin32 2");
PostMessage(OverwatchHWND, WM_USER, 0, 0);
ELOG("ExitWin32 3");
LLOG("Waiting for overwatch thread to finish...");
WaitForSingleObject(OverwatchThread, INFINITE);
ELOG("ExitWin32 4");
LLOG("...overwatch thread finished");
#endif
#endif
}
示例3: wWinMain
int APIENTRY wWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPWSTR lpCmdLine,
int nCmdShow)
{
ghInstance = hInstance;
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
UNREFERENCED_PARAMETER(nCmdShow);
OleInitialize(0); // for system drag-n-drop
// comment this out if you need system theming
::SciterSetOption(NULL,SCITER_SET_UX_THEMING,TRUE);
auto message_pump = []() -> int {
MSG msg;
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (int) msg.wParam;
};
int r = uimain(message_pump);
OleUninitialize();
return r;
}
示例4: StartThread
static void __cdecl StartThread(void *vContainer) {
OleInitialize(NULL);
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_GROUPCHAT_CONTAINER), NULL, ContainerDlgProc, (LPARAM) vContainer);
//MessageBox(NULL, "ChatContainer dies.", "MW", MB_OK);
OleUninitialize();
}
示例5: RevokeHandler
DropHandler::~DropHandler()
{
if (_revokeOnDestroy)
RevokeHandler();
if (_uninitializeOLE)
OleUninitialize();
}
示例6: _tWinMain
/**
* @brief Application entry point.
* @param hInstance - Handle to the current instance of the application.
* @param hPrevInstance - Handle to the previous instance of the application. This parameter is always NULL.
* @param pszCmdLine - Pointer to a null-terminated string specifying the command line for the application, excluding the program name.
* @param nCmdShow - Specifies how the window is to be shown.
*/
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, PTSTR pszCmdLine, int nCmdShow)
{
#ifdef _CRTDBG_MAP_ALLOC
// Watch for memory leaks.
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_LEAK_CHECK_DF);
#endif
HRESULT hRes = OleInitialize(NULL);
ATLASSERT(SUCCEEDED(hRes));
// This resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used.
::DefWindowProc(NULL, 0, 0, 0L);
AtlInitCommonControls(ICC_LISTVIEW_CLASSES | ICC_BAR_CLASSES); // Add flags to support other controls.
hRes = _Module.Init(NULL, hInstance);
ATLASSERT(SUCCEEDED(hRes));
int nRet = Run(pszCmdLine, nCmdShow);
_Module.Term();
OleUninitialize();
return nRet;
}
示例7: WinMain
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int nCmdShow)
{
HRESULT Hr = ::CoInitialize(NULL);
if( FAILED(Hr) ) return 0;
HRESULT hRes = ::OleInitialize(NULL);
// 初始化UI管理器
CPaintManagerUI::SetInstance(hInstance);
// 初始化资源
InitResource();
::SetCurrentDirectory(CPaintManagerUI::GetInstancePath());
#ifndef _DEBUG
CPaintManagerUI::LoadPlugin(_T("TroyControls.dll"));
#else
CPaintManagerUI::LoadPlugin(_T("TroyControls_d.dll"));
#endif
CMainWnd* pFrame = new CMainWnd();
if( pFrame == NULL ) return 0;
pFrame->Create(NULL, _T("TroyBrowser"), UI_WNDSTYLE_FRAME, 0L, 0, 0, 990,690);
pFrame->CenterWindow();
pFrame->ShowModal();
CPaintManagerUI::MessageLoop();
OleUninitialize();
::CoUninitialize();
return 0;
}
示例8: WinMain
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int nCmdShow)
{
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
HRESULT Hr = ::CoInitialize(NULL);
if( FAILED(Hr) ) return 0;
HRESULT hRes = ::OleInitialize(NULL);
// 初始化UI管理器
CPaintManagerUI::SetInstance(hInstance);
// 初始化资源
InitResource();
CDemoFrame* pFrame = new CDemoFrame();
if( pFrame == NULL ) return 0;
pFrame->Create(NULL, _T("duilib使用例子集锦(By Troy)"), UI_WNDSTYLE_FRAME, 0L, 0, 0, 800, 572);
pFrame->CenterWindow();
ShowWindow(*pFrame, SW_SHOW);
CPaintManagerUI::MessageLoop();
delete pFrame;
pFrame = NULL;
CResourceManager::GetInstance()->Release();
OleUninitialize();
::CoUninitialize();
return 0;
}
示例9: _tWinMain
// 程序入口.
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
HRESULT hRes = OleInitialize(NULL);
// this resolves ATL window thunking problem when Microsoft Layer
// for Unicode (MSLU) is used.
::DefWindowProc(NULL, 0, 0, 0L);
DemoViewDelegate delegate;
CommandLine::Init(0, NULL);
DemoMain main;
main.Run();
OleUninitialize();
return 0;
}
示例10: _refNum
Webbrowser::Webbrowser(void):
_refNum(0),
//_rcWebWnd(0),
_bInPlaced(false),
_bExternalPlace(false),
_bCalledCanInPlace(false),
_bWebWndInited(false),
_pOleObj(NULL),
_pInPlaceObj(NULL),
_pStorage(NULL),
_pWB2(NULL),
_pHtmlDoc2(NULL),
_pHtmlDoc3(NULL),
_pHtmlWnd2(NULL),
_pHtmlEvent(NULL)
{
::memset( (PVOID)&_rcWebWnd,0,sizeof(_rcWebWnd));
HRTEST_SE( OleInitialize(0),L"Failed in Initialize Ole");
HRTEST_SE( StgCreateDocfile(0,STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_DIRECT | STGM_CREATE,0,&_pStorage),L"ERROR:StgCreateDocfile");
HRTEST_SE( OleCreate(CLSID_WebBrowser,IID_IOleObject,OLERENDER_DRAW,0,this,_pStorage,(void**)&_pOleObj),L"Create Ole Failed");
HRTEST_SE( _pOleObj->QueryInterface(IID_IOleInPlaceObject,(LPVOID*)&_pInPlaceObj),L"Create OleInPlaceObject Failed");
GetWebBrowser2();
OleUninitialize();
RETURN:
return;
}
示例11: catch
void ModuleEntry::ShutDown()
{
ModuleEntry * pme;
for (pme = s_pmeFirst; pme; pme = pme->m_pobjNext)
{
try
{
pme->ProcessDetach();
}
catch (const Throwable & thr)
{
WarnHr(thr.Error());
}
catch (...)
{
return WarnHr(E_FAIL);
}
}
// Uninitialize COM, first shutting down the clipboard.
if (s_qdobjClipboard.Ptr())
{
hr = OleIsCurrentClipboard(s_qdobjClipboard.Ptr());
WarnHr(hr);
if (hr == S_OK)
{
WarnHr(OleFlushClipboard());
}
s_qdobjClipboard.Clear();
}
OleUninitialize();
}
示例12: OleUninitialize
Win32Host::~Win32Host()
{
if (ole_initialized)
{
OleUninitialize();
}
}
示例13: SUCCEEDED
int CDownloadTask::Run()
{
// if ( theApp.m_bIsVistaOrNewer )
// ::SetThreadPriority( GetCurrentThread(), THREAD_MODE_BACKGROUND_BEGIN ); // Too aggressive?
BOOL bCOM = SUCCEEDED( OleInitialize( NULL ) );
switch ( m_nTask )
{
case dtaskCopy:
RunCopy();
break;
case dtaskMergeFile:
RunMerge();
break;
case dtaskPreviewRequest:
RunPreviewRequest();
// break;
}
if ( bCOM )
OleUninitialize();
return 0;
}
示例14: RevokeDragDrop
bool ISimpleDropTarget::Unregister()
{
RevokeDragDrop(m_hwnd);
OleUninitialize();
m_hwnd = NULL;
return true;
}
示例15: ReleaseHelpViewer
void ReleaseHelpViewer(HHInfo *info)
{
TRACE("(%p)\n", info);
if (!info)
return;
/* Free allocated strings */
heap_free(info->pszType);
heap_free(info->pszCaption);
heap_free(info->pszToc);
heap_free(info->pszIndex);
heap_free(info->pszFile);
heap_free(info->pszHome);
heap_free(info->pszJump1);
heap_free(info->pszJump2);
heap_free(info->pszUrlJump1);
heap_free(info->pszUrlJump2);
if (info->pCHMInfo)
CloseCHM(info->pCHMInfo);
ReleaseWebBrowser(info);
ReleaseContent(info);
ReleaseIndex(info);
ReleaseSearch(info);
if(info->WinType.hwndHelp)
DestroyWindow(info->WinType.hwndHelp);
heap_free(info);
OleUninitialize();
}