.NET consumer of ActiveX throwing TargetParameterCountException

Posted by DevSolo on Stack Overflow See other posts from Stack Overflow or by DevSolo
Published on 2010-05-07T13:57:56Z Indexed on 2010/05/07 14:18 UTC
Read the original article Hit count: 274

Filed under:
|
|
|
|

I have a .NET (3.5 w/ Dev Studio 2008) app that hosts a visual Active X (written in C++ w/ Dev Studio 2003). Have access to all sources, but can't easily move the Active X control up to 2008.

This as worked fine in the past. Made some changes to the Active X control and now, when calling one method on the Active X, I'm getting a TargetParameterCountException 100% of the time. The signature of the Active X method is:

LONG CMyActive::License(LPCTSTR string1, LPCTSTR string2, LONG long1, LPCTSTR string3, LPCTSTR string4);

When viewing the method in object browser of reflector, .NET sees it as:

public virtual int License(string string1, string string2, int long1, string string3, string string4)

I renamed the parameters for demonstration purpose (boss gets twitchy about any code). I left the method name, as it could be relevant.

There are method calls prior that work. I just can't seen to figure out why I'm all of a sudden getting this exception. The HRESULT is 0x8002000e and a quick search seems to indicate that's a general one.

Thanks to all for reading.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET