problem with loading dll programmed by Delphi7



I made a dll file,Delphi.dll, with Delphi7, the sourcecode is:

library Delphi;
uses
SysUtils,
Classes;
{$R *.res}
function GetStr(s:ShortString ):ShortString ;stdcall;
begin
result:= s;
end;
exports
GetStr;
begin
end.



In the VB.NET2005 I declared the function as 'Declare Auto Function GetStr
Lib "Delphi.dll" (ByVal s As String) As String', but I would run into the
exception of not being able to load the function because could not find the
entry point of the function (translated from the error message in Chinese).
But I tested the dll within Delphi application, it worked well there.

Are there any special rules to program dll for VS.NET with Delphi or any
other languages?

Best regards,

Jack Zhong


.



Relevant Pages

  • Re: Using function with PChar data type
    ... the author of DLL just ... short STRING into a HUGE string. ... those string type into C like pointer strings. ... I tried to figure out why I could not get basic delphi pascal DLL to ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Using function with PChar data type
    ... DELPHI DLL I was using was just copying to a null terminated string ... But I was leery with the initializing and not allocating space for it. ... I was able to finally get the Delphi DLL to import and marshall correctly. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Trying to use DLL (written in C++) in Delphi application
    ... if you want to call functions of a C++ DLL from a Delphi ... program you must declare the Dll functions as extern "C". ... I have no idea how to declare the DLL file or how to ...
    (borland.public.delphi.ide)
  • Re: Problem with DllImport
    ... your trouble can be caused by Delphi's string types. ... Depending on which Delphi version was used to build the DLL, ... and object is freed twice upon shutdown, or used after it has been freed. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How do I add a record to an MS Acess DB using Delphi and ADO? Newbie
    ... sSql, sCnStr: string; ... > Delphi and ADO within a DLL I wrote in Delphi 7. ... > Right now the DLL is working and I can pass a string to it and it pops ...
    (alt.comp.lang.borland-delphi)