Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Add num edit control to existing MFC DLL

Hi,


I'm using Visual C++ 6.0 and Visual Studio 6.0 SP3, with Measurement Studio 6.0.0 (eval version).


I have a C++ DLL which is using shared MFC.  It holds various dialogs that my app needs.  Onto the waveform dialog, I want to add NI graph (not 3D graph) and num edit controls.


I looked at the tutorial for "Manually Adding Components to My MFC-Based Project" but it seems that the additional steps don't apply to either of the controls I'm adding.


Currently my waveform dialog contains only VS controls, and it works as expected both in the Visual Studio debugger and outside of it.


So in the Visual Studio resource editor, I right-click, select "Insert ActiveX Control", and select the "CWNumEdit Control (National Instruments)", and the path shown is "C:\\Windows\system32\cwui.ocx".  I change its style so it looks like the classic control, and change its name.  My project builds and links with no additional header files or libs added to the project.*


Now I run my app in the Visual Studio Debugger.  But when I call the code to create an instance of my dialog, it returns a 0 instead of a handle (indicating that it failed to create the object).  (I can't step into the call to create the dialog.)  But when I call GetLastError() it returns a 0, indicating no error!


*I believe I at some point had some old Measurement Studio stuff loaded, which apparently had come along with other National Instruments installs that I had done. Is that possibly confusing my compile/link?


What am I missing? Thanks in advance for any help ...

 

0 Kudos
Message 1 of 4
(6,381 Views)

Hi B.Anderson,

 

You may be missing some components to your project. Here's a thorough KnowledgeBase article that discusses this:

 

Adding Measurement Studio Controls to an MFC Project in Microsoft Visual C++

 

If going through that doesn't help. Could you post a section of your code that is causing the problem and also show what libraries you have included?

 

Take care!

Tanya Visser
National Instruments
LabVIEW Group Manager
0 Kudos
Message 2 of 4
(6,363 Views)

Hi,

 

Thanks for your suggestion.  I had looked at that article, and didn't understand very well what it was suggsting that I do.  Looking at it again, I see some things I can try.

 

But in the meantime, I programatically created a NI panel with all the NI controls that I want.  We may go back to trying to use the hybrid dialog, or we may simply continue with the NI panel.  If we do go back to the hybrid, it won't be for a couple of months.

0 Kudos
Message 3 of 4
(6,344 Views)

To whomever sent me a private message from this discussion, I'm not deliberately ignoring you.  When I look at the help to find out how to read a private message, it looks like it's talking about a completely different message board!  So I can't read your message.

 

If it's relevant to this discussion, please repost it here.  Thanks.

0 Kudos
Message 4 of 4
(6,343 Views)