|
-
Jan 17th, 2002, 10:09 AM
#1
Thread Starter
Member
UDT passed to a DLL
Hi folks, I must be stupid or something. I can't get the following
very simple code to work. Any help would be greatly appreciated as I can't find the answer. Regards, Mark ([email protected])
P.S The stuff below this line pastes straight into a .BAS file.
==============================================
'I expect the following output from Sub CreateRecords...
' 1
' 2
'A Variable Length String
' 3
' 4
' 5
'Another Variable Length String
' 6
Type RECORD
A As Double
B As Long
C As String
D As Long
End Type
Global Recs(1 To 2) As RECORD
Declare Sub DLLDillon Lib "\Chappel.23\Source\C\Useful23\Debug\useful23.dll" (TwoRecords As RECORD)
Sub CreateRecords()
Recs(1).C = "A Variable Length String"
Recs(2).C = "Another Variable Length String"
Call DLLDillon(Recs(1))
Debug.Print Recs(1).A
Debug.Print Recs(1).B
Debug.Print Recs(1).C
Debug.Print Recs(1).D
Debug.Print Recs(2).A
Debug.Print Recs(2).B
Debug.Print Recs(2).C
Debug.Print Recs(2).D
End Sub
'My attempt at the 'C' end follows...
'struct RECORD
'{
' double a;
' long b;
' long c;
' long d;
'};
'VOID FAR PASCAL DLLDillon(struct RECORD FAR* Recs)
'{
' Recs[0].a = 1;
' Recs[0].b = 2;
' //Recs[0].c = Don't even touch field 'c'
' Recs[0].d = 3;
' Recs[1].a = 4;
' Recs[1].b = 5;
' //Recs[0].c = Don't even touch field 'c'
' Recs[1].d = 6;
'}
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
|