DECLARE FUNCTION - DLL

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?
 
Z

zzzxtreme

thanks i found out the problem

delphi WideString is actually OLE-String.

I just changed to PAnsiChar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top