> If I recall correctly, some apps handle notifications by setting > an alarm that will launch their app normally in a second or so.
Hmmm... That might work but it is... messy. Don't forget, the reason why I want to examine the card is in order to detect if there are any viruses on it - preferably, *before* they have infected the device; not in second or so after that. :-) One possibility would be to disable the execution of start.prc and set an alarm. Then, when the alarm triggers, scan the card and, if safe, execute start.prc myself. The reason why this is messy, is because the user might already be running an application that prevents the automatic execution of start.prc on the inserted cards. Since I have no way of determining whether this is the case, the behavior of my program would effectively disable that application - because my program would run start.prc anyway. :-( Sigh, this is an *awfuly designed* OS for anything related to systems programming... :-((( Not only it doesn't have any decent protection built-in - it basically makes it impossible to *add* proper protection. :-( If viruses ever become widespread for this platform, the user will suffer big time. :-(( Sigh... So, how do I execute start.prc "manually"? I guess I could copy it to the main memory with VFSImportDatabaseFromFile and then run it with SysUIAppSwitch - but that never returns to the "caller", so how would I get control, in order to delete it from the main memory??? Again set an alarm to do that "maybe some time later"?? Then how do I find it? It's probably not reliable to pass its LocalID to the alarm - what if other databases have been created meanwhile? Remember its Type and CreatorID and find it with DmGetNextDatabaseByTypeCreator? Or is there a better way? Besides, I still don't understand why the program I posted above crashes if the notification arrives when the Launcher is running. OK, so for some bizarre reason the Launcher posts an appStopEvent (you know, the kind of thing all newbies are told *not* to do when trying to exit an application). So, my application's event loop terminates immediately. Fine, I would have understood if, as a result, my application did nothing. But why the crash?! And the crash happens *after* my application quits - it seems as if it is the Launcher itself that's crashing... > It seems to me that in attempting to immediately transfer control > to the same app you are setting yourself up for timing and > event-queue issues Well, I thought that whe whole point of having notifications was so that your application could get control and do something useful AS SOON AS the respective event occurs, dammit! Not "maybe some time later"! Argh, this OS is *hell* for any kind of serious systems programming... :-((( In good old MS-DOS you just intercepted an interrupt vector and did whatever you wanted when the interrupt arrived - the lack of memory protection and the single-task-single-thread architecture were a help, not a hindrance... :-((( Regards, Vesselin -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
