Highlighted
Honored Contributor.
Honored Contributor.
1282 views

same Method with different signature

Jump to solution

Chris,

I was thinking that, within the same class, you could have multiple methods with the same name (ID), provided that each occurrence of the same-named method had a different and unique signature.  However, it appears from the attached demo that this is not true (?)... or. more likely, I have done something wrong.  See the attached demo which is an extension of your CCW Tutorial.  To test, go to the caller program and comment out the invoke of ManagedMethod2 and uncomment the invoke of ManagedMethod that is using custRecord and aNumber.  Also go to the called program and in Class1 change the method ID on the 2nd method from ManagedMethod2 to ManagedMethod.  Then debug.  You should get a parameter count mismatch error.  Not that when you put everything back the way it originally was, you don't get an error... it works (it's just not with using overloaded methods).  Maybe overloads don't work when you are doing OLE calling?

Thanks,

Austin

 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: same Method with different signature

Jump to solution

Hi Austin,

This is a limitation when exposing .NET methods to COM and not of managed .NET methods in general.

Please see the article from Microsoft here:

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: same Method with different signature

Jump to solution

Hi Austin,

This is a limitation when exposing .NET methods to COM and not of managed .NET methods in general.

Please see the article from Microsoft here:

View solution in original post

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

RE: same Method with different signature

Jump to solution

I reviewed the MS doc you linked to in your reply.

Thanks, Chris!

Austin

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.