Click here to Skip to main content
11,924,280 members (53,268 online)
Rate this:
Please Sign up or sign in to vote.

I am migrating my VC++ 6.0 Application to Visual Studio 2005 for windows 7.Successfully i have migrated my application to Visual studio 2005 without any errors. But It throws an Exception Messagebox " Invalid Argument was encountered" while loading the application.Otherwise the application is working fine.The messagebox pops up everytime while opening the application.I have googled and tried out a lot of methods to identify the problem.But I can't.I got the below message in output window while debugging,

First-chance exception at 0x7589d36f in Usecpol.exe: Microsoft C++ exception: CInvalidArgException at memory location 0x0012ed50..

Is there any way to suppress the message box???
Posted 28-Oct-12 21:11pm
Richard MacCutchan 29-Oct-12 5:39am
You need to use your debugger to step through the code and find out where the assertion occurs.
EshwarTamil 29-Oct-12 6:49am
Debugger points out the below line from "C:\Program Files\Microsoft Visual Studio 8\VC\crt\src\crtexe.c"

#ifdef WPRFLAG
mainret = wWinMain(
#else /* WPRFLAG */
mainret = WinMain(
#endif /* WPRFLAG */
? StartupInfo.wShowWindow
#else /* _WINMAIN_ */
Richard MacCutchan 29-Oct-12 7:01am
It should not give errors in the system library, try a full rebuild of your project.
EshwarTamil 29-Oct-12 7:33am
Ya.. I have tried a full rebuild also.The same thing is happening..
Richard MacCutchan 29-Oct-12 7:48am
I can only guess that something in your project settings or headers is referring to an old version which is not fully compatible with the libraries on your system. However, without looking at the actual project it's impossible to guess what it may be.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151125.3 | Last Updated 29 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100