|
-
January 1st, 2000, 08:57 PM
#1
C - VB type conversion problem?
Hi, could anyone please shed some light on what I'm doing wrong?
I'm trying to get a true value from a C function, but it always returns false.
In my C DLL, I have the function header as
BOOL Open(PSTR filename)
in my VB project, I first have the declaration as:
private Declare Function OpenDB Lib "DataBase.dll" Alias "Open" (byval txtFile as string) as Long
and then, as a procedure:
private Sub Form_Load()
Dim opened as Long
opened = OpenDB("theDB")
If opened = 1 then
lblRecordCounter = "DATABASE OPENED"
else
lblRecordCounter = "DATABASE CLOSED"
End If
End Sub
I don't get any errors, just a "DATABASE CLOSED" all the time rather than a "DATABASE OPENED".
Can anyone please tell me what I'm doing wrong?
Thanks for any help
Mark.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|