hi friends/seniors
i am stuck on one problem in VB 6.0 and need solution. see if u can help me.
first i describe the problem.
Can u imagin the WinZip scenario. we right click on some file and select in
context menu add to zip.Now if
winzip is not runnig allready new instance of winzip application begins and
u add the file to whatever .zip file.
Now let the application be running and right click on some other file and
again select add to zip. and winZip
automatically detects the previous instance of application and adds ur file
to the last zip. This is exactily what
i need to de but in some other contexts. I am implementing backup system for
LAN/VPN where user can select
files of his interest and those will be added to backup list. I need to back
up these file dynamically as soon as
any of them changes. For this i have have written one activeX
exe component that watches (keeps spying) for any File Changes using
'FindFirstChangeNotification' for every file that
has been added by user to backUp List and as any change notification is
received this component raises event that i
catch in my main application and take back up for whatever file changes.
Now the client needs that if this application is running and user wants to
add some file he should be able to do that
by right clicking and selecting from context say "add to BackUp List". noe
at this if previous instance is running my
main application should stop the spying component and add new file to the
list and restart the spying with new list.
now i explain where things go wrong
my component is working fine. i can stop it anytime through my main
application add new file to list and restart it with
new list, this works fine if user do this through GUI of main application.
But if user tries to this through right click
context menu things go wrong. If previous instance is running then i have to
use subclassing for processing
WM_COPYDATA msg in my main application. The new instance of application just
detects the presence of previous
instance and then sends any command line parameter (the name of the file
that is right clicked) to it using 'SendMessage'
WIN32 api, and then just END itself . Now previous instance of the
application has to process the command line parameter
that is received on WM_COPYDATA msg. This processing works fine as long as
i'm doing any processing/accessing
on my main application's objects (like main GUI form/any modules). like for
refreshing the list view on main form, adding
file name to collection in module. all this is being done with that previous
instance. but the moment it tries to access the
activeX exe component (say for stopping it, rater any dammed access say any
simple property of that component) the
main application's instance crashes. the error that is returned is
"The Exception Floating-Point inexact result"
(Oxc000008f) occured in the application at location 0x77e8f142.
Click OK to terminet the program ....cancel to debug.
Please note that as long as my main application try to access the spy
component through any GUI initiated events this works
fine only when i'm sending msg to previous instance, then that instance is
crashing.
I'm stuck on this. i did all search on net, google and what have u. but no
avail. plz let me know if any of u can give me some
breakthrough. thanks
-deven
Jens Neuhalfen - 27 Aug 2003 18:40 GMT
Hi,
AFAIR the floating point inexact is used internally to handle C++
exceptions.
From
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs600/html/de
bugging.asp
[cite]
Although exceptions are well documented on MSDN, it is worth discussing
them a little at this point. There are two types of exceptions: first
chance and second chance exceptions. These exceptions are actually
identical, except for one difference: the stage at which they are
handled. A first chance exception may mean that something has gone
wrong, but in practice it is more likely that an application is simply
using the exception handling mechanism to handle a normal case. A
handled first chance exception is not generally a problem and can be
ignored. Visual Basic often uses Inexact Floating Point exceptions as
part of its run time system, and as long as there is a first chance
exception handler (and there is in this case), this exception indicates
that there is no problem. An unhandled first chance exception is thrown
to the next level and becomes a second chance exception, which is
handled by a second chance exception handler. If the application is
running normally, this is likely to be DrWatson.exe. If the application
is being debugged, the debugger will normally act as a second chance
exception handler and drop into break mode. The exception to this occurs
when you are debugging Visual Basic code under the Visual Basic IDE,
since this IDE does not handle low-level errors.
[/cite]
* Do you use a coolbar?
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/s
upport/kb/articles/Q257/6/30.asp&NoWebContent=1
* When you use "END" you do things with vb it does not like - try to be
nice and shutdown the way it is meant to be. :-)
* Use the VC++ debugger :-)
Jens
[snip]