Hi ,
Just for the benefit of any expert C# folks that might not know Delphi,
Huseyin seems to want to invoke a managed delegate as a callback from an
unmanaged Delphi 6 dll. Offhand I would say that he can't do this but maybe
someone knows better than me. Delphi 6 is a pre .NET tool and has no
knowledge per se of managed code. Another option might be to simply stuff
the objects to be enumerated into some kind of structure (on the Delphi
side) and simply return the lot in one hit.
Cheers
Doug Forster
"Huseyin Altun" <al***********@hotmail.com> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
I have DLL written in Delphi 6. Its prototype is below:
function EnumUserGroups(Proc: TEnumUserGroupProc; APtr: Pointer):
LongInt; stdCall;
I have declared it in c# like below: (VS 2003)
[DllImport(POSDLL)]
public static extern int EnumUserGroups(UserGroupCallBack callBack,
object obj);
when I call it from c# like:
POSSRV.EnumUserGroups(new UserGroupCallBack(Form1.GetUserGroup),
null);
in delphi side the parameter APtr is not nil.
What is the correct definition of the function in c# side?
thanks.
Huseyin Altun