Just a small extension of this,
if you have it defined as an array of bytes, you can copy the structure you
have defined in VB over the top of the array of bytes using RtlMoveMemory
and using the VarPtr function in VB. Just have an array of bytes the
sizeof() your structure
For example...
Public Type udtDetail
intPacketSize As Integer
lngPacketNumber As Long
bytPacketType As Byte
bytAcknowledge As Byte
End Type
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpvDest
As Any, lpvSrc As Any, ByVal dwSize&)
Dim typData As udtDetail
Dim abytSend() As Byte
ReDim abytSend(LenB(typData))
' Copy the memory structure over the byte array
CopyMemory abytSend(0), typData, LenB(typData)
I agree that antoher interface / object to represent the record details
would be much better but the above shows you how to do the "hack" way :-)
Tony Sinclair
Holliday Group Limited
Christchurch
New Zealand
-----Original Message-----
From: Myles Penlington [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 4 October 2000 15:00
To: Multiple recipients of list delphi
Subject: RE: [DUG]: passing record structures
Not really.
Much easier to define another interface/object to represent the record
details.
You could read it in Delphi, but you cannot pass it from VB as far as I know
- the best you could do would be a variant array of byte (but then you have
to get the record into the variant array of byte on the VB side).
Myles.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 05, 2000 3:44 AM
To: Multiple recipients of list delphi
Subject: [DUG]: passing record structures
Hi all.....this is a bit of an odd question, but I have a COM object that I
am writting at the moment.
It is used in both a vb and a Delphi app.
I wonder, if I am using a variant for a property, could I pass a record
structure from VB into delphi, and still be able to read it in some form or
another ??
Cheers, Jeremy Coulter
Jeremy Coulter (Manager)
Visual Software Solutions
Christchurch, New Zealand
PH 03-3521595
FAX 03-3521596
MOBILE 021-2533214
www.vss.co.nz
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"