NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

ActiveX/Com element don`t appear in automation server list

Hello,
 
i need help by the registration of my activex element. I have writen an activex element with VC++ 6 and tested it with a testcontainer (VC++) on the VC++ development pc. Now i have registered successfully this activex element on the teststand development pc (i have copy the .ocx file to the windows\system32 folder and registred it with the following command: RegSvr32.exe C:\WINDOWS\system32\UfcTester.ocx).
If i want to use this activex element with the teststand action steptype (activex/com adapter), i can´t find the element in the automation server list. Smiley Sad
 
If i try to include the activex element with the browse button, i get this message:
 
 
The same message appeares if i try to launch the mscomm32.ocx.
 
thankyou
 
 
Schwede
0 Kudos
Message 1 of 7
(3,871 Views)
Hello, please attach your screenshot of the error in a seperate file. It´s not possible to see the error.
 
Regards,
Rebecca Fox
National Instruments Germany
Rebecca Fox
Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(3,849 Views)
Here it is.
0 Kudos
Message 3 of 7
(3,836 Views)

Dear Schwede,

I was able to replicate the behavior you saw with the mscomm32.ocx activeX control. I am currently looking into what could possibly cause this issue.

Best Regards,

Jonathan N.
National Instruments
0 Kudos
Message 4 of 7
(3,797 Views)
Dear Schwede,
 
The behavior we are seeing is caused by the fact that we are trying to use an activeX control as an activeX server.  That Automation Server reference in TestStand is looking for activeX servers not controls. In order to use an activeX control, you need embed the control inside an activeX container.  See the links How Does ActiveX Server Automation Differ from ActiveX Controls? and ActiveX and TestStand for additional information.   You will notice in the ActiveX and TestStand document, it states that TestStand doesn't function as an activeX container. 

Several other pieces of software have activeX containers available to use to embed activeX controls such as LabVIEW and LabWindows/CVI. Then you could call these code modules from TestStand.

Hope this helps!

Best Regards,

Jonathan N.
National Instruments
0 Kudos
Message 5 of 7
(3,789 Views)
Hello,
 
thanks for your fast response. Now I can choose an automation server, select an object class and "create new". 
I have written an automation server with ATL Wizard. In this server exists a function that reacts on WM_CREATE message.  If the WM_CREATE message is receive the function opens a message box. I tried to implement this in the teststep and start the execution, but nothing happens.
Now I explain a little deeper how I create this automation server:
  1. file > new
  2. ATL-COM Wizard
  3. Server type > dll
  4. MFC enabled
  5. new ATL object
  6. controls > full controls
  7. attribute
    1. threading model: apartment
    2. interface: dual
    3. aggregation: yes
    4. ISupportErrorInfo enabled
    5. IConnectionPointContainerImpl enabled
    6. m_bWindowOnly = TRUE;
  8. Create message WM_CREATE :
    BEGIN_MSG_MAP(Caat1)
     CHAIN_MSG_MAP(CComControl<Caat1>)
     DEFAULT_REFLECTION_HANDLER()
     MESSAGE_HANDLER(WM_CREATE, OnCreate)
    END_MSG_MAP()

    LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
     {
      MessageBox("Start");
      return 0;
     }
Can anybody send me an example code (VC++ 6) for this function, that helps me to understand how I must implement the activex server in my VC++ code.
 
thankyou
 
 
Schwede
0 Kudos
Message 6 of 7
(3,733 Views)
Hi Schwede,
 
This new question now appears to be categorized under our Measurement Studio for VC++ section. I would recommend working in that forum. Thanks
 
Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 7 of 7
(3,692 Views)