Click here to Skip to main content
15,885,032 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Database operation in VC++ Pin
maharaja pandian7-Jun-06 18:35
maharaja pandian7-Jun-06 18:35 
QuestionRe: Database operation in VC++ Pin
David Crow8-Jun-06 2:53
David Crow8-Jun-06 2:53 
QuestionMDI: New document using wizard (Where are you Microsoft people) Pin
Tarek Jabri7-Jun-06 4:46
Tarek Jabri7-Jun-06 4:46 
AnswerRe: MDI: New document using wizard (Where are you Microsoft people) Pin
FarPointer7-Jun-06 5:36
FarPointer7-Jun-06 5:36 
GeneralRe: MDI: New document using wizard (Where are you Microsoft people) Pin
Tarek Jabri7-Jun-06 6:19
Tarek Jabri7-Jun-06 6:19 
GeneralRe: MDI: New document using wizard (Where are you Microsoft people) Pin
FarPointer7-Jun-06 6:43
FarPointer7-Jun-06 6:43 
QuestionHow to display graph in chart using Excel Pin
MikeRT7-Jun-06 4:46
MikeRT7-Jun-06 4:46 
QuestionI get a Windows error when I remove an else statement... Pin
Lord Kixdemp7-Jun-06 4:23
Lord Kixdemp7-Jun-06 4:23 
Hello everyone!
Look at this code:

for (x = strlen(fileName) - 1; x > 0; x--)<br />
    {<br />
        // 01234567890123<br />
        // screenshot.png<br />
        <br />
        /* If a period was found */<br />
        if (fileName[x] == '.')<br />
        {<br />
            /* Set it to the name without the extension */<br />
            newName = malloc(x-1);<br />
            strcat(newName, fileName);<br />
            return newName;<br />
        }<br />
        else<br />
            printf("%c", fileName[x]);<br />
    }


That code, seems like it'll work if I modify other parts a little bit, but that else statement is not needed anymore... But if I remove it, compile, and run the program, I get a Windows error:

Title: mythax.exe - Application Error<br />
<br />
The instruction at "0x7c93426d" referenced memory at "0x00000000".  The memory could not be "read".<br />
<br />
Click on OK to terminate the program<br />
Click on CANCEL to debug the program


Is this a bug in the compiler or something? I'm using MinGW 3.4.2... Thanks!

Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
AnswerRe: I get a Windows error when I remove an else statement... Pin
Cedric Moonen7-Jun-06 4:34
Cedric Moonen7-Jun-06 4:34 
AnswerRe: I get a Windows error when I remove an else statement... Pin
Viorel.7-Jun-06 4:42
Viorel.7-Jun-06 4:42 
AnswerRe: I get a Windows error when I remove an else statement... Pin
Sarath C7-Jun-06 4:45
Sarath C7-Jun-06 4:45 
QuestionRe: I get a Windows error when I remove an else statement... Pin
David Crow7-Jun-06 4:45
David Crow7-Jun-06 4:45 
AnswerRe: I get a Windows error when I remove an else statement... Pin
Lord Kixdemp7-Jun-06 18:04
Lord Kixdemp7-Jun-06 18:04 
GeneralRe: I get a Windows error when I remove an else statement... Pin
David Crow8-Jun-06 2:42
David Crow8-Jun-06 2:42 
GeneralRe: I get a Windows error when I remove an else statement... Pin
Lord Kixdemp8-Jun-06 3:11
Lord Kixdemp8-Jun-06 3:11 
GeneralRe: I get a Windows error when I remove an else statement... Pin
David Crow8-Jun-06 3:20
David Crow8-Jun-06 3:20 
QuestionSocket programming error MFC Pin
Aqueel7-Jun-06 4:14
Aqueel7-Jun-06 4:14 
QuestionRe: Socket programming error MFC Pin
David Crow7-Jun-06 4:20
David Crow7-Jun-06 4:20 
AnswerRe: Socket programming error MFC [modified] Pin
Aqueel7-Jun-06 4:32
Aqueel7-Jun-06 4:32 
QuestionRe: Socket programming error MFC [modified] Pin
David Crow7-Jun-06 4:42
David Crow7-Jun-06 4:42 
GeneralRe: Socket programming error MFC [modified] Pin
Viorel.7-Jun-06 4:55
Viorel.7-Jun-06 4:55 
GeneralRe: Socket programming error MFC [modified] Pin
Aqueel7-Jun-06 5:10
Aqueel7-Jun-06 5:10 
GeneralRe: Socket programming error MFC [modified] Pin
Viorel.7-Jun-06 5:21
Viorel.7-Jun-06 5:21 
AnswerRe: Socket programming error MFC Pin
Sarath C7-Jun-06 4:38
Sarath C7-Jun-06 4:38 
Questionneed to write a panel(a custom control) to load and unload controls? Pin
old_dustman7-Jun-06 4:11
old_dustman7-Jun-06 4:11 

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.