vc4 DAO app ok under nt3.51 but not win95
Keith Faulkner -- keith@g4eqz.demon.co.uk
Thursday, February 29, 1996
system : vc4 + nt 3.51 rev2 ( + win95 ) ... p100, 32mb
I have been writing an application using vc4 under nt3.51 to run under
windows95. It is based around an appwizard CDAOrecordset, CFormView.
Everything works fine in release or debug under nt, no memory leaks, no
error messages under debug etc.
However, if I run it under win95 everything functions fine until I quit
the app at which point I sometimes get the following message:-
'MyApp' caused an invalid page fault in
module KERNEL32.DLL at 0137:bff9a07c.
Registers:
EAX=02c6fe70 CS=0137 EIP=bff9a07c EFLGS=00000246 ... etc, etc
I may be able to open and close the application several times befor this
occurs but once it does its degenerative, eventualy requiring a reboot.
The reference to kernell32.dll is consistant. Simply opening the app
which does the usuall default query and then shutting it immediatly is
sufficient to cause the error. Interestingly, it is 10 times more stable
on another machine 486dx100 ( as opposed to my p100 ) though I can't
think what difference this should make.
I just lost one of my drives ( needless to say the best one ) so I am
temporarily down to 1gb split 50:50 ntfs and win95. Therefore I cant run
vc4 from the fat partition under w95. I am wating for a warranty
replacement drive so dont want to calve up my remaining disk if I can
help it.
I am a bit stuck for which way to go next, I have picked up one or two
adverse comments about DAO across the net, anyone had this experience.
Alernatively can anyone glean any clues from the error message.
Any pointers welcome ... Cheers .. Keith
Keith Faulkner
keith@g4eqz.demon.co.uk
Compuserve [100024,506]
David Ohlssen -- DAVIDO@COMMERCE.CTECH.AC.ZA
Tuesday, March 05, 1996
Keith,
I humbly offer that your messages are uncannily similar to my
problem doing the same thing. Except I got them at every attempt
to run under w95. The fix was to install DAO from redist
separately under w95. There are many same-named DLL's and this
must surely be the problem. Since then I run Dao on several w95
"client" machines and it is remarkably good and easy to use. In
particular, the FindFirst("...") is fast and doesn't need a special
requery like CRecordSet.
A tip for performance (please comment, guru's): Open the database in
a higher level of the app and keep it open until exit. Then if a
particular menu option lower down needs to open it separately it is
already open and saves lots of time. No need to even pick up a
pointer to the (top) open database, simply open it again or
implicitly.
David O. Ohlssen
I _____________________________________ I
I | Davido@Commerce.CTech.ac.ZA | I
I | __ ____________ | I
I | / \/ Cape Town \ _ | I
I |__/ South Africa \/ \__________| I
I_________________________________________I
Keith Faulkner -- keith@g4eqz.demon.co.uk
Wednesday, March 06, 1996
In message <498E12C0314@COMMERCE.CTECH.AC.ZA>, David Ohlssen
writes
>Keith,
>
>I humbly offer that your messages are uncannily similar to my
>problem doing the same thing. Except I got them at every attempt
>to run under w95. The fix was to install DAO from redist
>separately under w95. There are many same-named DLL's and this
>must surely be the problem. Since then I run Dao on several w95
>"client" machines and it is remarkably good and easy to use. In
>particular, the FindFirst("...") is fast and doesn't need a special
>requery like CRecordSet.
>
Hi David,
thanks for the response, since my posting I had reinstalled vc from 95
but the problem still persisted - even with a new, straight wizard
generated app. I finaly cured it by deriving an ExitInstance in the main
app and sticking a Sleep(100) before the return :-
Change the default supplied ExitInstance from :-
int CYourApplication::ExitInstance()
{
return = CWinApp::ExitInstance();
}
to :-
int CYourApplication::ExitInstance()
{
// tidy up DAO etc and save return value
int nReturn = CWinApp::ExitInstance();
// Sleep main thread to give unfinished threads
Sleep(100); // some extra time to terminate
// now return to exit the application main thread
return nReturn;
}
The idea was that the worker threads generated bt the DAO stuff would
get a chance to do finish. I am not sure if this reflects a problem in
vc4 or win95 but this killed the problem stone dead. 100 open / close
cycles without a crash.
cheers ... Keith
Keith Faulkner
keith@g4eqz.demon.co.uk
Compuserve [100024,506]
Demon Internet ... The M25 of the Information Super Highway ...
| Вернуться в корень Архива
|