///////////////////////////////////////////////////////////////////
wCu北方站长站library mydll;
wCu北方站长站uses
wCu北方站长站 SysUtils,
wCu北方站长站 Classes;
wCu北方站长站{$R *.res}
wCu北方站长站function Out_Char(str1:PChar;str2:PChar):Pchar;stdcall;
wCu北方站长站var
wCu北方站长站 temp:PChar;
wCu北方站长站begin
wCu北方站长站 GetMem(temp,Length(str1)+Length(str2)+1);
wCu北方站长站 StrCopy(temp,str1);
wCu北方站长站 StrCat(temp,str2);
wCu北方站长站 Result := temp;
wCu北方站长站end;
wCu北方站长站Exports
wCu北方站长站 Out_Char;
wCu北方站长站begin
wCu北方站长站end.
wCu北方站长站//////////////////////////////////////////////////////////////
wCu北方站长站在C#中调用方式:
wCu北方站长站[DllImport("mydll.dll")] public static extern string Out_Char(string str1,string str2);
wCu北方站长站然后就实现了DLL 传string类型数据。
wCu北方站长站呵呵~~~~~~~
wCu北方站长站
共有 0 位网友发表了评论 此处只显示部分留言 点击查看完整评论页面