Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Cursor Visibility on 2D Graph causes exception in C++ app.

I have created an MFC application in MS Visual C++ 6 which uses the 2D Graph active X control which is included with ComponentWorks V1.0.

The application plots GPS data from a file onto 3 different graphs and allows you to add, move and delete points as well as the zoom and pan functions that are enabled in the graph control. For each line of the graph there is the following data:
Time
Eastings
northings
Height
Position Standard Deviation
X Velocity
Y Velocity
Z Velocity

One of the graphs holds either position data, position standard deviation or XYZ velocities. When you click on a graph point the cursors on the other graphs will jump to the which ever point has the same time stamp as the one clicked so you can see position Vs velocities etc. For some plots I need one cursor for others 3 cursors etc so I use the SetVisible(true/false); to hide and display cursors as and when I need them.

I have fully tested my application on my development PC in release mode but when I distribute the application to another PC it crashes.

The offending code is simply trying to set the visibility of a Graph Cursor. If I have only one Cursor I can switch the visibility of that cursor on and off but if I add a second cursor and try to set the visibility to on/Visible the application crashes.

So if I have all cursors set to invisible by default:

graphHandle.GetCursors().Item(1).SetVisible(true); //This works fine

graphHandle.GetCursors().Item(2).SetVisible(true); //This fails Only on another PC but works on development PC


Has anyone any ideas?
I have registered the .OCX file which contains the graph and distributed all the right files to the target PC.
0 Kudos
Message 1 of 3
(3,843 Views)
Hi,

I'm new to measurement studio and MFC.
I wrote a little application but i don't know how to create an installation package
in order to install the application on another PC.
Could you explain me that please ?

Thanx in advance,
David.
0 Kudos
Message 2 of 3
(3,699 Views)
Hi,
 
In answer to David's question about building executables, please have a look at the link below:
 
 
If you copy OCX files across to your deployment system manually, you will need to register them manually on the deployment system, using regsvr or regsvr32, details can be found here:
 
 
 
There are some quick start notes on the Microsoft Developers Network about using the Visual Studio Installer which you can find here:
 
 
 
Regarding the first question about cursors on the 2D graphs, can you please post your code and executable so we can have a look at the problem, and suggest any solutions?
 
Best wishes,
 
Mark
Applications Engineer
National Instruments
0 Kudos
Message 3 of 3
(3,683 Views)