NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

activeX error 18351

I am trying to import tlb/exe files that I am making in VS2008 in C++ on Windows 7.

 

I am modifiying a dialog COM app exe which used to run fine on XP/Old TestStand.  I am trying to call exposed COM on a legacy dialog app I have to add more calls to.  This used to work on XP/TestStand4.  It is registered but not visible on teh Automation Server list.

 

So I have created a few of COM example apps of different types to see if its windows7 or teststand or what.  I have made a dll as well.  None can be made into a selectable Automation Server for TestStand 2010.  Even registered they are not in the dropdown list.  Browsing just produces the ActiveX Error Code: -18351.  I have added no code to them, as VS2008 creates the base source for the new COM/OCX/Midi projects.  None will work with TestStand 2010 after being registered  (xxx.exe /regserver).

 

 

I did see where ...\Public\Documents\National Instruments\TestStand 2010\Examples\Demo\DotNet\dotNet Project Files has a computer.dll, and that does load fine with C++ dll option.

 

Anyone know why created apps will not load and are not visible on the list?

 

TIA

www.certtech.com
0 Kudos
Message 1 of 6
(3,754 Views)

Have you tried rebooting after registering the components?

0 Kudos
Message 2 of 6
(3,748 Views)

Yeah it doesn't fix it.   I was hoping it would.

 

I created some more VC++ dlls and they work fine.  Its something with TestStand, Win7, and VS2008 on ActiveX/OCX.

 

I suspect I am going to have to create a virtual XP environment on my PC to make this exe/COM thing work again.

 

I will probably have to wait and move it back to XP/TestStand 4.1 to get this functional.  Its another reason for Microsoft to drive a stake thru the heart of VC++.  Its just not enough working right with radio button groups anymore.

www.certtech.com
0 Kudos
Message 3 of 6
(3,736 Views)

I suspect the problem you are having is that you are not running with admin privileges when you register your COM servers. On Windows 7 you have to register COM servers with admin privileges or they won't really get registered.

 

Try the following:

When you launch visual studio to build your COM servers, right-click on the visual studio shortcut and select "Run as Administrator", respond to the UAC prompt to allow visual studio to run as admin. Then clean and rebuild your COM server project. Rebuilding it with administrator privileges should now register it correctly so it shows up in TestStand. Basically you probably want to be running visual studio as admin whenever you build your COM server projects. There is an alternative to this called per-user registration, but I think just running visual studio as admin is a simpler, more straightforward approach.

 

Hope this helps,

-Doug

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

Hey Doug thanks.

 

I also had to run cmd as admin privilidges also and hand register the tlb.  Then use regtlibv12.exe to hand register the tlb.  Even though I launched VS2008 as admin this time and did a clean/rebuild it was not enough.

 

Using cmd as admin....

 

C:\...\yourproj\Debug>C:\windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12.exe yourproj.tlb
Registration of yourproj.tlb successful.

 

Yesterday it was saying it was registered but it wasn't becuase I was not running it in admin.  Thanks for the help..it was close enough.  Never trust VS to register the apps for oxc/tlb stuff right as it always says it was.  .NET classes work fine as-is.

 

Windows is such a pain with this lack of automatic admin settings!!!

www.certtech.com
0 Kudos
Message 5 of 6
(3,719 Views)

If you go into User Accounts and drag the UAC slider all the way down ("Never notify"), I'll believe that'll get you back to XP-style Administrator mode. Either that, or I've tweaked some other security policy I've forgotten, but the command prompt always starts in Administrator mode for me. Just be sure you're mindful of what you're letting execute 😉

 

0 Kudos
Message 6 of 6
(3,717 Views)