HammerIp
HammerIp

Reputation: 211

Using Activation Context API in C++ component

I am a c# developer currently working on some legacy c++ com components. I am trying to add activation context api code to the com components in order to call other com components without registration.

I wrote a dummy c++ project to play with the activation context stuff and it worked no problem. However, when I added the same code into the legacy com component I can't even compile it: Error 1 error C2065: 'ACTCTX' : undeclared identifier

I didn't add any special headers to my dummy project but it worked fine so I'm not sure why this is happening. Hopefully, this will be trivial for a seasoned c++ developer ...

Upvotes: 3

Views: 424

Answers (1)

HammerIp
HammerIp

Reputation: 211

Changed this in stdafx.h:

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400

to

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501

and it worked.

Upvotes: 2

Related Questions