I wanna detect flash memory stic when it is plugged and removed by using DeviceChage Method.
In fact, the program i made worked before i did something..
but, now it doesn't work anymore, so i debuged lots of time.
i will post the func() blow.
I can't find anything wrong. but "wparam" always says 7 which is defined
as "DBT_DEVINSTENUMERATED" in Dbt.h.
here is define of Dbt.h (I need this one)#define DBT_DEVICEARRIVAL 0x8000 // system detected a new device
#define DBT_DEVICEQUERYREMOVE 0x8001 // wants to remove, may fail
#define DBT_DEVICEQUERYREMOVEFAILED 0x8002 // removal aborted
#define DBT_DEVICEREMOVEPENDING 0x8003 // about to remove, still avail.
#define DBT_DEVICEREMOVECOMPLETE 0x8004 // device is gone
#define DBT_DEVICETYPESPECIFIC 0x8005 // type specific event
#if(WINVER >= _WIN32_WINNT_WIN7) (but always i get this one)#define DBT_DEVINSTENUMERATED 0x8007 // system detected a new device
#define DBT_DEVINSTSTARTED 0x8008 // device installed and started
#define DBT_DEVINSTREMOVED 0x8009 // device removed from system
#define DBT_DEVINSTPROPERTYCHANGED 0x800A // a property on the device changed
#endif /* WINVER >= _WIN32_WINNT_WIN7 */
Yes, you are right. I tried to use that DBT_DEVINSTENUMERATED , but i got an error saying "not defined.....". And also the program works on Debug mode, but doesn't work on Release mode.
I heard that the problem would probably be from Memory management. It's hard for me to solve it.
I am working on it, plz give me any idea~!.