NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

ActiveX client in C++ without MFC

Hi,
I saw the MyFirstAutomationServer example that depicts how to create an ActiveX object to be called from TestStand.  What I need to know how to do is receive events ( UIMessageEvent ) from the TestStand Engine object in my Win32 C++ project that doesn't utilize MFC.  That means I don't have the EVENT mappings.  Thanks.
-G-
-G-
0 Kudos
Message 1 of 4
(4,167 Views)
The Engine (or better yet, the ApplicationManager) is an ActiveX control. So, just the same as for any other ActiveX control, you will need to place it in an ActiveX container. If you aren't using the MFC ActiveX container, another option is ATL. I know there is a lot of information on the web about ATL, but the learning curve is a bit steep.
 
There shouldn't be anything specific to TestStand about getting this to work.
0 Kudos
Message 2 of 4
(4,146 Views)

James,

I understand the engine is an ActiveX control and that it needs to be placed inside a container.  I have looked at ATL but I have been unable to figure out how to identify the TestStand Engine as the server.  Every example I've seen involves someone writing their own server so they know the entire interface and can share header files.  A generic Win32 handle was another way I'm investigating but yet again you would have to know the specific name of the event.  I was hoping someone had done this before with the TestStand engine.
Thanks.
 
-G-
0 Kudos
Message 3 of 4
(4,145 Views)

You should be able to drop ActiveX controls such as the Engine or the ApplicationMgr on the dialog resource you use with you ATL class such as CAxDialogImpl.

Right click on the dialog resource and select Insert ActiveX Control. Then select either TestStand Engine Class or TestStand UI Application Manager.

I can't tell you how to handle ActiveX events in ATL because I have never done that. However, if you need coclass or interface guids or other server specific info, you could you OLEView to look at the TestStand type libraries or inspect the *.tlh files Visual C++ generates when you #import these libraries. A fast way to find copies of the .th files is to look for *.tlh under <TestStand>\UserInterfaces\NI\Full-Featured\C++ using MFC\Debug\.  You might have to build the project first, I'm not sure if these files are installed.

0 Kudos
Message 4 of 4
(4,141 Views)