Re: Problem closing app with big UDT
- From: David Kerber <ns_dkerber@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 21 Nov 2006 19:23:56 -0500
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.
My gut feeling is that there's something in the .dll that isn't
intializing a small part of the structure correctly; I've got the Delphi
programmer looking at this, because it used to work ok. But I don't
know what (if anything) has changed, so it's tough to isolate.
As JFrench said, if you're passing the data between VB and Delphi you need
to be sure the alignment matches. Note that there are *more options* than
just Packed or not Packed ("Project Options|Compiler|Record field
alignment"). Delphi allows you to specify the alignment boundary. You
should also carefully check the data types.
FWIW, I don't pass UDT's as UDT's. I put them in byte arrays for the pass
so I can't speak from experience on making it work. I think it should be OK
though..
Dan
"David Kerber" <ns_dkerber@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:MPG.1fcb718e18e4ad9b989a4a@xxxxxxxxxxxxxxxxxxxxxx
I have an app which uses a big (44708 bytes) UDT, which is made up of
Longs, Doubles and byte arrays. Since that is bigger than 32k, the
compiler chokes on it when I try to define it as a local, and demands
that I dim it as either a global or at the form level before it will
compile.
Once I do that, it runs fine until I shut down the app. When running in
the IDE, it just silently kills the IDE. When running compiled, it
throws the folloging "Application Error": The instruction at
"0x00000000" referenced memory at "0x00000000". The memory could not be
"read".
This isn't a show-stopper because the app works fine until I close it
out, but it's rather disconcerting, especially to my users. Any ideas
on how to fix this? This same structure works with no trouble in
Delphi.
--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
.
- Follow-Ups:
- Re: Problem closing app with big UDT
- From: Dan Barclay
- Re: Problem closing app with big UDT
- From: J French
- Re: Problem closing app with big UDT
- References:
- Problem closing app with big UDT
- From: David Kerber
- Re: Problem closing app with big UDT
- From: Dan Barclay
- Problem closing app with big UDT
- Prev by Date: Re: How Big is Too Big?
- Next by Date: Re: How Big is Too Big?
- Previous by thread: Re: Problem closing app with big UDT
- Next by thread: Re: Problem closing app with big UDT
- Index(es):
Relevant Pages
|