I am working on an application that calls the COM component of an affiliate application. Our .Net, they are not. I know little about COM; I know that the component we are calling is associated with a late delay.
obj As Object = CreateObject("THIRDPARTY.ThirdPartyObject")
Then we call the method on this COM object (Option Strict Off in the head of the VB file):
obj.AMethod(ByVal Arg1 As Integer, ByVal Arg2 As Integer, ByVal Arg3 as Boolean)
I am a little surprised that although this call works, this overload does not exist in the .dll COM interaction, which is created if I instead add a link to the COM server using the Add Reference. Accessible access to this method is available only to AMethod() .
However, this in itself is not what bothers me. I am worried that this call has been working for a while , THEN throws a TargetParameterCountException after successfully completing dozens of calls.
I ask you StackOverflow:
What .. Hell.
The only thing I can guess is that the documentation for the COM component states that this method runs synchronously - so maybe everything that is responsible for throwing this exception is blocked until some indefinite point in time? In addition, I am completely obsessed with this bizarre and, more importantly, inconsistent behavior.
edit # 1:
The more meaningful information that I just recalled is that from time to time a call raises instead of an ExecutionEngineException . He only glanced at the documentation to understand that it was VERY BAD. Doing a little digging tells me that a late call causes a stack corruption, a failure of the entire CLR. Presumably this means that runtime drops bad calls (with TargetParameterCountException ) for a while and misses them ( ExecutionEngineException ) of others.
edit # 2:
Answering David Lively's questions :
- A call with null arguments that are currently contained in the code exists for a long time. I have not been able to get guidance for a third-party implementation of COM in the last two major revisions, so it is possible that they withdrew this signature from the service
- There is only one location from which this method is called from
- This is one desktop application that calls another on the same computer. Nothing unusual
- The object is saved in the entire area of user interaction with the application, so a new one is never created.
Unfortunately, it seems that there really is a mistake in the implementation, in your opinion. The problem with this seller is that when we report an error, their answer tends to follow a general form: i) deny the existence of a problem; ii) deny his problem; iii) refuse to correct it. These three steps typically cover a fairly long period of time.