I am using BDS2006 to develop an app. When the app starts I am dynamically loading a BPL I have created that uses COM to connect to a 3D mouse.
I am calling LoadLibary in the main form's Show event. Everything works, however...
If there is no form showing when the library is loaded the app will create an exception when it closes. If there is a form showing it is fine. As a work around I am using a splash screen, but I would like to understand what is happening.
The stack looks like this when it all goes wrong:
:7c81eb33 kernel32.RaiseException + 0x52
:32758966 CC3270MT.___raiseDebuggerException + 0x1a
:32758a40 CC3270MT.___raiseDebuggerException + 0xf4
:7c9037bf ntdll.RtlConvertUlongToLargeInteger + 0x7a
:7c90378b ntdll.RtlConvertUlongToLargeInteger + 0x46
:7c90eafa ntdll.KiUserExceptionDispatcher + 0xe
:77d48816 ; C:\WINDOWS\system32\USER32.dll
:77d4b4c0 ; C:\WINDOWS\system32\USER32.dll
:77d4b50c ; C:\WINDOWS\system32\USER32.dll
:7c90eae3 ntdll.KiUserCallbackDispatcher + 0x13
:520730a8 vcl100.@Forms@TCustomForm@DestroyWindowHandle$qqrv + 0x38
:00403FB8 Forms::TForm::~TForm(this=:00E90620)
:00403DBE TMainForm::~TMainForm(this=:00E90620)
:51f5f45a rtl100.@Classes@TComponent@DestroyComponents$qqrv + 0x4a
:32778bff ; C:\WINDOWS\system32\CC3270MT.DLL
:32778c4e ; C:\WINDOWS\system32\CC3270MT.DLL
:32775e10 CC3270MT._exit + 0x10
:32778e24 ; C:\WINDOWS\system32\CC3270MT.DLL
The app uses OpenGL as well, but I don't think this is causing the problem.
Tim
> I am using BDS2006 to develop an app. When the app starts I am
> dynamically loading a BPL I have created that uses COM to connect to a 3D
> mouse.
>
> I am calling LoadLibary in the main form's Show event. Everything works,
> however...
Have you tried using LoadPackage() instead?
Clayton
Regards
Eike Petersen
Tim
But [bds2006] we've had problems using .DLLs that contained references to
iostreams, from an application that did not contain any reference to
iostreams. (Generally, but maybe not always, the application would either
crash, or hang, at shutdown.)
If the .dll used a stream, but client application does not, there is
apparently a problem in how the rtl stream library support is
(de-)initialized... Workaround seemed to be to have the application (I think
I've done it in WinMain) define some useless thing, maybe like populating a
stringstream...
I think there was something else, see if I can find it... nope, that was
specific to some of our libraries.
Don't know if such could perhaps also exist with some other rtl facility not
being (de-)initialized properly, with regard to something being used in your
dll/package, that is not used in the main application - something to
consider if you still haven't found your problem.
Looking at your stack a bit more, is there some facility that is perhaps
referencing a form that is no longer valid - you say the form is not
showing - is it just not currently showing, was it never created (seems
unlikely given the destructor reference in stack), or could it possibly have
been destructed earlier, and destruction is being attempted again?
"Tim Frost" <T...@FrostArt.co.uk> wrote in message
news:47cef2e6$1...@newsgroups.borland.com...
>