Click here to Skip to main content
15,885,244 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Methods bank account Pin
Richard MacCutchan7-Dec-12 21:56
mveRichard MacCutchan7-Dec-12 21:56 
AnswerRe: Methods bank account Pin
Alan Balkany10-Dec-12 5:43
Alan Balkany10-Dec-12 5:43 
AnswerRe: Methods bank account Pin
PecuniousPete10-Dec-12 8:05
PecuniousPete10-Dec-12 8:05 
GeneralRe: Methods bank account Pin
Magda634713-Mar-13 11:36
Magda634713-Mar-13 11:36 
Questionread text file Pin
peoria1237-Dec-12 9:59
peoria1237-Dec-12 9:59 
AnswerRe: read text file Pin
André Kraak7-Dec-12 20:56
André Kraak7-Dec-12 20:56 
AnswerRe: read text file Pin
Sajeesh Payolam9-Dec-12 21:05
Sajeesh Payolam9-Dec-12 21:05 
QuestionWM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? Pin
Vaclav_7-Dec-12 4:10
Vaclav_7-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? Pin
Jochen Arndt7-Dec-12 5:56
professionalJochen Arndt7-Dec-12 5:56 
AnswerRe: WM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? Pin
jeron17-Dec-12 5:59
jeron17-Dec-12 5:59 
GeneralRe: WM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? Pin
Vaclav_7-Dec-12 6:58
Vaclav_7-Dec-12 6:58 
AnswerRe: WM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? Pin
Richard MacCutchan7-Dec-12 21:51
mveRichard MacCutchan7-Dec-12 21:51 
GeneralRe: WM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? Pin
Vaclav_9-Dec-12 5:47
Vaclav_9-Dec-12 5:47 
AnswerRe: WM_DEVICECHANGE sets wParam to unexpected value of 7 - how to troubleshoot this? Pin
PecuniousPete9-Dec-12 20:23
PecuniousPete9-Dec-12 20:23 
Questionhow to find out the codes who eat up my memory? Pin
Falconapollo7-Dec-12 2:32
Falconapollo7-Dec-12 2:32 
AnswerRe: how to find out the codes who eat up my memory? Pin
Richard MacCutchan7-Dec-12 2:54
mveRichard MacCutchan7-Dec-12 2:54 
QuestionRe: how to find out the codes who eat up my memory? Pin
David Crow7-Dec-12 2:55
David Crow7-Dec-12 2:55 
AnswerRe: how to find out the codes who eat up my memory? Pin
Falconapollo7-Dec-12 3:11
Falconapollo7-Dec-12 3:11 
QuestionRe: how to find out the codes who eat up my memory? Pin
David Crow7-Dec-12 3:25
David Crow7-Dec-12 3:25 
AnswerRe: how to find out the codes who eat up my memory? Pin
Falconapollo7-Dec-12 3:28
Falconapollo7-Dec-12 3:28 
AnswerRe: how to find out the codes who eat up my memory? Pin
Joe Woodbury7-Dec-12 8:30
professionalJoe Woodbury7-Dec-12 8:30 
AnswerRe: how to find out the codes who eat up my memory? Pin
vr9999999998-Dec-12 1:25
vr9999999998-Dec-12 1:25 
AnswerRe: how to find out the codes who eat up my memory? Pin
PecuniousPete11-Dec-12 20:42
PecuniousPete11-Dec-12 20:42 
QuestionImage processing and converter Pin
_Flaviu6-Dec-12 22:12
_Flaviu6-Dec-12 22:12 
QuestionRe: Image processing and converter Pin
Richard MacCutchan6-Dec-12 22:18
mveRichard MacCutchan6-Dec-12 22: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.