TIP: Click on subject to list as thread! ANSI
echo: delphi
to: ALL
from: SIMON HUGGINS
date: 1997-06-17 20:41:00
subject: Passing strings from DLLs

Hi All,
I'm trying to get a DLL to interface with Visual Basic with no success.
The DLLs function is defined as:
function testdll(str:pchar):boolean; export;
The idea was to test the ability to pass strings to and from the DLL from
a VB program.
In VB I have tried:
Private Declare Function testdll Lib "greendll" (ByVal s As String)
As Boolean
I also tried using Byref instead. I really don't know what type is
compatible with a pchar.
VB doesn't handle pointers properly. So I'm a bit stuck.
Basically my Delphi project compares the string using strcomp to 'HAPPY'
(which I will be if this works) and then returning true or false.
I have tried passing the text of a textbox to the dll and getting the
return value into a label.
Unfortunately that didn't work. So I tried adding a #0. Well VB speak for
it Chr$(0) but that didn't work either.
Can someone please *HELP*!!!
bfn,
si.
Fido: 2:440/7.15       *** SEE IT. LIVE IT. BE IT.      TREK_RANKS_UK ***
Internet: huggie@dial.pipex.com
Web: http://ds.dial.pipex.com/huggie
.!. I used to have a handle on life, then DOS closed it...
--- Terminate 4.00/Pro
---------------
* Origin: Fou, con et anglais! (2:440/7.15)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.