Click here to Skip to main content
15,901,283 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How Static variable persists/retains its value.? Pin
Sajeesh Payolam10-Dec-12 16:50
Sajeesh Payolam10-Dec-12 16:50 
GeneralRe: How Static variable persists/retains its value.? Pin
PecuniousPete11-Dec-12 7:18
PecuniousPete11-Dec-12 7:18 
QuestionVC6.0 compiler error C2664 while using GUID Pin
Vaclav_9-Dec-12 5:44
Vaclav_9-Dec-12 5:44 
AnswerRe: VC6.0 compiler error C2664 while using GUID Pin
Richard MacCutchan9-Dec-12 6:02
mveRichard MacCutchan9-Dec-12 6:02 
GeneralRe: VC6.0 compiler error C2664 while using GUID Pin
Vaclav_9-Dec-12 7:14
Vaclav_9-Dec-12 7:14 
GeneralRe: VC6.0 compiler error C2664 while using GUID Pin
jschell9-Dec-12 8:16
jschell9-Dec-12 8:16 
AnswerRe: VC6.0 compiler error C2664 while using GUID Pin
PecuniousPete10-Dec-12 8:00
PecuniousPete10-Dec-12 8:00 
AnswerRe: VC6.0 compiler error C2664 while using GUID Pin
Arild Fiskum19-Dec-12 10:18
Arild Fiskum19-Dec-12 10:18 
QuestionFork Implementation using the native API RtlCloneUserProcess Pin
akhilmv889-Dec-12 4:00
akhilmv889-Dec-12 4:00 
QuestionDeclaring a TBYTE in C. Pin
Member 41945938-Dec-12 15:04
Member 41945938-Dec-12 15:04 
AnswerRe: Declaring a TBYTE in C. Pin
manoranjan8-Dec-12 20:56
manoranjan8-Dec-12 20:56 
GeneralRe: Declaring a TBYTE in C. Pin
Member 41945939-Dec-12 3:29
Member 41945939-Dec-12 3:29 
GeneralRe: Declaring a TBYTE in C. Pin
manoranjan9-Dec-12 23:47
manoranjan9-Dec-12 23:47 
GeneralRe: Declaring a TBYTE in C. Pin
Member 419459310-Dec-12 12:11
Member 419459310-Dec-12 12:11 
GeneralRe: Declaring a TBYTE in C. Pin
manoranjan11-Dec-12 1:35
manoranjan11-Dec-12 1:35 
QuestionMethods bank account Pin
Magda63477-Dec-12 10:17
Magda63477-Dec-12 10:17 
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 

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.