Problem with C++/CLI + ATL Combo

Exactly… Wanted to use ATL (for CComPtr class and some other things) in my C++/CLI project (VS2008 with or without SP1) and… got nice assert on _CrtIsValidHeapPointer(pUserData) in dbgheap.c. Cool! Exactly that was missing to make my day better!

Some investigation, and I had answer to my problem. Actually two answers. Both pretty simple:

  1. As I had /NOENTRY specified in the No Entry Point item in the Linker/Advanced section of the project settings, I could add __DllMainCRTStartup@12 to the Force Symbol References item in the Linker/Input section of the project settings
  2. Alternatively, I could set No Entry Point item in the Linker/Advanced section of the project settings to No (as I said, I had /NOENTRY there)

I have tried both solutions, and both worked; I settled on the latter as more intuitive and clean. Always live, always learn…

Advertisements

2 thoughts on “Problem with C++/CLI + ATL Combo

  1. Hello Roman ¡¡¡ .. that was incredible… I was looking for this answer for a long while.. .I was going bananas.. ejejjeje… thanks so much..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s