« FileMaker Stammtisch … | Home | One month until FileM… »

ActiveX Control crashing trouble today


I have a client who wants to talk to some huge accounting software using COM objects in Windows from Xojo. He has been looking into using Xojo for his work for years, but we already tried it several times and had lots of crashes. Some functions simply crash when called. I looked into helping him several times the last two years, but well, didn't see a real reason for those crashes.

Yesterday he called again and asked if I could help. He has a PutValue method for filling data which constantly crashes. GetValue works by the way.

This time I had an idea. To analyze the functions, I created a dummy Visual C project and used #import line. The build the project and Visual Studio creates the C++ includes for this type library. In C++ the function looks like this:

HRESULT PutValue (BSTR FieldName, VARIANT Value, VARIANT * RetVal );

As you see the function takes one string, a variant and a byref variant for the result. Now Xojo creates this delegate:

Delegate Function PutValue_Func3(this As Ptr, FieldName_Param As Ptr, Value_Param As Ptr, RetVal_Param As Ptr) As Integer

And there is the mistake. The variant needs to be passed by Value, not by Reference. This causes crashes as stack contains not enough data 4 bytes for the pointer instead of 16 bytes of the variant structure.

more in feedback case 34221.

I also found case 7195, so this problem could be there for over 5 years. So I now hope that Xojo engineers can find and fix this bug, so my client can enjoy using Xojo to write the apps instead of Delphi.
27 06 14 - 14:25
two comments

you wrote “Xojo creates this delegate”

Is there some function by which Xojo creates Delegates? I’ve not seen that before…
Steve Upton (URL) - 01 07 14 - 00:49

When you add ActiveX control on Windows, Xojo automatically creates modules and classes for this Active X control. Included there are auto generated delegates for each available method.
Christian Schmitz (URL) - 01 07 14 - 10:14


  
Remember personal info?

Emoticons / Textile


Notify:
Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.