Click here to Skip to main content
       

C / C++ / MFC

 
AnswerRe: Methods bank account PinmvpRichard MacCutchan7-Dec-12 21:56 
AnswerRe: Methods bank account PinmemberAlan Balkany10-Dec-12 5:43 
AnswerRe: Methods bank account PinmemberPecuniousPete10-Dec-12 8:05 
GeneralRe: Methods bank account PinmemberMagda634713-Mar-13 11:36 
Questionread text file Pinmemberpeoria1237-Dec-12 9:59 
AnswerRe: read text file PinmemberAndré Kraak7-Dec-12 20:56 
AnswerRe: read text file Pinmembersajeesh.c9-Dec-12 21:05 
QuestionWM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? PinmemberVaclav_Sal7-Dec-12 4:10 
<b>In process / progress of being solved</b>
 
WM_DEVICECHANGE sets wParam to DBT_DEVNODES_CHANGED to update list (tree?) nodes.
No other info is available then. I have not retrieved any device list, so it is useless for me.
 
To receive DBT_DEVICEARRIVAL it is necessary to first use   RegisterDeviceNotification.
 
At this point no other help is required.
Thanks
Vaclav
 

 
I need some help / hints with implementing   WM_DEVICECHANGE in MFC Document /View setup.
I have managed to intercept the WM_DEVICECHANGE in   CmainFrame message map and process it .
The problem m is that the wParam is nowhere near the 0x8xxx, but it is plain “7” and the lParam is 0.
 
I went thru the Dbt.h and cannot figure out what is the   wParam = 7 telling me.
 
Here is the code snippet and if it is not formatted to you liking – I am sorry , but I write my stuff in OpenOffice and than copy it to CodeProject so it cannot be formatted properly.
 
<b>I just need some troubleshooting pointer / suggestion how to analyze these mysterious parameters. </b>
 
Maybe CmainFRame is not the place to start, but I got same parameters values when I used Cdialog message map directly.

Any help is as always appreciated.
Cheers
Vaclav
 
     ON_MESSAGE(WM_DEVICECHANGE, OnMyDeviceChange)
 
bool   CMainFrame::OnMyDeviceChange(WPARAM wParam, LPARAM lParam)
{
     TRACE("\nLRESULT CMainFrame::OnMyDeviceChange(WPARAM wParam, LPARAM lParam)");
     TRACE("\nwparam %i ",wParam);
     TRACE("\nlParam %i ",lParam);
      AfxMessageBox("!!!! CMainFrame::Device detection ");
      // pass WM_HARDWARE to view
      GetActiveView()->PostMessage(WM_HARDWARE,wParam,lParam);
….
 

Addendum
JUst found this info, so the additional question is - is CMainFrame "top window" and if not will RegisterDeviceNotification solve this ? I shall try it next.
 

The DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE events are automatically broadcast to all top-level windows for port devices. Therefore, it is not necessary to call RegisterDeviceNotification for ports, and the function fails if the dbch_devicetype member is DBT_DEVTYP_PORT.
AnswerRe: WM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? PinmemberJochen Arndt7-Dec-12 5:56 
AnswerRe: WM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? Pinmemberjeron17-Dec-12 5:59 
GeneralRe: WM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? PinmemberVaclav_Sal7-Dec-12 6:58 
AnswerRe: WM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? PinmvpRichard MacCutchan7-Dec-12 21:51 
GeneralRe: WM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? PinmemberVaclav_Sal9-Dec-12 5:47 
AnswerRe: WM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? PinmemberPecuniousPete9-Dec-12 20:23 
Questionhow to find out the codes who eat up my memory? PinmemberFalconapollo7-Dec-12 2:32 
AnswerRe: how to find out the codes who eat up my memory? PinmvpRichard MacCutchan7-Dec-12 2:54 
QuestionRe: how to find out the codes who eat up my memory? PinmemberDavidCrow7-Dec-12 2:55 
AnswerRe: how to find out the codes who eat up my memory? PinmemberFalconapollo7-Dec-12 3:11 
QuestionRe: how to find out the codes who eat up my memory? PinmemberDavidCrow7-Dec-12 3:25 
AnswerRe: how to find out the codes who eat up my memory? PinmemberFalconapollo7-Dec-12 3:28 
AnswerRe: how to find out the codes who eat up my memory? PinmemberJoe Woodbury7-Dec-12 8:30 
AnswerRe: how to find out the codes who eat up my memory? Pinmembervr9999999998-Dec-12 1:25 
AnswerRe: how to find out the codes who eat up my memory? PinmemberPecuniousPete11-Dec-12 20:42 
QuestionImage processing and converter PinmemberFlaviu26-Dec-12 22:12 
QuestionRe: Image processing and converter PinmvpRichard MacCutchan6-Dec-12 22:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 18 Sep 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid