LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview dll wrapper worker function call

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

0 Kudos
Message 1 of 2
(2,505 Views)

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

Message Edited by rolfk on 05-19-2009 07:58 AM
Rolf Kalbermatter
My Blog
Message 2 of 2
(2,490 Views)