bsp. von meiner LIB
*.dll
Delphi-Quellcode:
function BASSVIS_GetVersion: PAnsiChar; stdcall;
const
cverfor = '%d.%d.%d.%d';
var
ver : TBASSVIS_VERSION;
str : string;
begin
ver := GetVersionNumber;
str := format(cverfor,[ver.Major,ver.Minor,ver.Special,ver.Build]);
result := PAnsiChar(Ansistring(str));
end;
managed
dll C#
Code:
//BASSVIS_GetVersion
public static string BASSVIS_GetVersion()
{
IntPtr ptr = BASSVIS_GetVersionPtr();
if (ptr != IntPtr.Zero)
{
return Marshal.PtrToStringAnsi(ptr);
}
return null;
}
[DllImport("bass_vis.dll", EntryPoint = "BASSVIS_GetVersion", CharSet = CharSet.Auto)]
private static extern IntPtr BASSVIS_GetVersionPtr();
Aber er scheint ja seine Lösung gefunden zu haben.
gruss