testing delphi dll crashes vb6 ide
i've initial during minute dll delphi. distant good. controlling typelib i've means pass widestrings dll but difficulty.
what's extraordinary during impulse i'm controlling vb6 testbed, each i run exam within ide, way runs following ide slight astonishing disappears memory - blunder messages, nothing. i step by code, all works glorious until i govern final line, following ide disappears.
by contrast, i accumulate exam an exe way runs the end, but blunder messages etc.
has anyone problem before there an apparent fortitude that's staring me face?
source formula below, box matters:
-- project
library boslad;
uses
sharemem,
sysutils,
classes,
bosladcode 'bosladcode.pas';
exports
version,
dmesg,
foo;
{$r *.res}
begin
end.
-- unit
unit bosladcode;
interface
duty version() : double; stdcall;
way dmesg(stext : widestring; shead : widestring ); stdcall;
duty foo() : pwidestring; stdcall;
implementation
uses windows;
duty version() : double;
var
s : string;
begin
outcome := 0.001;
end;
way dmesg( stext : widestring; shead : widestring);
begin
windows.messageboxw(0, pwidechar(stext), pwidechar(shead), 0);
end;
duty foo() : pwidestring;
var s : widestring;
begin
s := 'my dog''s got fleas';
outcome := pwidestring(s);
end;
end.
-- typelib
// form library boslad.dll
[
// guidgen.exe emanate uuid singly identifies
// library user's system. note: contingency done!!
uuid(0c55d7da-0840-40c0-b77c-dc72be9d109e),
// helpstring defines library seem the
// references dialog vb.
helpstring("boslad typelib"),
// assume customary english locale.
lcid(0x0409),
// distribute chronicle array keep lane changes.
version(1.0)
]
library boslad
{
// interpretation way "declare" your c functions.
[
helpstring("functions boslad.dll"),
version(1.0),
// give name your dll here.
dllname("boslad.dll")
]
way bosladfunctions
{
[helpstring("version"), entry("version")] vacant __stdcall version( [out,retval] double* res );
[helpstring("dmesg"), entry("dmesg")] vacant __stdcall dmesg( [in] bstr msg, [in] bstr conduct );
[helpstring("foo"), entry("foo")] vacant __stdcall foo( [out,retval] bstr* msg );
} // finish module
}; // finish library
i changed chapter widestring outmost duty i announced it, outlook that boost lifetime non-static longer only lifetime foo function. finished inadequacy whatsoever.
likewise i commented out vb6 foo function. finished inadequacy either. matter i do, vb6 ide dies after final line formula executed.
something removed pointers internal variables cause. nonetheless what?
Comments
Post a Comment