LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My program (ActiveX server) crashes if ActiveX client accesses it

I have a LabVIEW v8.5 application that is built as an ActiveX server. If this program is directly started (double-click the .exe), then when it is exited there is no error. If this program is started in response to an Automation Open from another LabVIEW v8.5 application (ActiveX client), then when the server is exited the following error appears:

The memory could not be read.JPG 

This error appears whether the client has an opportunity to close the Automation refnum or not before the server is shutdown (the server can be shutdown either by the client or by the direct intervention of the user). What can be causing this (pointer) error ?

 

0 Kudos
Message 1 of 7
(3,262 Views)

lgk,

 

Hello! A few questions for you.

 

1.) Once you do the Automation Open call from the client, do you try to access anything within the server from the client? 

2.) Does this error happen when the ActiveX server exe is started via the client's Automation Open Call? or sometime later in the code?

3.) Do you error handling in your code?

4.) Can you simplify your code down to the bare amount that causes this issue?

5.) Can you post a screenshot of the section of your code that does the Automation Open?

 

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ben Sisney
FlexRIO V&V Engineer
National Instruments
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0 Kudos
Message 2 of 7
(3,240 Views)

Post the code or an image for us to look at please.

 

Battler.

0 Kudos
Message 3 of 7
(3,230 Views)

Ben: Thank you for your response.

 

Following your questions:

 

1.) After the Automation Open the client gets (in a timed polling loop) and sets the values of many controls in the server, using a Virtual Instruments Invoke Node (GetControlValue and SetControlValue). This all appears to be working fine; the client is an alternate user interface that controls the server program and it works.

 

2.) The error message relates to the server and occurs when the server terminates (the program disappears and then the message pops up). I suppose that the error could happen at any time after the Automation Open and is only reported on program termination, but that's a guess on my part.

 

3.) No explicit error handling in the server. In the client I do chain together the error outputs and inputs of the Automation calls. I have observed no error from a probe at the end of the chain (the Close Reference VI).

 

4.) As a last resort, there's a number of other things that I must get out of the way before I can devote the time necessary for this exercise.

 

5.) Sure, I have posted a screenshot of the Automation Open, see attached.

 

 

0 Kudos
Message 4 of 7
(3,218 Views)

lgk,

 

Thanks for answering so quickly!

 

Are you using the close reference function to close your references? If not, I would suggest doing so. I looked at your code and I didn't see this included.

 

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ben Sisney
FlexRIO V&V Engineer
National Instruments
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0 Kudos
Message 5 of 7
(3,194 Views)

Ben:

 

Yes, I am using a close reference on the application refnum.

 

Today, I added a close reference on the VI refnum, also.

Closing the VI refnum in addition to closing the application refnum did not change the behavior, I'm still getting the error message after the server terminates.

0 Kudos
Message 6 of 7
(3,108 Views)

lgk,

 

Could you post your code such that we could look at it and possibly determine the issue?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ben Sisney
FlexRIO V&V Engineer
National Instruments
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0 Kudos
Message 7 of 7
(3,087 Views)