05-18-2009 12:27 PM
This code is part of a wrapper DLL. I'm wondering the following would be legal ? This way, instead of creating a new instance of the class etc, then I can call this function from LabView as a DLL call....
__declspec(dllexport) void __cdecl StartReader(LPVOID pParam)
{
CWinThread *pReaderThread;
Collecting = TRUE;
pReaderThread = AfxBeginThread (ReadThread, pParam, THREAD_PRIORITY_HIGHEST,
0, 0, NULL );
}
...the following piece of code is for reference only
static UINT ReadThread( LPVOID pParam )
{
while(Collecting)
{
Words = m_pBrickInput->ReadDecom(READBUF_SIZE_WORDS, inbuf, &bOverflow);
}
free(inbuf);
AfxEndThread(0);
return ( S_OK );
}
DOK
05-19-2009 12:58 AM - edited 05-19-2009 12:58 AM
DeOdderKeith wrote:This code is part of a wrapper DLL. I'm wondering the following would be legal ? This way, instead of creating a new instance of the class etc, then I can call this function from LabView as a DLL call....
__declspec(dllexport) void __cdecl StartReader(LPVOID pParam)
{
CWinThread *pReaderThread;Collecting = TRUE;
pReaderThread = AfxBeginThread (ReadThread, pParam, THREAD_PRIORITY_HIGHEST,
0, 0, NULL );
}
...the following piece of code is for reference only
static UINT ReadThread( LPVOID pParam )
{
while(Collecting)
{
Words = m_pBrickInput->ReadDecom(READBUF_SIZE_WORDS, inbuf, &bOverflow);
}free(inbuf);
AfxEndThread(0);
return ( S_OK );
}DOK
I do not understand what you try to do nor what you try to ask here. Maybe it's because of my lacking c++ knowledge but I do get somehow the idea that you do ask about something without describing the problem you have or mean to have.
The code snippets as they are presented make certainly no sense in conjunction and the first function makes not much sense either as the pReaderThread is simply lost after the function returns.
Rolf Kalbermatter