Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ...

like image 786
HammerIp Avatar asked Nov 18 '25 23:11

HammerIp


1 Answers

Changed this in stdafx.h:

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400

to

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501

and it worked.

like image 124
HammerIp Avatar answered Nov 21 '25 11:11

HammerIp