Exceptions in COM objects with X# 2.6

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
ArneOrtlinghaus
Posts: 412
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Exceptions in COM objects with X# 2.6

Post by ArneOrtlinghaus »

We have problems with COM objects together with the new version.
The code attached gives an exception when calling oOutlook:finit:
System.Runtime.InteropServices.COMException HResult=0x80020006 Message=Unbekannter Name. (Ausnahme von HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME
Robert has already found out, that strong typing helps. Unfortunately we have quite a lot of code untyped, also objects created by COM objects, that are not used as local variables. Also we have some special solutions with COM objects stored in macros.
I assume that the reason is, that access variables are called in another way then "Getters" in C# are called and therefore the compiler has to know the code.
Are there any other possibilities resolving this without strong typing, maybe by substituting some of the code attached?
Attachments
testoutlook.txt
(709 Bytes) Downloaded 63 times
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Exceptions in COM objects with X# 2.6

Post by robert »

Arne,
I am looking into this.
The problem only seems to happen when you access the properties of the OleAutoObject itself (fInit, dwFuncs, dwVars). Properties of the com object should work fine.
I'll try to release an updated assembly today.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
ArneOrtlinghaus
Posts: 412
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Exceptions in COM objects with X# 2.6

Post by ArneOrtlinghaus »

Thank you very much.
It is not so urgent, only I wanted to have an answer into which direction I should go.
I tried ivarget(oOutlook, #fInit), but it generates the same error, so it isn't easy to make a workaround without strong typing.
Post Reply