当前位置: 首页>>代码示例>>C++>>正文


C++ OleInitialize函数代码示例

本文整理汇总了C++中OleInitialize函数的典型用法代码示例。如果您正苦于以下问题:C++ OleInitialize函数的具体用法?C++ OleInitialize怎么用?C++ OleInitialize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了OleInitialize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AEffEditor

//-----------------------------------------------------------------------------
// AEffGUIEditor Implementation
//-----------------------------------------------------------------------------
AEffGUIEditor::AEffGUIEditor (void* pEffect) 
: AEffEditor ((AudioEffect*)pEffect)
, inIdleStuff (false)
{
	((AudioEffect*)pEffect)->setEditor (this);
	systemWindow = 0;
	lLastTicks   = getTicks ();

	#if WINDOWS
	OleInitialize (0);
	#endif
	#if MAC
	InitMachOLibrary ();
	#endif
}
开发者ID:sa-tsuklog,项目名称:MyLib,代码行数:18,代码来源:aeffguieditor.cpp

示例2: _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);

    base::EnableTerminationOnHeapCorruption();

    // 负责调用单件对象的析构函数.
    base::AtExitManager exit_manager;

    CommandLine::Init(0, NULL);

    FilePath res_dll;
    PathService::Get(base::DIR_EXE, &res_dll);
    res_dll = res_dll.Append(L"wanui_res.dll");
    ui::ResourceBundle::InitSharedInstance(res_dll);

    MessageLoop main_message_loop(MessageLoop::TYPE_UI);

    view::desktop::DesktopViewDelegate view_delegate;

    // 只支持纯view配置.
    view::Widget::SetPureViews(true);

    view::desktop::DesktopWindowView::CreateDesktopWindow(
        view::desktop::DesktopWindowView::DESKTOP_DEFAULT);
    view::desktop::DesktopWindowView::desktop_window_view->CreateTestWindow(
        L"Sample Window 1", SK_ColorWHITE, gfx::Rect(500, 200, 400, 400), true);
    view::desktop::DesktopWindowView::desktop_window_view->CreateTestWindow(
        L"Sample Window 2", SK_ColorRED, gfx::Rect(600, 450, 450, 300), false);

    view::AcceleratorHandler accelerator_handler;
    MessageLoopForUI::current()->Run(&accelerator_handler);

    ui::ResourceBundle::CleanupSharedInstance();
    OleUninitialize();

    return 0;
}
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:49,代码来源:desktop_main.cpp

示例3: OleInitialize

BOOL CXsvrApp::InitInstance()
{
	OleInitialize(NULL);
	AfxEnableControlContainer();

	InitializeCriticalSection(& g_cs);

	CFileFind fFind;
	CStdioFile file;
	char buf[MAX_PATH];
	GetProgramDirectory(buf);
	CString fileName;
	fileName.Format("%s%s", buf, "sys.log");
	if (! fFind.FindFile(fileName))
	{
	//	AfxMessageBox("File don't existed.");
		file.Open(fileName, CFile::modeCreate|CFile::modeWrite|CFile::shareDenyNone, NULL);
	}

	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.

#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif

	CXsvrDlg dlg;
	m_pMainWnd = &dlg;
	int nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with OK
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with Cancel
	}

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}
开发者ID:Crawping,项目名称:XEIM,代码行数:48,代码来源:xsvr.cpp

示例4: BoilerplateInit

void BoilerplateInit()
{
	OleInitialize(0);

	// Common controls (manifest must be present)
	{
		// Include the v6 common controls in the manifest
		#pragma comment(lib,"comctl32.lib")
		#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

		INITCOMMONCONTROLSEX InitCtrls;
		InitCtrls.dwSize = sizeof(INITCOMMONCONTROLSEX);
		InitCtrls.dwICC = ICC_WIN95_CLASSES | ICC_STANDARD_CLASSES;
		BOOL res = InitCommonControlsEx(&InitCtrls); _ASSERT(res);
	}
}
开发者ID:MISoftware,项目名称:SciterBootstrap-CPP,代码行数:16,代码来源:SciterBootstrap.cpp

示例5: EventWindow

void Host::Initialize(int argc, const char** argv)
{
    eventWindow = new EventWindow();
    mainThreadId = GetCurrentThreadId();
    OleInitialize(0);
    this->AddMessageHandler(&MainThreadJobsTickleHandler);

#ifndef DEBUG
    // only create a debug console when not compiled in debug mode
    // otherwise, it should be autocreated
    if (this->DebugModeEnabled())
    {
        RedirectIOToConsole();
    }
#endif
}
开发者ID:toisoftware,项目名称:TideSDK,代码行数:16,代码来源:win32_host.cpp

示例6: OleInitialize

/////////////////////////////////////////////////////////////////////////////
// AppMainApp initialization
BOOL AppMainApp::InitATL()
{
	m_bATLInited = TRUE;
	HRESULT hRes = OleInitialize(NULL);
/*#if _WIN32_WINNT >= 0x0400
		HRESULT hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED);
#else
		HRESULT hRes = CoInitialize(NULL);
#endif*/
	if (FAILED(hRes))
	{
		m_bATLInited = FALSE;
		return FALSE;
	}
	return TRUE;
}
开发者ID:calupator,项目名称:wiredplane-wintools,代码行数:18,代码来源:WireChanger.cpp

示例7: ecore_win32_dnd_init

/**
 * @brief Initialize the Ecore_Win32 Drag and Drop module.
 *
 * @return 1 or greater on success, 0 on error.
 *
 * This function initialize the Drag and Drop module. It returns 0 on
 * failure, otherwise it returns the number of times it has already
 * been called.
 *
 * When the Drag and Drop module is not used anymore, call
 * ecore_win32_dnd_shutdown() to shut down the module.
 */
EAPI int
ecore_win32_dnd_init()
{
   if (_ecore_win32_dnd_init_count > 0)
     {
	_ecore_win32_dnd_init_count++;
	return _ecore_win32_dnd_init_count;
     }

   if (OleInitialize(NULL) != S_OK)
     return 0;

   _ecore_win32_dnd_init_count++;

   return _ecore_win32_dnd_init_count;
}
开发者ID:roman5566,项目名称:EFL-PS3,代码行数:28,代码来源:ecore_win32_dnd.c

示例8: LoadSendRecvMessageModule

int LoadSendRecvMessageModule(void)
{
	if (LoadLibraryA("riched20.dll") == NULL) {
		if (IDYES !=
			MessageBoxA(0,
						Translate
						("Miranda could not load the built-in message module, riched20.dll is missing. If you are using Windows 95 or WINE please make sure you have riched20.dll installed. Press 'Yes' to continue loading Miranda."),
						Translate("Information"), MB_YESNO | MB_ICONINFORMATION))
			return 1;
		return 0;
	}
	hDLL = LoadLibraryA("user32");
	pSetLayeredWindowAttributes = (PSLWA) GetProcAddress(hDLL,"SetLayeredWindowAttributes");
	InitGlobals();
	RichUtil_Load();
	OleInitialize(NULL);
	InitREOleCallback();
	InitOptions();
	hEventDbEventAdded = HookEvent(ME_DB_EVENT_ADDED, MessageEventAdded);
	hEventDbSettingChange = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, MessageSettingChanged);
	hEventContactDeleted = HookEvent(ME_DB_CONTACT_DELETED, ContactDeleted);
	HookEvent(ME_SYSTEM_MODULESLOADED, SplitmsgModulesLoaded);
	HookEvent(ME_SKIN_ICONSCHANGED, IconsChanged);
	HookEvent(ME_PROTO_CONTACTISTYPING, TypingMessage);
	HookEvent(ME_SYSTEM_PRESHUTDOWN, PreshutdownSendRecv);
	CreateServiceFunction(MS_MSG_SENDMESSAGE, SendMessageCommand);
#if defined(_UNICODE)
	CreateServiceFunction(MS_MSG_SENDMESSAGE "W", SendMessageCommand);
#endif
	CreateServiceFunction(MS_MSG_GETWINDOWAPI, GetWindowAPI);
	CreateServiceFunction(MS_MSG_GETWINDOWCLASS, GetWindowClass);
	CreateServiceFunction(MS_MSG_GETWINDOWDATA, GetWindowData);
	CreateServiceFunction("SRMsg/ReadMessage", ReadMessageCommand);
	CreateServiceFunction("SRMsg/TypingMessage", TypingMessageCommand);
	hHookWinEvt=CreateHookableEvent(ME_MSG_WINDOWEVENT);
	SkinAddNewSoundEx("RecvMsgActive", Translate("Messages"), Translate("Incoming (Focused Window)"));
	SkinAddNewSoundEx("RecvMsgInactive", Translate("Messages"), Translate("Incoming (Unfocused Window)"));
	SkinAddNewSoundEx("AlertMsg", Translate("Messages"), Translate("Incoming (New Session)"));
	SkinAddNewSoundEx("SendMsg", Translate("Messages"), Translate("Outgoing"));
	hCurSplitNS = LoadCursor(NULL, IDC_SIZENS);
	hCurSplitWE = LoadCursor(NULL, IDC_SIZEWE);
	hCurHyperlinkHand = LoadCursor(NULL, IDC_HAND);
	if (hCurHyperlinkHand == NULL)
		hCurHyperlinkHand = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_HYPERLINKHAND));
	hDragCursor = LoadCursor(g_hInst,  MAKEINTRESOURCE(IDC_DRAGCURSOR));
	return 0;
}
开发者ID:BackupTheBerlios,项目名称:mgoodies-svn,代码行数:47,代码来源:msgs.c

示例9: get_target

// routine to find what a shortcut is pointing at
int
get_target(char *target_fname, char *retPath)
{
    HRESULT hres;
    IShellLink *shell_link;
    IPersistFile *persist_file;
    int result = 0;
	WCHAR wsz[MAX_PATH];

    hres = OleInitialize(NULL);
	if (hres != S_FALSE && hres != S_OK)
		return (-1);

    // Get a pointer to the IShellLink interface
    hres = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
			  &IID_IShellLink, (void **) &shell_link);

	if (!SUCCEEDED(hres)) {
		OleUninitialize();
		return (-1);
	}

    // Get a pointer to the IPersistFile interface
    hres = shell_link->lpVtbl->QueryInterface(shell_link, &IID_IPersistFile,
					    (void **) &persist_file);

	if (SUCCEEDED(hres)) {
		// Ensure that the string is Unicode
		MultiByteToWideChar(CP_ACP, 0, (LPCSTR) target_fname, -1, wsz, MAX_PATH);

		// Load the shortcut
		hres = persist_file->lpVtbl->Load(persist_file, wsz, STGM_READ);

		if (SUCCEEDED(hres)) {
			// read stuff from the link object and print it to the screen
			shell_link->lpVtbl->GetPath(shell_link, retPath,
							 MAX_PATH, NULL, SLGP_RAWPATH);
		} else
			result = -1;

		// Release the pointer to the IPersistFile interface
		persist_file->lpVtbl->Release(persist_file);
	}

	OleUninitialize();
	return(result);
}
开发者ID:birkirb,项目名称:wizd,代码行数:48,代码来源:wizd_tools.c

示例10: OleInitialize

int CWinMain::WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPTSTR lpsCmdLine, int nCmdShow)
{
	// WinMain function receives an argument of the program, which is assigned to a member variable
	m_hInst = hInst;
	m_hPrevInst = hPrevInst;
	m_lpsCmdLine = lpsCmdLine;
	m_nCmdShow = nCmdShow;

	OleInitialize(nullptr);

	if (!InitApp())
		return FALSE;

	if (!InitInstance())
		return FALSE;

	HACCEL hAccel = LoadAccelerators(hInst, _T("MYACCEL"));
	if (!hAccel)
		return FALSE;

	COption option;
	MSG msg;
	int bRet;
	while ((bRet = GetMessage(&msg, nullptr, 0, 0)) != 0)
	{
		if (bRet == -1)
		{
			break;
		}
		else if (!TranslateAccelerator(m_hWnd, hAccel, &msg))
		{
			//if (option.GetHandle() || !PropSheet_IsDialogMessage(option.GetHandle(), &msg))
			//{
				TranslateMessage(&msg);
				DispatchMessage(&msg);
			//}
			//if (option.GetHandle() && PropSheet_GetCurrentPageHwnd(option.GetHandle()) == nullptr)
			//{
				// Exits the property sheet
			//  option.Close();
			//}
		}
	}

	OleUninitialize();
	return static_cast<int>(msg.wParam);
}
开发者ID:Casidi,项目名称:ExtractData,代码行数:47,代码来源:WinMain.cpp

示例11: AtlAxWinInit

BOOL WINAPI AtlAxWinInit(void)
{
    WNDCLASSEXW wcex;

#if _ATL_VER == _ATL_VER_80
#define ATL_NAME_SUFFIX '8','0',0
#elif _ATL_VER == _ATL_VER_90
#define ATL_NAME_SUFFIX '9','0',0
#elif _ATL_VER == _ATL_VER_100
#define ATL_NAME_SUFFIX '1','0','0',0
#elif _ATL_VER == _ATL_VER_110
#define ATL_NAME_SUFFIX '1','1','0',0
#else
#error Unsupported version
#endif

    const WCHAR AtlAxWinW[] = {'A','t','l','A','x','W','i','n',ATL_NAME_SUFFIX};
    const WCHAR AtlAxWinLicW[] = {'A','t','l','A','x','W','i','n','L','i','c',ATL_NAME_SUFFIX};

    FIXME("version %04x semi-stub\n", _ATL_VER);

    if ( FAILED( OleInitialize(NULL) ) )
        return FALSE;

    wcex.cbSize        = sizeof(wcex);
    wcex.style         = CS_GLOBALCLASS | CS_DBLCLKS;
    wcex.cbClsExtra    = 0;
    wcex.cbWndExtra    = 0;
    wcex.hInstance     = GetModuleHandleW( NULL );
    wcex.hIcon         = NULL;
    wcex.hCursor       = NULL;
    wcex.hbrBackground = NULL;
    wcex.lpszMenuName  = NULL;
    wcex.hIconSm       = 0;

    wcex.lpfnWndProc   = AtlAxWin_wndproc;
    wcex.lpszClassName = AtlAxWinW;
    if ( !RegisterClassExW( &wcex ) )
        return FALSE;

    wcex.lpszClassName = AtlAxWinLicW;
    if ( !RegisterClassExW( &wcex ) )
        return FALSE;

    return TRUE;
}
开发者ID:ErikBjare,项目名称:wine,代码行数:46,代码来源:atl_ax.c

示例12: DllMain

BOOL MYWINAPI DllMain(HANDLE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
#endif
{
    switch(fdwReason)
	{
		/* ============================================================== */
		case DLL_PROCESS_ATTACH:
		{
			/*
			 * Here you would do any initialization that you want to do when
			 * the DLL loads. The OS calls this every time another program
			 * runs which uses this DLL. You should put some complementary
			 * cleanup code in the DLL_PROCESS_DETACH case.
			 */

            /* Initialize the OLE interface */
			if (OleInitialize(NULL)) return(0);
			break;
		}

		/* ============================================================== */
		case DLL_THREAD_ATTACH:
		{
			/* We don't need to do any initialization for each thread of
			 * the program which uses this DLL, so disable thread messages.
			 */
			DisableThreadLibraryCalls(hinstDLL);
			break;
		}

/*
		case DLL_THREAD_DETACH:
		{
			break;
		}
*/
		/* ============================================================== */
		case DLL_PROCESS_DETACH:
		{
			OleUninitialize();
		}
	}

	/* Success */
	return(1);
}
开发者ID:Akkarinage,项目名称:Neoncube,代码行数:46,代码来源:browser.c

示例13: ReleaseTraceCode

void Framework::InitializeNew()
{
	ReleaseTraceCode(FRAMEWORK_INITIALIZE);
	Trace("Framework::Initialize\n");

	OleInitialize(NULL);
	InitCommonControls();

	// 1. menu builder
	MenuBuilderStorage = new MenuBuilderStorageImpl_Unlimited;

	// 2. plugin manager
	PluginManager = new PluginManagerImpl_Unlimited;

	// 3. hotspot enabler
	HotspotEnabler = new HotspotEnablerImpl_Registered;
}
开发者ID:kerido,项目名称:koapch,代码行数:17,代码来源:Framework.cpp

示例14: test_CoCreateInstance

static void test_CoCreateInstance(void)
{
    REFCLSID rclsid = &CLSID_MyComputer;
    IUnknown *pUnk = (IUnknown *)0xdeadbeef;
    HRESULT hr = CoCreateInstance(rclsid, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&pUnk);
    ok(hr == CO_E_NOTINITIALIZED, "CoCreateInstance should have returned CO_E_NOTINITIALIZED instead of 0x%08lx\n", hr);
    ok(pUnk == NULL, "CoCreateInstance should have changed the passed in pointer to NULL, instead of %p\n", pUnk);

    OleInitialize(NULL);
    hr = CoCreateInstance(rclsid, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&pUnk);
    ok_ole_success(hr, "CoCreateInstance");
    IUnknown_Release(pUnk);
    OleUninitialize();

    hr = CoCreateInstance(rclsid, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&pUnk);
    ok(hr == CO_E_NOTINITIALIZED, "CoCreateInstance should have returned CO_E_NOTINITIALIZED instead of 0x%08lx\n", hr);
}
开发者ID:howard5888,项目名称:wineT,代码行数:17,代码来源:compobj.c

示例15: OleInitialize

//------------------------------------------------------------------------------
// Method: ExtendBridge
//
// Description: Constructor.
//
// Return:
//		none
//
//------------------------------------------------------------------------------
ExtendBridge::ExtendBridge() {
	// initialize the OLE
	OleInitialize(NULL);

    pExtendDisp = NULL;
    extendPath = NULL;

    //
    // Standard libraries (libraries usually required by SEI models)
    // 
    libraries.insert(StringPair(SEI_LIB, "SEI-2.lix"));
    libraries.insert(StringPair(BPR_LIB, "BPR.lix"));
    libraries.insert(StringPair(UTILITIES_LIB, "Utilities.lix"));
    libraries.insert(StringPair(DISCRETE_LIB, "Discrete Event.lix"));
    libraries.insert(StringPair(GENERIC_LIB, "Generic.lix"));
    libraries.insert(StringPair(PLOTTER_LIB, "Plotter.lix"));
}
开发者ID:Arch-E,项目名称:arche.performance,代码行数:26,代码来源:ExtendBridge.cpp


注:本文中的OleInitialize函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。