Class A
{
Public:
Void Init (char * STR, int a);
Friend UINT _stdcall Begin (void * p);
Char m_str [260].
};
A, ga.
Button:
Ga. The Init (SSSS, 5);
Sleep (1000);
_beginthreadex (0, 0, the Begin, (LPVOID) & amp; The gA, 0, 0);
The thread function
UINT _stdcall Begin (void * p)
{
A * pa=(A *) p;
Char s1 [260];
Strcpy (s1, pa - & gt; M_str); This is how to obtain ""? No string?
return 0;
}
CodePudding user response:
Void A: : Init (char * STR, int A){
Strcpy (m_str, STR);
}
CodePudding user response:
# include & lt; Process. H>
Class A
{
Public:
Void Init (char * STR, int a)
{
Strcpy (m_str, STR);
}
Friend UINT _stdcall Begin (void * p);
Char m_str [260].
};
A, ga.
UINT _stdcall Begin (void * p)
{
A * pa=(A *) p;
Char s1 [260];
Strcpy (s1, pa - & gt; M_str);
AfxMessageBox (s1);
//
return 0;
}
Void CAboutDlg: : OnButton1 ()
{
//TODO: Add your the control notification handler code here
Ga. The Init (SSSS, 5);
//Sleep (1000);
_beginthreadex (0, 0, the Begin, (LPVOID) & amp; The ga, 0, 0);
}
CodePudding user response:
Void Init (char * STR, int a) what's the use of the five?CodePudding user response:
Transfer data. If no problem program. The CPU, memory card. Thread has a writing data, get the string data to.CodePudding user response:
Take a look at your real void Init (char * STR, int a)CodePudding user response:
Find out why... Wild didn't p=NULL pointer to releaseCodePudding user response:
Out of memory... One afternoon and eveningCodePudding user response:
The