Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

I need to get the data out of OnAcquiredDataCwcounter1 and print it out on text-control-fieldl

My problem is to read the data Measurement and Overflow from a OnAcquiredDataCwcounter. I want to read them and write it in a text field. Hope you can help me, I'm making my diplom and I really need your help.
Thank you
0 Kudos
Message 1 of 3
(3,361 Views)
The "Measurement" argument of the OnAcquiredDataCWCounter event handler is a pointer to a VARIANT. To access the contents of a VARIANT and place it in a Microsoft Edit Box you can do something similar to the following inside of the event handler:

void CDAQSTCBufferedDlg::OnAcquiredDataCwcounter1(VARIANT FAR* Measurement, BOOL Overflow)
{
CString mstr;
mstr.Format ("%lf", Measurement->dblVal);
m_edit.SetWindowText (mstr);
}

I have attached a simple project that illustrates basically the same concept. It has a CWSlide control and an MS Edit Box on the dialog. When the CWSlide's pointer changes position, I update the Edit Box with the new value of the pointer's position. (Make sure to rebuild the entire project to execute it).

To unders
tand more about the CString MFC class and the VARIANT structure go to http://msdn.microsoft.com

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 3
(3,361 Views)
good comment, thanks a lot
0 Kudos
Message 3 of 3
(3,361 Views)