draganp has asked for the wisdom of the Perl Monks concerning the following question:

I am using some .NET assembly with OLE method. Method in .NET looks like this:
public int IdentifyUserByCert(string certB64, ref string userTaxId, re +f string corpTaxId)
Calling it from C# looks like this
DefaultCertUserIdentification identi = new DefaultCertUserIdentificati +on(new Configuration()); string userTaxNum = ""; string corpTaxNum = ""; identi.IdentifyUserByCert(TestData.ACNLB_FO2, ref userTaxNum, ref corp +TaxNum);
After this call in variable userTaxNum, and corpTaxNum there are some return values. In Perl I am using same assembly via OLE like this.
my $identi = Win32::OLE->new('DefaultCertUserIdentification'); my $identified = $identi->IdentifyUserByCert($certificate, \$userTaxId +, \$corpTaxId);
Return valu is OK. It works as expected. I was expecting to get values in $userTaxId, and $corpTaxId, but I do not.

Replies are listed 'Best First'.
Re: OLE ref parameters
by draganp (Novice) on Dec 23, 2005 at 15:20 UTC
    I found solution myself. It is: use Win32::OLE::Variant; The part of the code now looks like this:
    $userTaxId_var= Variant(VT_VARIANT|VT_BYREF, $userTaxId); $corpTaxId_var= Variant(VT_VARIANT|VT_BYREF, $corpTaxId); my $identified = $identi->IdentifyUserByCert($certificate, $user +TaxId_var, $corpTaxId_var);