Click here to Skip to main content
16,015,755 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: I/O completion port Pin
NormDroid24-May-02 23:38
professionalNormDroid24-May-02 23:38 
GeneralRe: I/O completion port Pin
Mike Nordell26-May-02 16:41
Mike Nordell26-May-02 16:41 
GeneralRe: I/O completion port Pin
Gerald Schwab26-May-02 16:44
Gerald Schwab26-May-02 16:44 
GeneralAssertion Failure Pin
laphijia24-May-02 22:15
laphijia24-May-02 22:15 
GeneralRe: Assertion Failure Pin
PJ Arends24-May-02 22:38
professionalPJ Arends24-May-02 22:38 
GeneralRe: Assertion Failure Pin
laphijia24-May-02 22:46
laphijia24-May-02 22:46 
GeneralRe: Assertion Failure Pin
PJ Arends24-May-02 23:24
professionalPJ Arends24-May-02 23:24 
GeneralRe: Assertion Failure Pin
24-May-02 23:58
suss24-May-02 23:58 
PJ Arends wrote:
If they are both active, why are you declaring a new instance of CMyForm in your OnBnClickedButton1() handler? You should instead get a pointer to the existing CMyForm.

You should learn how to use the debugger. When you get an assertion failure, you should be able to doubleclick on the message line in the output window, and visual studio will open the correct file at the line that caused the assertion. The line will read "ASSERT (SomethingOrOther)". Using that clue, you will be able to figure out which variable has an invalid value, and by using the call stack, you can trace backwards in the program until you get to your own code.


Thank you very much for helping me.

I changed the code to:

CMyForm* prova;
prova = new CMyForm;
prova->str = "ciao";
AfxMessageBox(prova->str);
delete prova;

This works!

CMyForm* prova;
prova = new CMyForm;
prova->m_edit.SetWindowText("ciao");
delete prova;

This still doesn't work.


I learnt what you said so:

void CWnd::SetWindowText(LPCTSTR lpszString)
{
ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));

if (m_pCtrlSite == NULL)
::SetWindowText(m_hWnd, lpszString);
else
m_pCtrlSite->SetWindowText(lpszString);
}

WHAT THIS MEANS?
GeneralRe: Assertion Failure Pin
Nish Nishant25-May-02 0:12
sitebuilderNish Nishant25-May-02 0:12 
GeneralRe: Assertion Failure Pin
PJ Arends25-May-02 7:30
professionalPJ Arends25-May-02 7:30 
GeneralProblem to use StrRetToBuf function Pin
24-May-02 22:19
suss24-May-02 22:19 
GeneralWindow, transparent for mouse clicks Pin
Alex Cramer24-May-02 21:34
Alex Cramer24-May-02 21:34 
GeneralRe: Window, transparent for mouse clicks Pin
Renjith Ramachandran25-May-02 4:04
Renjith Ramachandran25-May-02 4:04 
GeneralPuzzled when converting CInternetFile* to FILE* Pin
George Ma24-May-02 19:37
George Ma24-May-02 19:37 
GeneralRe: Puzzled when converting CInternetFile* to FILE* Pin
Nish Nishant24-May-02 19:55
sitebuilderNish Nishant24-May-02 19:55 
GeneralRe: Puzzled when converting CInternetFile* to FILE* Pin
Erik Funkenbusch25-May-02 3:29
Erik Funkenbusch25-May-02 3:29 
GeneralRe: Puzzled when converting CInternetFile* to FILE* Pin
George Ma25-May-02 17:07
George Ma25-May-02 17:07 
GeneralCFontDialog and LOGFONT :: MFC Pin
valikac24-May-02 17:52
valikac24-May-02 17:52 
GeneralRe: CFontDialog and LOGFONT :: MFC Pin
Jason Henderson24-May-02 18:46
Jason Henderson24-May-02 18:46 
GeneralRe: CFontDialog and LOGFONT :: MFC Pin
valikac25-May-02 5:58
valikac25-May-02 5:58 
Generalavi software Pin
pnpfriend24-May-02 13:52
pnpfriend24-May-02 13:52 
GeneralRe: avi software Pin
Rama Krishna Vavilala24-May-02 16:26
Rama Krishna Vavilala24-May-02 16:26 
GeneralRe: avi software Pin
Nish Nishant24-May-02 17:43
sitebuilderNish Nishant24-May-02 17:43 
GeneralRe: avi software Pin
pnpfriend25-May-02 2:52
pnpfriend25-May-02 2:52 
GeneralRe: avi software Pin
Maxwell Chen25-May-02 9:03
Maxwell Chen25-May-02 9:03 

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.