Delphi DLL in C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tino
    New Member
    • Apr 2006
    • 1

    Delphi DLL in C#

    Hi all,
    I have a problem with loading the Delphi 7 dll in to my C# project! The dll delphi structure is as follows:

    ShortString myfunction(shor tstring par1, shortstring par2, shortstring par1);

    I read somwhere that C# represenatation of ShortString is byte array so I did the following:

    [DllImport("xxyy yykg.dll", EntryPoint = "NewLic", CallingConventi on = CallingConventi on.StdCall, ExactSpelling =
    true, CharSet = CharSet.Ansi)]

    public static extern byte [] NewLic(byte[] par1, byte[] par2, byte[] par3);

    byte [] output= NewLic(par1, par2, par3);


    but I get thye following error message:

    Cannot marshal 'return value': Invalid managed/unmanaged type combination.

    Thanks in advance,
  • shaunom
    New Member
    • May 2007
    • 1

    #2
    Hi,
    Did you ever sort this - I have an IDENTICAL problem and it has me totally foxed.
    Thanks,
    S

    Comment

    Working...