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: 
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
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.