Re: Problem closing app with big UDT
On Tue, 21 Nov 2006 19:23:56 -0500, David Kerber
<ns_dkerber@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
In article <u5YSTFcDHHA.3604@xxxxxxxxxxxxxxxxxxxx>, Dan@xxxxxxxx says...
This same structure works with no trouble in
Delphi.
Are you trying to pass the UDT between VB and Delphi, or do you just mean
that the Delphi equivalent works fine?
Passing it back and forth between a Delphi .dll to a VB application.
Yes, we are aware of the alignment issue, and have designed with that in
mind. ALL the data is of one of 3 types: Long, Double, or Byte array.
All the array sizes are multiples of 4, so the 4-byte alignment should
be maintained throughout unless we screwed up somewhere. We didn't
think of passing the whole thing as a byte array, and it's too late to
go back and rework it now.
It would take about 1 hour max to re-work it
- see my earlier post following Bob's
One of the nice things about using UDTs is that they can be converted
into Classes very easily.
.
Relevant Pages
- Re: Problem closing app with big UDT
... that the Delphi equivalent works fine? ... ALL the data is of one of 3 types: Long, Double, or Byte array. ... All the array sizes are multiples of 4, so the 4-byte alignment should ... In any one app, maybe, but this dll is in production use in several ... (microsoft.public.vb.general.discussion) - Re: Mass delete files and directories
... If you look at the code I originally posted you'll see that I have used a Long at that position in the UDT and it works fine here on both my machines, but you said that it does not work on one of your four customer machines, and you also said that you had tried both Boolean and Long at that position with the same result. ... You will still have problems if you try to use any of the three remaining items in the UDT though (the three items immediately following fFlags) because they are two Longs and a String pointer and VB will "pad" the fFlags integer with two padding bytes so that the first of those Longs starts on a LongWord boundary. ... if you plan to use any of those last three entries in the UDT then you would be better off replacing all three of them with a byte array ... He changed the compatibility back to Win98/ME and it ran flawlessly. ... (microsoft.public.vb.general.discussion) - Re: Mass delete files and directories
... Simply replacing the three items after fFlags with a Byte Array will not solve the problem in itself. ... To be on the safe side you really do need to shift the data in the last 12 used bytes of of the UDT up by 2 bytes so that the data ends up in the position that the SHFileOperation routine expects it to be in. ... I've only got Vista here at the moment so I cannot try it on XP, but are you now saying that your call fails on all XP Home machines and that it works okay on the three XP Pro machines? ... (microsoft.public.vb.general.discussion) - Re: Reading UDTs out of a byte array (CopyMemory vs Get on a disk file)
... before reading bytes out of it into a UDT doesn't produce the correct ... reading the file off the network into a byte array and the writing it ... The difficulty is that when a byte array or UDT is read to disk, ... (microsoft.public.vb.winapi) - Re: VB and binary files
... Is it possible to write this data to a binary file in VB. ... the simplest way would be to store the data into a byte array and PUT it into your file of choice. ... You can open the file for BINARY or RANDOM (which might be better as you are using a UDT and therefore can navigate one record at a time). ... public Type MyOtherUDT ... (microsoft.public.vb.enterprise) |
|