Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX & VARIANTs???

Status
Not open for further replies.

admconsult

Programmer
Feb 20, 2003
2
US
I have a program written in Borland C++ Builder v6 that I need to add an ActiveX control to. One of the ActiveX controls methods calls for VARIANT varaibles passed by reference. Here is the gist of what I have to do according to the developer of the ActiveX control.

short s1 = 1;
double d1;
VARIANT var1;
VARIANT var2;
long l1;
short ret;

ret = ActiveXControl->Method1( s1, &d1, &var1, &var2, &l1 );

The ActiveX control should return a short return code and assign the variant and long values to the variables using reference. The method is called, but nothing happens. The return code is set to 0, but it is not returned by the ActiveX control's method. The other variables are not initialized at all by the method, and according to the ActiveX developer, this cannot happen if the method is executed. He wrote the ActiveX control using Visual C++ and thinks the problem could be related to the VARIANT data type implemented by Borland C++ Builder. I've heard a few other developers have had issues with Borland VARIANT data type, but have not found any possible solutions yet. Does anyone have any ideas on what I can try?
 
Finally got a response from Borland on the issue. It is due to a bug in their Pascal implementation of the Windows VARIANT data type. Evidently, the entire VARIANT is not being pushed to the stack, so the stack is corrupted. The Borland support group did not have an idea of when or if it might be fixed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top