DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Using ScriptStart in VC++ doesn't seems to be working.

Hello Tom,

 

Try launching DIAdem first before running your VC++ code that calls DIAdem's ToCommand ActiveX server.  By default in DIAdem 9.1, if DIAdem is already launched prior to an ActiveX call, the existing (already launched) instance of DIAdem will be used to process the ActiveX call.  This way you can avoid the time required to launch and exit DIAdem each time you try to run your code.  It may also make debugging easier.

 

Brad Turpin
DIAdem Product Support Engineer
National Instruemnts

0 Kudos
Message 11 of 26
(3,023 Views)

Matthias:

 

I am not able to get a message box to pop-up. 

 

I made the code changes that you recommended.  I had to add a return value, 0, to the return statement.

 

I also executed with displays supressed, and then tried with commented out display supression.

 

I tried with Diedem running prior to launching and without launching.

 

I tried the code exactly as you have written, and also tried with your code and the original error handling.  For some reason, when I use the original error handling code with your code I do not get the error message in my log file.

 

I also noticed that a process, dllhost.exe starts when I run the program.  I'm actually running this from a web service stub that launches the cpp program.

 

Please let me know if there's something else I can try.

 

Thanks!

 

Tom

0 Kudos
Message 12 of 26
(3,018 Views)

Hello Tom!

 

Can you please explain in detail how the program is called. Please try to start the exe standalone.

 

FYI: A web service or the hosting web server might run as windows service. In general they are running in a different acount than the the users acount. Some restrictions are the result (e.g. you can't see message boxes).

 

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 13 of 26
(3,014 Views)

Matthias:

 

I was not able to write a VBS to execute the DDL.  I have another co-worker that is working on this.

 

I also logged into the Windows server as the same ID that is executing the the COM+ and launching the program.  I was still not able to see the message box.

 

I will be on vacation next week but two of my peers, Sudhakar and Palanivel, might chime in to this thread.  Would you please provide them with the same level of assistance that you have provided to me?

 

I really appriciate your help and the time you've spent on this issue.

 

Thanks!!

 

Tom

0 Kudos
Message 14 of 26
(2,994 Views)

Hello Tom!

 

I really like to help you or your colleages but unfortunatly I will be on vacation for the next 2 weeks. I expect that during this time other qualified forum readers will help you.

 

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 15 of 26
(2,991 Views)

The return error is 1008 - An attempt was made to reference a token that does not exist. The Diadem tocommand appears in the registry, but I'm not sure why the call is not working. Can someone please help??

 

Tom

0 Kudos
Message 16 of 26
(2,916 Views)

Hello Tom!

 

This looks like a user rights problem but I'm not sure. Can you please specify your complete environment e.g. OS, DIAdem version, COM+ (?), DIAdem caller type (service?),...

 

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 17 of 26
(2,874 Views)

Hi Tom,

 

Let's see if we can divide this problem in two and discover on which side the error is occurring.  I am attaching below a VBScript (stored in a ZIP file) which you can run by double-clicking on it in Windows Explorer.  This will run the VBScript in the standard VBScript host the operating system installs, and this VBScript will contact DIAdem via ActiveX and display the current DIAdem version in a VBScript MsgBox.

 

Please let me know if this VBScript runs on your computer.  If it throws an error, please post a screenshot of the error dialog.  If Matthias is correct in guessing that you do not have permission to contact DIAdem's ActiveX server, then this VBScript will also throw an error.  If you do have permission, then this VBScript should succeed.

 

Brad Turpin
DIAdem Product Support Engineer
National Iinstruments

0 Kudos
Message 18 of 26
(2,860 Views)

Hi Brad:

 

Here's the output from the message box:

MainVersion = 9

Revision = 910

BetaRevision = 2345

TotalVersion = 9.10.2345

 

We are running to toCommand from a COM+ DLL process which is execute from a .NET web service published through IIS. 

 

Tom

 

0 Kudos
Message 19 of 26
(2,858 Views)

Hi Tom,

 

What we can conclude from this result is that your DIAdem 9.1 ActiveX server is alive and well, and you have permission to access it.  This is a nice positive result that you ought to be able to build on.  I understand that you eventually want to call DIAdem through a .NET web service that invokes a DLL function, but my recommendation is to start smaller than that and work you way towards it.  Start by rewriting the 8 line VBScript you just ran successfully in whichever compiler you want to use to build your COM+ DLL and run that code straight out of the compiler environment.  It should work, because the ActiveX commands are the same-- the only thing you're changing is the language calling the ActiveX commands.  If it doesn't work, then we know the problem is with the language you want to use inside the COM+ DLL.  If this does work, now build that simple 8 line program into the COM+ DLL and call it from C++ or VB, again straight out of your compiler of choice.  If this doesn't work, then either the COM+ DLL was built incorrectly and it is being loaded or invoked incorrectly by the calling program.  If this also works, then try adding the .NET web service to call this COM+ DLL with the 8 lines of code.  If you can get all the way through this chain of steps, then you know that the architecture you're using is not the problem, and that you have all the permissions you need.  If this all works, then the problem is simply in the details of the commands you have previously incorporated in the COM+ DLL.  In that case, I recommend debugging the contents of the COM+ DLL in your compiler environment as a standalone C++ or VB program until you can verify that all methods run without error.

 

Hope this helps,

Brad Turpin
DIAdem Product Support Engineer
Naitonal Instruments

0 Kudos
Message 20 of 26
(2,844 Views)