CoInitializeEx


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: CoInitializeEx

  1. #1
    JD Guest

    CoInitializeEx


    I have created a multithreaded COM object with ATL 3.0. Calling it from an
    ASP page seems to work fine. I initialize COM by using CoIntializeEx(NULL,
    COINIT_MULTITHREADED) in a console application.

    However, if I call it in a console application I get the following error:
    CoInitializeEx is an undeclared identifier.

    I am assuming a console application can be multi-threaded. Am I wrong in
    this? Is there anything I need to do in the pre-compile to use CoInitializeEx?

    Thanks,

    JD
    Share on Google+

  2. #2
    Christian Nagel Guest

    Re: CoInitializeEx

    Hello JD,

    if you have a look into <objbase.h> you will see the following preprocessor:
    #if (_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM) // DCOM
    WINOLEAPI CoInitializeEx(LPVOID pvReserved, DWORD dwCoInit);
    #endif // DCOM

    You have to define WIN32_DCOM or WIN32_WINNT

    Kind regards,
    Christian
    http://www.globalknowledge.at


    JD <dahljn@interaccess.com> wrote in message
    news:38d258ef$1@news.devx.com...
    >
    > I have created a multithreaded COM object with ATL 3.0. Calling it from an
    > ASP page seems to work fine. I initialize COM by using CoIntializeEx(NULL,
    > COINIT_MULTITHREADED) in a console application.
    >
    > However, if I call it in a console application I get the following error:
    > CoInitializeEx is an undeclared identifier.
    >
    > I am assuming a console application can be multi-threaded. Am I wrong in
    > this? Is there anything I need to do in the pre-compile to use

    CoInitializeEx?
    >
    > Thanks,
    >
    > JD



    Share on Google+

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center