Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make my CNiGraph to be SingleThread Support?

How to make my CNiGraph to be SingleThread Support? I generate the member varialbe of my CNiGraph using class wizard. In that case, I have

CNiGraph m_graph;

in a header file of a dialog.
If I just make it,

CNiGraph m_graph(CNiInterface::SingleThread);

it gives me errors.

I expect that it is beginner's FAQ in VC++.
Thank you.
0 Kudos
Message 1 of 2
(2,894 Views)
In C++, you use the class member initialization list to call a non-default constructor of a member variable of the class. The member initialization list is specified with the constructor of the class. So, what you want to do is something like the following, where CMyDlg is the class that contains m_graph.

CMyDlg::CMyDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMyDlg::IDD, pParent),
m_graph(CNiInterface::SingleThread)
{
}

David Rohacek
National Instruments
Message 2 of 2
(2,894 Views)