I have a COM Interface which has function signature as mentioned below:
Guid GetGuid2()
It is implemented in a class:
public Guid GetGuid2()
{
return Guid.NewGuid();
}
Then this function needs to be used by Perl.
my $dotNetLib = 'MyCOMDLL';
my $server = Win32::OLE->new($dotNetLib) || die "Unable to launch server\n";
my $guid = $server->GetGuid2();
But I am getting this error:
Win32::OLE(0.1601) error 0x80020005: "Type mismatch" at Playground.pl
Is it possible for us to return GUID Object in COM Layer?
when you need to return a GUID from COM via .NET you need to convert it to a Byte[] or a String and then rebuild it to a guid on the other side or perform string comparision, as a GUID isn't a COM Compatible type.
User contributions licensed under CC BY-SA 3.0