Using the activation context API in a C ++ component

I am a C # developer who is currently working on some deprecated C ++ com components. I am trying to add activation context api code to com components in order to call other comcom components without registering.

I wrote a dummy C ++ project to play with activation context materials, and that didn't work. However, when I added the same code to the com component, I cannot even compile it: Error 1 error C2065: "ACTCTX": undeclared identifier

I did not add any special headers to my dummy project, but it worked fine, so I'm not sure why this is happening. Hope this will be trivial for an experienced C ++ developer ...

+3
source share
1 answer

Changed this in stdafx.h:

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400

to

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501

and he worked.

+2
source

All Articles