
ctl3dv2.dll * MS-Office = CRASH!!!
Quote:
>Beware of leaving the DLL registered. I was getting all of these GPF's
>during design mode, until I changed my method of implementing 3d
>dialogs.
>What I do now (and haven't gotten a single GPF w/ lot's of other
>programs running) is to register the DLL, the Call the Dialog, the
>unregister the dialog. Something like...
Better to only register the DLL if you are not in design mode. Here's the
relevant bit of my register function:
Dim WinDir as String * 150
[...]
Inst% = GetWindowWord(MasterForm.hWnd, GWW_Hinstance)
'CTL3DV2 seems to accept an instance handle instead
'of a module handle, but can't be too careful, so...
Inst% = GetInstanceModule(Inst%)
res% = GetModuleFileName(Inst%, Windir, Len(Windir))
If InStr(Left(Windir, res%), "VB.EXE") Then
Beep
Inst% = -1
Else
res% = Ctl3dRegister(Inst%)
res% = Ctl3dAutoSubClass(Inst%)
End If
The other thing to watch out for is untrapped runtime errors: if your program
crashes out whilst ctl3d is registered, Windows will become unstable.
"The trouble with the drink talking is that the drink knows too much"