05-03-2010 03:23 AM
Since Measurement Studio for C++ is not supporting Unicode i tried to use the .net elements in my existing MFC code.
This is working fine with windows controls, so i tried with National Instruments Led but software is crashing in
OnInitDialog. I tried with Visual Studio 2008 with Measurement Studio 8.6. Does anyone knowns how to
solve the problem.
#pragma once
Solved! Go to Solution.
05-07-2010 01:59 AM
Hi Andreas,
If you create a new VC++ project with this LED control it works fine.
Can you try this on your side too?
Otherwise please attach your test project so I can check it here.
05-20-2010 02:26 AM
Thank you for your advice.
I still cannot make it running.
I send you a sample project.
01-12-2011 12:33 PM
Hello Andreas,
Hopefully a late response is better than no response at all... I've taken a look at your code, and I've found a workaround that I hope will be suitable for you. The issue you've reported has been documented as a bug with ID 247775. In order to work around the issue, you can host the Measurement Studio .NET controls in a UserControl. Once you've done this, you should be able to display the controls on your MFC dialog with the CreateManagedControl API.
The main key to hosting the Measurement Studio controls in a user control is to create an assembly with one user control for each Measurement Studio control. Drop the Measurement Studio control on the user control, and then configure the Anchor property to be Top, Left, and the Dock propert to be Fill. Then modify the accessibility of the control to be public in the designer.cs file.
I've recreated the .NET example "PlotWaveforms" in Visual Studio 2008 MFC and attached it below. I've also attached my C# UserControl project for creating the hosted Measurement Studio .NET controls. Please take a look and let me know if you have any questions.
NickB
National Instruments
01-13-2011 10:20 AM
Dear NickB,
Your solution comes just in time. We just stated a new project and we have still no solution.
I made some tests and it seems to work. We are very happy to have this solution!
Thanks for you great work. We really appreciate your help on that problem.
Andreas6