Click here to Skip to main content
12,635,139 members (25,893 online)

C / C++ / MFC

 
AnswerRe: Methods bank account Pin
Richard MacCutchan7-Dec-12 22:56
mvpRichard MacCutchan7-Dec-12 22:56 
AnswerRe: Methods bank account Pin
Alan Balkany10-Dec-12 6:43
memberAlan Balkany10-Dec-12 6:43 
AnswerRe: Methods bank account Pin
PecuniousPete10-Dec-12 9:05
memberPecuniousPete10-Dec-12 9:05 
GeneralRe: Methods bank account Pin
Magda634713-Mar-13 12:36
memberMagda634713-Mar-13 12:36 
Questionread text file Pin
peoria1237-Dec-12 10:59
memberpeoria1237-Dec-12 10:59 
AnswerRe: read text file Pin
André Kraak7-Dec-12 21:56
memberAndré Kraak7-Dec-12 21:56 
AnswerRe: read text file Pin
sajeesh.c9-Dec-12 22:05
membersajeesh.c9-Dec-12 22:05 
QuestionWM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? Pin
Vaclav_Sal7-Dec-12 5:10
memberVaclav_Sal7-Dec-12 5: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? Pin
Jochen Arndt7-Dec-12 6:56
memberJochen Arndt7-Dec-12 6:56 
AnswerRe: WM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? Pin
jeron17-Dec-12 6:59
memberjeron17-Dec-12 6:59 
GeneralRe: WM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? Pin
Vaclav_Sal7-Dec-12 7:58
memberVaclav_Sal7-Dec-12 7:58 
AnswerRe: WM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? Pin
Richard MacCutchan7-Dec-12 22:51
mvpRichard MacCutchan7-Dec-12 22:51 
GeneralRe: WM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? Pin
Vaclav_Sal9-Dec-12 6:47
memberVaclav_Sal9-Dec-12 6:47 
AnswerRe: WM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? Pin
PecuniousPete9-Dec-12 21:23
memberPecuniousPete9-Dec-12 21:23 
Questionhow to find out the codes who eat up my memory? Pin
Falconapollo7-Dec-12 3:32
memberFalconapollo7-Dec-12 3:32 
AnswerRe: how to find out the codes who eat up my memory? Pin
Richard MacCutchan7-Dec-12 3:54
mvpRichard MacCutchan7-Dec-12 3:54 
QuestionRe: how to find out the codes who eat up my memory? Pin
DavidCrow7-Dec-12 3:55
memberDavidCrow7-Dec-12 3:55 
AnswerRe: how to find out the codes who eat up my memory? Pin
Falconapollo7-Dec-12 4:11
memberFalconapollo7-Dec-12 4:11 
QuestionRe: how to find out the codes who eat up my memory? Pin
DavidCrow7-Dec-12 4:25
memberDavidCrow7-Dec-12 4:25 
AnswerRe: how to find out the codes who eat up my memory? Pin
Falconapollo7-Dec-12 4:28
memberFalconapollo7-Dec-12 4:28 
AnswerRe: how to find out the codes who eat up my memory? Pin
Joe Woodbury7-Dec-12 9:30
memberJoe Woodbury7-Dec-12 9:30 
AnswerRe: how to find out the codes who eat up my memory? Pin
vr9999999998-Dec-12 2:25
membervr9999999998-Dec-12 2:25 
AnswerRe: how to find out the codes who eat up my memory? Pin
PecuniousPete11-Dec-12 21:42
memberPecuniousPete11-Dec-12 21:42 
QuestionImage processing and converter Pin
Flaviu26-Dec-12 23:12
memberFlaviu26-Dec-12 23:12 
QuestionRe: Image processing and converter Pin
Richard MacCutchan6-Dec-12 23:18
mvpRichard MacCutchan6-Dec-12 23:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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
Web02 | 2.8.161208.2 | Last Updated 10 Dec 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid