UnRegisterShellEvent returns False

delphi package - easy access to shell apis

UnRegisterShellEvent returns False

Postby zifnabbe » Thu Sep 07, 2006 9:37 am

Hi,

I've an application which uses several dll's depending on profiles etc. In one of the dll's I use RegisterShellEvent & UnRegisterShellEvent:

WriteToLog(Self, Format('Trying to monitor %s', [GetDataFile]), llTrace);
FActive := RegisterShellEvent(
ShellEvent,
GetDataFileDir,
false,
[seItemCreated, seItemChanged, seItemDeleted]
);
if FActive then
WriteToLog(Self, Format('Started monitoring of %s', [GetDataFile]), llTrace);

procedure TClientPrid.Stop;
begin
WriteToLog(Self, Format('Trying to unmonitor %s', [GetDataFile]), llTrace);
if UnRegisterShellEvent(ShellEvent) then
WriteToLog(Self, Format('Finished monitoring of %s', [GetDataFile]), llTrace);
FActive := False;
end;

In the log file, I see that the monitoring starten, but I see also that it never got to the finished point. ie I see the logmsg 'Trying to unmonitor', but not the message 'Finished monitoring' so I assume the UnRegisterShellEvent returns false.

I do also get an AV when destroying the dll. (normal I guess with the above issue)

Is there a way to find out why the UnRegister fails?

Thanks in advance
zifnabbe
 
Posts: 7
Joined: Wed May 03, 2006 2:04 pm

Postby zifnabbe » Thu Sep 07, 2006 9:52 am

Mmm, I noticed that in version 1.3o of madShell the UnregisterShellEvent will always return false...

Did some further debugging and see that something else must be causing the AV, the debugging log just pointed me to a wrong assumption.

Would be nice to let the UnRegisterShellEvent return true at a certain moment.

Regards
zifnabbe
 
Posts: 7
Joined: Wed May 03, 2006 2:04 pm

Postby madshi » Thu Sep 07, 2006 10:48 am

Just checked the source code and you're right, UnregisterShellEvent always returns false! :sceptic:

Will change that in the next build - thanks for the report!

So the AV is not caused by madShell?
madshi
Site Admin
 
Posts: 9376
Joined: Sun Mar 21, 2004 5:25 pm

Postby zifnabbe » Thu Sep 07, 2006 1:04 pm

So the AV is not caused by madShell?


Nope, not caused by madshell, the shellevents are working fine.
zifnabbe
 
Posts: 7
Joined: Wed May 03, 2006 2:04 pm


Return to madShell

Who is online

Users browsing this forum: No registered users and 1 guest

cron