Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 808
  • Last Modified:

Stubborn Error in MFC VC++6: Assert afxWin1.inl Line 19 in Release mode

I downloaded a third party code called Real Time Plot, it compiles in Debug but gives Assert afxWin1.inl Line 19 in Release mode. I tried initializing MFC and I used AFX_MANAGE_STATE(AfxGetStaticModuleState)) and other tricks but the Assert keeps coming back.

If you download the software from:
http://www.codeguru.com/Cpp/misc/misc/article.php/c373/ 
then you will find that two other users had the same problem before me but no one offered a remedy.

Now I am open to any constructive suggestions.

Thanks guys.

Faisal Kadri
0
flkadri
Asked:
flkadri
1 Solution
 
flkadriAuthor Commented:
I found a remedy for my question:

Instead of adding the "plot" project as done in the demo code, create a new class, call it "plot" or anything you like.
Copy and paste the contents of the header and cpp files. Copy and add MCMem header and cpp files to your project and include your newly created class into your dialog or view class, whichever you are using, and proceed as before. This will compile and run without Asserts in Debug and in Release version.
Obviously, the handle to "this" in the Create syntax does not pass to a separate project in Release version only, I don't know if this is an MFC quirk or programming error but I was kind of hoping that somebody can suggest a way to re-define the handle. Anyway, my remedy works and this is good enough for me!
Good luck.

Faisal
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now