Exceptions in COM objects with X# 2.6
Posted: Wed Sep 23, 2020 5:42 am
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?
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?