Could you post the Str[0] value? Also did you allocate memory for the pchar parameter? Remember PChar is just a pointer, not an actual container.
HI all , i have a dll that i would like to use in vb6. the problem i am having is that delphi cant see the values passed to it from vb6 ....however vb6 can get what ever i pass to it from Delphi
library db_conn;
uses
fastsharemem,
SysUtils,
dialogs,
Classes;
{$R *.res}
function SayHI(strchar):string; stdcall;
begin
ShowMessage(str); {shows blank indicating it gets nothing from VB6}
Result:='ameman';
end;
exports
SayHI;
begin
end.
Anything or Anyone that fails to grow will eventually die. {AI}
-------------------------------------------------
Tomorrow is the future!
Today Is the Tomorrow you made Yesterday!{AI}
Could you post the Str[0] value? Also did you allocate memory for the pchar parameter? Remember PChar is just a pointer, not an actual container.
Last edited by Blunty Killer; October 24, 2006 at 09:27 PM.
Hmmm, what is this Str[0] you speak off?
Last edited by Artificial_Intelligence; October 25, 2006 at 08:25 AM.
Anything or Anyone that fails to grow will eventually die. {AI}
-------------------------------------------------
Tomorrow is the future!
Today Is the Tomorrow you made Yesterday!{AI}
Here is a quick example of using Windows API style calls. That is, you send the container and the max length of the container from the caller. The DLL function the does the rest.
DLL and VB calls using WinAPI sytle
Raspect man. that last post helped.
i now realize what are the effects of not learing a language fromt the ground up but from the top down.
is leaves a week foundation. Especially since the os is not OO in all aspects .
Last edited by Artificial_Intelligence; October 27, 2006 at 11:32 AM.
Anything or Anyone that fails to grow will eventually die. {AI}
-------------------------------------------------
Tomorrow is the future!
Today Is the Tomorrow you made Yesterday!{AI}
If anything came across you should be able to pick it up. PChars unlike normal strings dont have a length, the first character is actually a part of the string. The string ends when a null character returns (#0). So if you sent 'Hello World', PChar[0] should by 'H.' It's just a simple test.
Ho.......lol thought you where referring to something other than what you mentioned.
yah i know how pchars work (c/c++) ,just that I have been using widestring so long working with pchars feels weird. Plus I never did learnt Pascal I started with Delphi from the OOP stand point.
Thanks for the heads up though
Anything or Anyone that fails to grow will eventually die. {AI}
-------------------------------------------------
Tomorrow is the future!
Today Is the Tomorrow you made Yesterday!{AI}