LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

activex control not registered

I've developed my CVI/TestStand app on one PC, but when I deploy on the target and run, I see
-------------------------------
Error in call to LoadPanelEx

UIR File Name: TestExec.uir

Error Code: -145

ActiveX control not registered on this computer.
-------------------------------
I know nothing about ActiveX, so (in very novice terms) could someone explain what I need to include/check/do to make this error disappear.
0 Kudos
Message 1 of 14
(8,665 Views)
MrBean,

ActiveX controls are containers for external programs that can be embedded into your GUI. For instance, you can embed a Windows Media Player control into your GUI that functions exactly like a normal Windows Media Player, only it is contained in your program. Other ActiveX containers include MSWord, MSExcel, and other office programs. However, ActiveX is not limited to Microsoft applications, though they are probably the most widely used ActiveX controls.

The problem you are experiencing is caused by the fact that even though you have an ActiveX container embedded in your control it still needs to reference the actual application. For instance if you are using a Word 2002 ActiveX control in your application, the target machine must also have Word 2002 on the machine. A common ActiveX problem that I have seen is when someone embeds a Windows Media Player 9.x+ control into an application and then tries to use it on a machine that has a Windows Media Player 6.x version.

In order to fix this problem, you will have to go through a 2 step process.

1.) Identify what the ActiveX control you are using in your program. You might try doing a search through the code for GetActiveXCtrlFromObjHandle and using the parameters to match the object up with an element in the .uir file. You could also try searching for NewActiveXCtrlFromFile (This may have been used if the ActiveX object was created on the fly).

2.) Load the required software for your ActiveX control onto the target machine. I.e. WMP 9.x, Word2000 etc.
0 Kudos
Message 2 of 14
(8,651 Views)
I did a search for those two functions and the only places I found them are shown below. I have a question at the bottom.

I found this in tsutil.c (C:\Program Files\National Instruments\TestStand 3.1\API\CVI)

static HRESULT CVICALLBACK TS_ExprCtrl_ChangeCallback (CAObjHandle caServerObjHandle, void *caCallbackData)
{
int error = 0;
int panel = 0;
int control = 0;
TS_ExprCtrl *exprCtrl = (TS_ExprCtrl *) caCallbackData;

errChk( GetActiveXCtrlFromObjHandle (caServerObjHandle, &panel, &control));

if((exprCtrl) && (!exprCtrl->blockActiveXCtrlChangeEvents))
TS_ExprCtrl_UILCallback (panel, control, EVENT_VAL_CHANGED, caCallbackData, 0, 0); // Do not interpret return value as error

Error:
return error;
}

And I found numerous calls to both NewActiveXCtrl and NewActiveXCtrlFromFile in tsui.c (same location as above)

HRESULT CVIFUNC TSUI_NewApplicationMgr (int panel, const char *label, int top,
int left, int *controlID, int *UILError)
{
HRESULT __result = S_OK;
int ctrlId;
GUID clsid = {0x4483B, 0x7CBC, 0x4FA1, 0xB9, 0x2C, 0x19, 0x2, 0x8A, 0x66,
0xED, 0x74};
const char * licStr = NULL;

ctrlId = NewActiveXCtrl (panel, label, top, left, &clsid,
&TSUI_IID_ApplicationMgr, licStr, &__result);

__ActiveXCtrlErrorHandler();

return __result;
}

HRESULT CVIFUNC TSUI_OpenApplicationMgr (const char *fileName, int panel,
const char *label, int top, int left,
int *controlID, int *UILError)
{
HRESULT __result = S_OK;
int ctrlId;

ctrlId = NewActiveXCtrlFromFile (panel, label, top, left, fileName,
&TSUI_IID_ApplicationMgr, &__result);

__ActiveXCtrlErrorHandler();

return __result;
}

It seems that this is saying that I need teststand installed, but I thought that by adding tscvirun_supp.c to my CVI project, and having TestExec.c in my teststand workspace when I deploy would take care of all that. Do I need something else?
0 Kudos
Message 3 of 14
(8,647 Views)
MrBean,

If your code is indeed calling a teststand ActiveX control from a LabWindows GUI then you will need to do more than include the .c file. ActiveX controls typically use a .DLL that is packaged with the server application(in this case TestStand) in order to interface between your application and the ActiveX server application. When you install the server application the necessary .DLL will be installed and registered on your computer automatically. Hence the reason you are seeing an error message that says the activeX control is not registered.

I am not very familiar with TestStand, I am a Labwindows/CVI guy, so there may be a way to make the TestStand ActiveX control work without installing the entire application (perhaps copying over the necessary .DLL(s) and using regsvr32) but I wouldn't be able to tell you what .DLLs are needed. Also, the problem when deploying applications piecemail is that you typically run into licensing issues. I.e. most applications can only be distributed as a package.
0 Kudos
Message 4 of 14
(8,635 Views)
As I indicated above, I searched for GetActiveXCtrlFromObjHandle and NewActiveXCtrlFromFile and only found them in teststand-related locations. Are there any other ActiveX routines I should search for to ensure I'm not performing some other non-teststand ActiveX operations in my app.
0 Kudos
Message 5 of 14
(8,635 Views)
Try searching for GetObjHandleFromActiveXCtrl. Also, if the ActiveX control was generated using the ActiveX Control wizard, it will have a function panel associated with it. The associated function panel should have a name thats indicative of the ActiveX Server. You can also try looking through the panels in the TestExec.uir file to see if there is a control on there that isn't a LabWindows/CVI standard control. There may also be references in your code to functions contained in the CVI ActiveX Library.
0 Kudos
Message 6 of 14
(8,627 Views)
I didn't see any use (in my app) of GetObjHandleFromActiveXCtrl. The function panels I have in my CVI project are

as32xx.fp
hpesa.fp
hpesg.fp
ksv387.fp
tsapicvi.fp
tsutil.fp

The function panels listed in the TestExec project are

easytab.fp
tsapicvi.fp
tsui.fp
tsuisupp.fp
tsutil.fp

I'm not sure if any of those are 'indicative of the ActiveX Server'. I just noticed that I have tsutil.fp in both. I don't know if that makes any difference.

What would I look for in my app to know if there may be references to functions contained in the CVI ActiveX Library.

In the TestExec.uir, I see several controls (labeled 'Application Manager', 'Sequence File View Manager', 'Execution View Manager'. I double click on any of those and it brings up an Edit ActiveX Control.

It seems pretty clear that teststand is the activex culprit, but I dont know what to do do register these activex controls.
0 Kudos
Message 7 of 14
(8,623 Views)
MrBean,

It sounds like you do not have the TestStand Engine installed on the target. DaveC is probably right on the money. The TestStand Engine is a set of DLLs that export an extensive ActiveX Automation API. Without the Engine, the ActiveX controls, that are a part of your Operator Interface, are useless, and, more to the point, broken.

The two best options for getting the TestStand Engine installed on the target machine are: (1) Use the utility provided by TestStand to Deploy your TestStand System; and (2) Install TestStand on the target machine.

If you use the Deployment utility, you can deploy your Sequence Files, Operator Interface and the TestStand Engine all in one installation package. This is the recommended method for deploying your TestStand System.

If you install TestStand on the target machine, you can use a Deployment (Run-time) License to activate TestStand. This will limit the functionality of the TestStand installation to execution/operator type actions. Using a Deployment (Run-time) License, instead of a Development License, will also save you money.

Regards,

Eric M

Message Edited by Eric M on 04-27-2005 01:28 PM

0 Kudos
Message 8 of 14
(8,612 Views)
Eric,

I am using the TestStand(3.1) Deployment utility. I created a workspace file that contains to TS project files. In one, I have all my app-related items (a few UIR files and my sequence file). The sequence file can be expanded to reveal the CodeModules folder and the App's DLL file. The CVI prj file that was used to build this DLL contains the file tscvirun_supp.c.

The other TS project contains the TestExe.exe/ico/uir files. I also, out of desperation, created a TestExec.dll to see if that would make any difference.

Then, in the Distributed Files tab of the Deployment, I placed check marks next to the TestExec.exe/.uir/.dll files, and in the Installer Properties I selected the Installation Directory as the Installation Destination and I clicked on "Register As ActiveX Server" for each of those files.

Do you see anything I'm missing.
Do I need to do anything with the LabWIndows/CVI Create ActiveX Server/Controller Wizards?
0 Kudos
Message 9 of 14
(8,602 Views)
MrBean,

To deploy the Simple or Full-Featured Operator Interface, OI, with your Test System:

1. Have a workspace with just the first project you mentioned, the one with your TS Project files. Don’t try to include the OI in a second project.

2. Use the Deployment Utility as you were except don’t worry about ActiveX.

3. On the Installer Options tab, select to Include the TestStand Engine and press the Engine Options button.

4. In the TestStand Engine Options dialog, place a check mark next to either the Full-Featured or Simple LabWindows/CVI OI and press OK.

Now, the OI will be deployed with your Test System.

I highly recommend reviewing Chapter 14 of the TestStand Reference Manual which covers Deploying TestStand Systems. The last section is especially useful. It covers Common Deployment Scenarios. The Reference Manual can be opened from Help>>Search the TestStand Bookshelf. Click on the link to the TestStand Reference Manual.

Note: If you are attempting to deploy a custom OI, please let me know.

Regards,

Eric M
0 Kudos
Message 10 of 14
(8,575 Views)