Use ActiveX dll in console C++ application

The ActiveX  contains one automation class MyRegistry, so I am using the wizard to import this
Class to regular Mfc application , and then just copy this .cpp and .h to console application.

The .h file is looking like this:

class IMyRegistry : public COleDispatchDriver
{
public:
      IMyRegistry() {}            // Calls COleDispatchDriver default constructor
      IMyRegistry(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
      IMyRegistry(const IMyRegistry& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}

// Attributes
public:

// Operations
public:

};

The .c file is looking like this:

CString IMyRegistry::GetTranslationDirName()
{
      CString result;
      InvokeHelper(0x1, DISPATCH_METHOD, VT_BSTR, (void*)&result, NULL);
      return result;
}

The problem is  in the link:

uafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
uafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex

What is the solution for this link error?

Is it possible to use ActiveX control in console application ?

RitafAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jhanceCommented:
You are  linking with the DEBUG single-threaded library instead of the DEBUG multi-threaded one.

Go to the Project Settings, and the C/C++ tab.  Choose Category Code Generation and select  "Debug Multi-threaded" in the "User run time library" setting.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Hardware

From novice to tech pro — start learning today.