.NET ActiveX client throwing TargetParameterCountException

I have a .NET application (3.5 w / Dev Studio 2008) that hosts a visual Active X (written in C ++ w / Dev Studio 2003). Have access to all sources, but cannot easily move the ActiveX control until 2008.

This has worked so well in the past. Made some changes to the Active X control and now when you call one method in Active X I get TargetParameterCountException 100% of the time. Active X method signature:

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

      

When viewing the method in the Reflector Object Browser, .NET sees it as:

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

      

I renamed the parameters for demo purpose (the boss gets twitchy about any code). I've left the method name as it might be relevant.

There are method calls before this work. I just can't figure out why I am suddenly getting this exception. HRESULT is 0x8002000e and a quick search reveals which is general.

Thanks everyone for reading.

Edit

Thanks for the pointers. There is some comfort in knowing that others are perplexed. What's odd is that it worked. This behavior occurred after Active X was restored. No interface or other IDL changes. And this is on multiple machines, not limited to just one dev block or that.

Edit 2

For S&G, I added a new method,

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

      

Restored everything and now I can call the new method ... It smells like a bug in the compiler and / or COM.NET compatibility layer.

+2


a source to share


1 answer


HRESULT DISP_E_BADPARAMCOUNT

(better for googling than "0x8002000e").

Looks like other people ran into this problem:



http://www.codeguru.com/forum/showthread.php?t=96353

http://forums.devx.com/showthread.php?t=85215

+1


a source







All Articles