DECLARE FUNCTION - DLL

  • Thread starter Thread starter zzzxtreme
  • Start date Start date
Z

zzzxtreme

hi i built a very simple dll with delphi

library Printing;
uses
SysUtils, Classes, Dialogs;
{$R *.res}
function Hello: WideString; stdcall;
begin
ShowMessage('test');
result := 'blah';
end;
exports Hello;
begin end.



In VB.Net, i tired calling it. the ShowMessage executes, so that's a
start. I get this error afterwards, SEHException - "External component
has thrown an exception."

this is how i declared it

Declare Function Hello Lib "Printing.dll" () As String

It fails on returning a string. Does anyone know why?
 
thanks i found out the problem

delphi WideString is actually OLE-String.

I just changed to PAnsiChar
 
Back
Top