Before some flange basket says this has nothing to do with DBPRO. Please read what i have to say
I have this code in delphi 7. It builds ok:
library testdll;
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, XPMan, ExtCtrls, StdCtrls, ImgList,
AppEvnts, Menus;
//^ thats just the name of the project dont need to mess with that :)
{$R *.res}
{
this dll uses, no uses! e.g. sysutils,windows. so you can see the small size it is.
2 functions "norstr" and "retstr".
basically "norstr" just send the message back to whatever has called it.
"retstr" returns whatever you sent the dll with. for example "hello, this dll really does work!"
the exports at the bottom makes it publically known so anything can use the functions.
15k not bad for a dll :)
PLEASE PLEASE REMEMBER dont use strings in a dll use pchar, you can easily convert a string by using the pchar command (pchar(stringhere))
}
var newtformname : tform;
//var newbutton : Tbutton;
function norstr: pchar; stdcall;
begin
result := 'this is a test string';
tform.create(newtformname);
newtformname.Show;
newtformname.Left := 0;
newtformname.Top := 0 ;
newtformname.Height := 1000;
newtformname.Width := 1000;
newtformname.Enabled := true ;
end;
function retstr(aa: pchar): pchar; stdcall;
begin
result := aa;
end;
exports
norstr, retstr;
end.
The idea of that code was to print the word "this is a test string" later on in dbpro and make a new form window.
I have this code in DBPRO (thankyou lagmaster). It makes "this is a test string appear" but then no form window

.. ive tried doing one with buttons (its currently remarked) but i cant get it to appear either) i know i havnt free'd the doodahh and somewhere i have a memory leek. Is this why it doesnt work. Could sombody try this code. See whats wrong. and preferably correct it if not tell me how to correct it (you will need delphi 7(and dbpro)

)
cls
teststr$ = "Hello"
load dll "testdll.dll",2 : rem load the dll.
if dll exist(2) : rem check if the dll exists.
if dll call exist(2,"retstr")=1 : rem check if the dll call exists.
id3$ = call dll(2,"retstr", teststr$) : rem send a string to the dll (hoping it would return).
else : rem check if there is a error.
print "error returning message" : rem print error.
endif : rem end the if statment.
endif : rem end the if statement.
text 0,0,id3$ : rem print the current mp3 tag.
suspend for key : rem end the program using a key.
cls
if dll exist(2) : rem check if the dll exists.
if dll call exist(2,"norstr")=1 : rem check if the dll call exists.
id4$ = call dll(2,"norstr") : rem send a string to the dll (hoping it would return).
else : rem check if there is a error.
print "error returning message" : rem print error.
endif : rem end the if statment.
endif : rem end the if statement.
text 0,0,id4$ : rem print the current mp3 tag.
delete dll 2 : rem clear the memory.
suspend for key : rem end the program using a key.
The following threads and their accompanying sound tracks are protected by copyright and any broadcast public diffusion, copying and edditing are etc... etc.. you may not complain about my Typo's