Microsoft KB Archive/274337

= How To Automatically Launch REPLLOG Using the Notification Subsystem =

Article ID: 274337

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Windows CE Platform Builder 2.12
 * Microsoft Encarta Reference Suite 2001

-



This article was previously published under Q274337



SUMMARY
To automatically launch Repllog.exe when a serial cable gets connected to the target device you must perform the following:


 * 1) Register an event in the system events database DB_notify_events.
 * 2) From your serial device driver, call the CeEventHasOccurred function when you detect that a cable has been connected.



MORE INFORMATION
Following is a sample of how to populate the DB_notify_events database by using the Project.db file of your Platform Builder project: Database: &quot;DB_notify_events&quot; : 888 : 1 : 0001001f : 0 Record : Field : 0001001f : &quot;repllog.exe&quot; Field : 0002001f : &quot;&quot; Field : 00030013 : 9 End End Database The value of the field with the property identifier 0001001f (PROP_TAG(CEVT_LPWSTR,1)) specifies the name of the application that should be launched. The value of the field with the property identifier 0002001f (PROP_TAG(CEVT_LPWSTR,2)) specifies the command line for the application. The value of the field with the property identifier 00030013 (PROP_TAG(CEVT_UI4,3)) specifies the event notification code.

From your serial device driver, when it detects an RS232 cable event, call the CeEventHasOccurred function with the event notification code set to NOTIFICATION_EVENT_RS232_DETECTED (0x09). For an example, see the source code of the ODO serial driver sample located in the Platform Builder subfolder \PLATFORM\ODO\DRIVERS\SERIAL\P2IO.C (line 1681 for version 2.12, line 1675 for version 3.0).

