VC6.0 compilation problem

zhaozj2021-02-11  212

VC6.0 compilation problem

Q: I have a program that I have designed. When I set it to Debug in the compile entry, the program runs everything is normal, but the program is a problem when the Release is. How will this?

Answer: 1) Why do you create both a thread and a class member as a thread? Does anyone call your destructive function? You can't try to use members in the document window as thread, like this:

CCAPI :: SomeFunction ()

{

Afxbeginthread (static_cast)

ThreadProc (this)))

}

CCAPI :: ThreadProc (LPVOID PTR)

{

// ptr and this are equal ...

CCAPI * PTRAPI = (CCAPI *) PTR;

}

If you do this, you may need to do some changes.

2) Obviously, m_powner or m_powner-> m_hwnd is incorrect, try the following:

IF (NULL == CAPI)

:: MessageBox (Null, "Bad Capi", "Capithread", MB_OK;

Else IF (null == CAPI-> M_POWNER)

:: MessageBox (Null, "Bad Owner", "Capithread", MB_OK;

Else if (! :: iswindow (capi-> m_powner-> m_hwnd))

:: MessageBox (NULL, "Bad Hwnd", "Capithread", MB_OK;