3

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

menjaraz
  • 7,551
  • 4
  • 41
  • 81
HammerIp
  • 211
  • 1
  • 2
  • 11

1 Answers1

2

Changed this in stdafx.h:

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400

to

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501

and it worked.

bdonlan
  • 224,562
  • 31
  • 268
  • 324
HammerIp
  • 211
  • 1
  • 2
  • 11
  • This worked for me, but I also had to change WINVER and _WIN32_WINDOWS to the same value, and then change _WIN32_IE to 0x0600. – Russell G Jun 29 '17 at 00:15