Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

using Visual C++ multithreading

I am using Visual C++ with the LabWindows component. I am trying to do multithreading, using MFC, speicifiaclly the AfxBeginThread. I am getting many link errors. The VC++ help says that I am mixing multithread and single thread libraries. It also says that any libraries I import thave to match. Is this a problem for the LW component?

help, help!! I have a major deadline coming up on a project that is already $9 million in the hole.

many thanks,
Lorrie Smith
0 Kudos
Message 1 of 2
(2,913 Views)
Your worker thread can be part of any class definition but remember to declare as follows:

public:

static UINT PerformShutDown(LPVOID pParam);

Sample member function that starts worker thread....

void CTestexecDlg::OnAbort()
{

/*****************************************************************************/
/* Variable Declarations */
/*****************************************************************************/

CWinThread * thread;
LPVOID pParam;
int nPriority;
UINT nStackSize;
DWORD dwCreateFlags;
LPSECURITY_ATTRIBUTES lpSecurityAttrs;


/*****************************************************************************/
/* Begin Main Function
*/
/*****************************************************************************/

//SetEngineStatus (0, 0); // Tell threads engine is shutting down

pParam = (LPVOID) this;

m_UUT1_ListBoxStatus.ResetContent();
m_UUT2_ListBoxStatus.ResetContent();
m_UUT3_ListBoxStatus.ResetContent();

m_TestUUT.ShowWindow(SW_HIDE);
m_TestUUT1.ShowWindow(SW_HIDE);
m_OnAbortUUT1.ShowWindow(SW_HIDE);
m_TestUUT2.ShowWindow(SW_HIDE);
m_OnAbortUUT2.ShowWindow(SW_HIDE);
m_TestUUT3.ShowWindow(SW_HIDE);
m_OnAbortUUT3.ShowWindow(SW_HIDE);

nPriority = THREAD_PRIORITY_NORMAL;
nStackSize = 0;
dwCreateFlags = 0;
lpSecurityAttrs = NULL;


thread = AfxBeginThread(PerformShutDown, pParam, nPriority, nStackSize, dwCreateFlags, lpSecurityAttrs);

}

Should be as simple as that......

Hope that helps.....

Steve
0 Kudos
Message 2 of 2
(2,913 Views)