Re: Testing Delphi DLL crashes VB6 IDE



Rob Kennedy wrote:
I think my suggestion was to change _all_ the PWideChar types to WideString. That would include the return type of foo. Then the implementation is very simple:

Result := 'My dog''s got fleas';

Interestingly, this gave me an error (error '0' in the VB6 IDE):

function foo() : WideString;
begin
result := 'My cat''s on fire';
end;

So I went back to this, which works nicely. But are we now reverting to the "works but actually broken" situation?

function foo() : PWideChar;
begin
result := 'My cat''s on fire';
end;

If it matters, I'm using Turbo Delphi Explorer.

Kind regards,
Bruce.
begin:vcard
fn:Bruce M. Axtens
n:Axtens;Bruce
org:The Protium Project
adr:;;;;;;Australia
email;internet:bruce.axtens@xxxxxxxxx
title:Software Engineer
x-mozilla-html:FALSE
url:http://www.protiumblue.com
version:2.1
end:vcard



Relevant Pages

  • Re: Testing Delphi DLL crashes VB6 IDE
    ... Next, when the variable s goes out of scope (just before the function returns to its caller), the WideString value it holds is destroyed. ... library BOSLAD; ... function foo(): PWideChar; stdcall; ...
    (comp.lang.pascal.delphi.misc)
  • Re: Testing Delphi DLL crashes VB6 IDE
    ... What's curious at the moment is that I'm using VB6 as the testbed, and every time I run a test within the IDE, the program runs and then the IDE process suddenly disappears from memory - no error messages, nothing. ... BOSLADCode in 'BOSLADCode.pas'; ... function foo(): PWideString; stdcall; ... You've taken a WideString and told the compiler that it's really a pointer to a WideString. ...
    (comp.lang.pascal.delphi.misc)