Ben, Thank you for your answer. I'm not new to Component works (used it for a couple of years now), and I've seen that document years ago (it is almost 4 years old.) I'm way past the basics that are covered in that document.
I won't repeat all the details here, but please go back and re-read the original posting. I have a large complex application that works well and is rock solid when running under Windows 98. However, when run under Windows NT, it is unstable and will crash within 30 seconds of use. The really wierd part is that it is also rock solid when run in the debugger under Windows NT, a fact which makes it really difficult to figure out just where and why it's crashing.
The interesting thing is that when I comment out my two calls to PlotXY, the application is once again rock solid.
When it crashes, it always appears to be doing something with Variants (like making an assignment) and not in the PlotXY call. This makes me think that there is some interaction or corruption occuring in PlotXY, which causes a crash sometime later when accessing a Variant variable. But why only under NT, but not in the debugger? I'm so confused...
I'm also confused why the sample code I just downloaded a couple of days ago dosen't compile, code which says it is written specifically for the Borland C++ Builder compiler. Am I doing something wrong, or could I have a problem with my configuration?
The gist of the compilation problems is that the Borland-generated wrapper class methods use TVariant parameters. The KB article you reference, and the sample code (as well as my own code) use Variant (note that difference from TVariant). Variant has the required methods (such as PutElement and GetElement) that are lacking in TVariant, or I would be tempted to just use TVariants everywhere. The problem is when I try to use a Variant variable for those TVariant arguments, I get compilation errors complaining about abiguities (see original posting.) So I am resorting to type conversions, thereby working around these errors, (successfully I thought, based on past experience) but now with these NT problems I'm wondering if I'm doing something wrong.
I still don't understand how the sample code can be compiled, given these problems. Is there something wrong with my compiler setup? If so, it's been wrong through three versions of Borland and numerous updates, and with six different development computers running various OS's.
My application is large and complex, and is therefore a poor example to illustrate this issue. However, the sample code I had referred to is a good example. It doesn't compile (at least not for me) even though it does everthing mentioned in the KB article. When I edit it so it does compile, it shows the same problems I am having: solid under '98, flaky under 'NT, but solid under 'NT and the debugger.
Can you, or somebody else, compile that sample code under C++ Builder, and successfully run it under Windows NT? Once running, click on either or both of the plot buttons. In my case, after anwhere from 10 to 30 clicks later it will start to be flakey, and then crash.
If anybody can get it to compile, and it's stable, please let me know how you did it. If you had to edit the code, let me see what you did.
Please forgive the extended rambling. I'm getting desperate here.
-- Adam