Click here to Skip to main content
13,289,626 members (57,654 online)

C / C++ / MFC

 
QuestionVC6.0 compiler error C2664 while using GUID Pin
Vaclav_Sal9-Dec-12 6:44
memberVaclav_Sal9-Dec-12 6:44 
AnswerRe: VC6.0 compiler error C2664 while using GUID Pin
Richard MacCutchan9-Dec-12 7:02
mvpRichard MacCutchan9-Dec-12 7:02 
GeneralRe: VC6.0 compiler error C2664 while using GUID Pin
Vaclav_Sal9-Dec-12 8:14
memberVaclav_Sal9-Dec-12 8:14 
GeneralRe: VC6.0 compiler error C2664 while using GUID Pin
jschell9-Dec-12 9:16
memberjschell9-Dec-12 9:16 
AnswerRe: VC6.0 compiler error C2664 while using GUID Pin
PecuniousPete10-Dec-12 9:00
memberPecuniousPete10-Dec-12 9:00 
AnswerRe: VC6.0 compiler error C2664 while using GUID Pin
Arild Fiskum19-Dec-12 11:18
memberArild Fiskum19-Dec-12 11:18 
QuestionFork Implementation using the native API RtlCloneUserProcess Pin
akhilmv889-Dec-12 5:00
memberakhilmv889-Dec-12 5:00 
QuestionDeclaring a TBYTE in C. Pin
Member 41945938-Dec-12 16:04
memberMember 41945938-Dec-12 16:04 
AnswerRe: Declaring a TBYTE in C. Pin
manoranjan8-Dec-12 21:56
membermanoranjan8-Dec-12 21:56 
GeneralRe: Declaring a TBYTE in C. Pin
Member 41945939-Dec-12 4:29
memberMember 41945939-Dec-12 4:29 
GeneralRe: Declaring a TBYTE in C. Pin
manoranjan10-Dec-12 0:47
membermanoranjan10-Dec-12 0:47 
GeneralRe: Declaring a TBYTE in C. Pin
Member 419459310-Dec-12 13:11
memberMember 419459310-Dec-12 13:11 
GeneralRe: Declaring a TBYTE in C. Pin
manoranjan11-Dec-12 2:35
membermanoranjan11-Dec-12 2:35 
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 
AnswerRe: Image processing and converter Pin
Flaviu26-Dec-12 23:26
memberFlaviu26-Dec-12 23:26 
GeneralRe: Image processing and converter Pin
Richard MacCutchan7-Dec-12 0:32
mvpRichard MacCutchan7-Dec-12 0:32 
GeneralRe: Image processing and converter Pin
Flaviu27-Dec-12 2:00
memberFlaviu27-Dec-12 2:00 
GeneralRe: Image processing and converter Pin
Richard MacCutchan7-Dec-12 2:11
mvpRichard MacCutchan7-Dec-12 2:11 
GeneralRe: Image processing and converter Pin
Flaviu27-Dec-12 2:44
memberFlaviu27-Dec-12 2:44 
GeneralRe: Image processing and converter Pin
Chris Losinger10-Dec-12 9:05
memberChris Losinger10-Dec-12 9:05 
AnswerRe: Image processing and converter Pin
Joe Woodbury7-Dec-12 9:39
memberJoe Woodbury7-Dec-12 9:39 
QuestionUniversal Patch Finder Native Plug-ins Pin
droopy66-Dec-12 21:41
memberdroopy66-Dec-12 21:41 
AnswerRe: Universal Patch Finder Native Plug-ins Pin
Richard MacCutchan6-Dec-12 23:16
mvpRichard MacCutchan6-Dec-12 23:16 
QuestionHow to detect window event : Log on, log off, standby... Pin
vunhutien6-Dec-12 17:27
membervunhutien6-Dec-12 17:27 
AnswerRe: How to detect window event : Log on, log off, standby... Pin
Richard MacCutchan6-Dec-12 23:14
mvpRichard MacCutchan6-Dec-12 23:14 
Question_ApplicationPtr definition in OLE program Pin
ForNow6-Dec-12 14:30
memberForNow6-Dec-12 14:30 
AnswerRe: _ApplicationPtr definition in OLE program Pin
Peter_in_27806-Dec-12 16:18
memberPeter_in_27806-Dec-12 16:18 
GeneralRe: _ApplicationPtr definition in OLE program Pin
ForNow6-Dec-12 17:00
memberForNow6-Dec-12 17:00 
GeneralRe: _ApplicationPtr definition in OLE program Pin
Richard MacCutchan6-Dec-12 23:11
mvpRichard MacCutchan6-Dec-12 23:11 
Questionsession description protocol Pin
mani2516195-Dec-12 19:33
membermani2516195-Dec-12 19:33 
AnswerRe: session description protocol Pin
Richard MacCutchan5-Dec-12 22:26
mvpRichard MacCutchan5-Dec-12 22:26 
QuestionRe: session description protocol Pin
DavidCrow6-Dec-12 3:50
memberDavidCrow6-Dec-12 3:50 
AnswerRe: session description protocol Pin
jeron16-Dec-12 5:03
memberjeron16-Dec-12 5:03 

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 |
Web04 | 2.8.171207.1 | Last Updated 12 Dec 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid