Click here to Skip to main content
15,914,795 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralNeed help in putting this function Pin
percyvimal12-Dec-03 19:33
percyvimal12-Dec-03 19:33 
GeneralRe: Need help in putting this function Pin
l a u r e n12-Dec-03 20:20
l a u r e n12-Dec-03 20:20 
GeneralAgent Control Pin
nileshp412-Dec-03 18:54
nileshp412-Dec-03 18:54 
GeneralRe: Agent Control Pin
Ravi Bhavnani12-Dec-03 20:50
professionalRavi Bhavnani12-Dec-03 20:50 
GeneralSeting image to CListCtrl..... Pin
YanBin12-Dec-03 16:27
YanBin12-Dec-03 16:27 
GeneralParsing the command line Pin
Ernesto D.12-Dec-03 14:52
Ernesto D.12-Dec-03 14:52 
GeneralRe: Parsing the command line Pin
Michael Dunn12-Dec-03 19:03
sitebuilderMichael Dunn12-Dec-03 19:03 
GeneralRe: Parsing the command line Pin
Ernesto D.13-Dec-03 10:13
Ernesto D.13-Dec-03 10:13 
hi, thanks for your reply.
when i ran that code in debug mode on my XP machine, it just caused a "first chance exception" shown in the output window of vc, (i dint even noticed it the first time) later i compiled the release version and it worked OK on windows XP, but when i tried it on NT4 server, then the exception became a "memory cant be read" error message, and the program crashed.
heres the code in "do stuff":

// checkout the command line for passed arguments
int nargs=0;
LPWSTR* cmdargs=CommandLineToArgvW(GetCommandLine(), &nargs);
LPWSTR argument=NULL;
for(int i=1; i<nargs; i++)
{
argument=cmdargs[i];
switch(i)
{
case 1: // 1st arg is times to do the test
{
int tests=_wtoi(argument);
tests=tests>=0? tests : 0;
if(!tests)
{
if(wcscmp(argument, L"0")!=0) // atoi failed or really zero?
days=DEFAULT_TEST_TIMES; // invalid argument!
}
mttimes=tests;
break;
}
case 2: // 2nd is "F" or "f" for File, (writte a log file)
if(wcsicmp(argument, L"F")==0)
dolog=TRUE;

break;
default:
break;
}
}

// release the memory
if(cmdargs)
GlobalFree((HGLOBAL)cmdargs);

the first chance exception occurs in the GlobalFree() line, if i remove it, then it runs fine on both XP and NT4 and both release and debug versions.
General.cpp .dsp .dsw Pin
Leoanrd Fear12-Dec-03 14:23
sussLeoanrd Fear12-Dec-03 14:23 
GeneralRe: .cpp .dsp .dsw Pin
Michael Dunn12-Dec-03 14:51
sitebuilderMichael Dunn12-Dec-03 14:51 
QuestionWhy doesn't this work? Pin
Snyp12-Dec-03 13:45
Snyp12-Dec-03 13:45 
AnswerRe: Why doesn't this work? Pin
valikac13-Dec-03 5:31
valikac13-Dec-03 5:31 
GeneralSendMessage Problem Pin
impeham12-Dec-03 13:45
impeham12-Dec-03 13:45 
GeneralRe: SendMessage Problem Pin
Ernesto D.12-Dec-03 15:28
Ernesto D.12-Dec-03 15:28 
GeneralRe: SendMessage Problem Pin
impeham12-Dec-03 22:03
impeham12-Dec-03 22:03 
GeneralProblem reading field in .ini file Pin
IrishSonic12-Dec-03 13:29
IrishSonic12-Dec-03 13:29 
GeneralRe: Problem reading field in .ini file Pin
Roger Stewart12-Dec-03 15:23
professionalRoger Stewart12-Dec-03 15:23 
Generalencrypted data and strings Pin
(Steven Hicks)n+112-Dec-03 12:56
(Steven Hicks)n+112-Dec-03 12:56 
GeneralRe: encrypted data and strings Pin
l a u r e n12-Dec-03 20:23
l a u r e n12-Dec-03 20:23 
GeneralRe: encrypted data and strings Pin
(Steven Hicks)n+113-Dec-03 7:55
(Steven Hicks)n+113-Dec-03 7:55 
GeneralRe: encrypted data and strings Pin
l a u r e n13-Dec-03 7:58
l a u r e n13-Dec-03 7:58 
GeneralRe: encrypted data and strings Pin
(Steven Hicks)n+113-Dec-03 8:14
(Steven Hicks)n+113-Dec-03 8:14 
GeneralRe: encrypted data and strings Pin
l a u r e n13-Dec-03 8:17
l a u r e n13-Dec-03 8:17 
GeneralRe: encrypted data and strings Pin
(Steven Hicks)n+113-Dec-03 8:26
(Steven Hicks)n+113-Dec-03 8:26 
GeneralXML with MFC Pin
K. Gulden12-Dec-03 12:19
K. Gulden12-Dec-03 12:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.