.
   .  
   .
//
// Initalize the COM Threading Model
//
   ::CoInitializeEx(NULL,COINIT_APARTMENTTHREADED);// Error   m_ctrlEditStatus.SetWindowText( _T("Not Initialized yet ..."));
   .
   .
   .
Build:
error C2039: 'CoInitializeEx' : is not a member of '`global namespace''

解决方案 »

  1.   

    并且这个出错信息的global namespace前面不是单引号,呵呵,奇怪,大家帮忙!
      

  2.   

    declare pre-process macro WIN32_DCOM
      

  3.   

    _WIN32_DCOM 楼上英雄笔误了.
      

  4.   

    楼上的兄弟们,我是这样定义的,但
    程序编译又出现了错误!
    nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
    nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
    libcd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
    Debug/CallControl.exe : fatal error LNK1120: 3 unresolved externals这个好象是没有main函数,我是基于对话框程序!,这个错误怎么处理呀!
      

  5.   

    在stdafx.h中定义#ifndef _WIN32_DCOM
    #define _WIN32_DCOM
    #endif
      

  6.   

    楼上兄弟,出现下面的错误,请你指点!
    LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
    libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
    Debug/CallControl.exe : fatal error LNK1120: 1 unresolved externals
      

  7.   

    在#include的下一行加上
    #pragma comment( lib , "ole32.lib" )
      

  8.   

    Why do I get a "LNK2001: unresolved external symbol _main" error or "LNK2001: unresolved external symbol _WinMain" when I try to build my application?  This usually happens when you create the wrong type of project for you application. In the first case, you chose "Win32 Application" when you should have selected "Win32 Console Application". On the second case, well, it's the other way. There are two ways to fix it: (1) Create a new project of the correct type, and readd all your files too it, or (2) change the type of the current project. This can be easily accomplished. Select Project -> Settings from the menu, and go to the Link tab. There, in the edit control at the bottom, look for the /subsystem switch and change it to "/subsystem:console" or "/subsystem:windows" as appropriate.希望对你有用
      

  9.   

    谢谢 zoid兄弟,不知道你在那里看到的这个文档,给我一分,我已经成功编译了,同时也谢谢各位的帮助,希望zoid能给我这个文档![email protected]