I use the real-time graphics Active X Control (WIN-AXC-200) in my software. Sometimes, this software crashes and this message appears : "Error building a graph - access violation at 1e03bae". It seems that the problem occurs during the first refresh of the Active X meter (with the function "UpdateDynData"). My software runs on a computer with Windows NT4.0
What can I modify in my progran, in order to solve this problem ?
In any supsequent postings please specify what Active control you are using. The WIN-AXC-200 software includes many controls. Also specify the compiler and programming language that you are using.
Odds on you have the UpdateDynData called in a timer event that is independent of the creation of the control. The UpdateDynData is probably being called before or while the control is being instantiated. The UpdateDynData method cannot be called until the control is visible on the screen for the first time. If you start everything when the program starts, the timer event is probably being called before the operating system manages to place the ActiveX control in the display window.
The RT controls have an event named DrawReady. This event is called when it us OK to update the control, either using UpdateDynData, or UpdateGraph. You should be able to add this event to your program, and set a flag that indicates that it OK to update the control using UpdateDynData. Our examples usually enable the upate timers at the end of the FormLoad event, after the control properties have been initialized. Using the DrawReady event to enable the timers is a better technique.