Re: DECLARE FUNCTION - DLL

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



thanks i found out the problem

delphi WideString is actually OLE-String.

I just changed to PAnsiChar


On Jan 5, 1:01 am, "Juan T. Llibre" <nomailrepl...@xxxxxxxxxxx> wrote:
Are you using Delphi 8 (Delphi.Net) ?

If not, you'll only get unmanaged assemblies,
which you'd need to create a wrapper for,
or use the Source Forge version to enable Delphi 5+ for .Net usage:

http://sourceforge.net/projects/delphinet

More info on Delphi 8.0 Basics:http://www.delphibasics.co.uk/Net.html

Juan T. Llibre, asp.net MVP
asp.net faq :http://asp.net.do/faq/
foros de asp.net, en español :http://asp.net.do/foros/
======================================

<zzzxtr...@xxxxxxxxx> wrote in messagenews:35d8e10e-3bb6-4d36-a379-21562d0745d4@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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?

.



Relevant Pages

  • Re: Hunspell and richedit?
    ... I had already found your implmentation and also the "official" Delphi ... wrapper on the sourceforge site. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Compressing audio using GSM or other codec (winxp)
    ... Can't find anything related to that API. ... messing with that low level stuff. ... I use a set of components for Delphi. ... library that I use is a wrapper for the windows acm (audio conversion ...
    (microsoft.public.dotnet.languages.csharp)
  • =?iso-8859-1?Q?Re:_ZIP-Komponente_=28unicode-f=E4hig=29?=
    ... Nein, am besten was Natives, geschrieben in Delphi oder ein guter ... Wrapper um eine der neueren Info-Zip DLLs. ... Arno Garrels ...
    (de.comp.lang.delphi.misc)
  • Re: Turbo Delphi Explorer and Import Component
    ... Since components can be used from code, I'd see if someone else can generate the ActiveX wrapper for you. ... I've provided type library wrappers to other users who had a licensed copy of Delphi and a licensed copy of the specified ActiveX control. ...
    (borland.public.delphi.non-technical)
  • Re: Importing ADOX library - How?
    ... the database structure rather than the actual data. ... There is no wrapper for the functionality shipped with Delphi, but one can of course just follow the brilliant guides on-line, like these ones: ... Only they assume older version of Delphi. ... HTH ...
    (borland.public.delphi.database.ado)