Click here to Skip to main content
13,093,097 members (70,238 online)

C / C++ / MFC

 
AnswerRe: FileSystemWatcher Class in Visual C++ 6.0 Pin
Chris Losinger3-Jan-13 7:42
memberChris Losinger3-Jan-13 7:42 
Questionwriting a plug in for internet browsers Pin
muharrem2-Jan-13 1:28
membermuharrem2-Jan-13 1:28 
AnswerRe: writing a plug in for internet browsers Pin
Richard MacCutchan2-Jan-13 1:33
mvpRichard MacCutchan2-Jan-13 1:33 
GeneralRe: writing a plug in for internet browsers Pin
muharrem2-Jan-13 2:07
membermuharrem2-Jan-13 2:07 
GeneralRe: writing a plug in for internet browsers Pin
Richard MacCutchan2-Jan-13 4:20
mvpRichard MacCutchan2-Jan-13 4:20 
QuestionEmpty String Pin
john563230-Dec-12 20:27
memberjohn563230-Dec-12 20:27 
AnswerRe: Empty String Pin
Richard MacCutchan30-Dec-12 22:22
mvpRichard MacCutchan30-Dec-12 22:22 
AnswerRe: Empty String Pin
Chris Meech31-Dec-12 1:57
memberChris Meech31-Dec-12 1:57 
AnswerRe: Empty String Pin
DavidCrow31-Dec-12 5:25
memberDavidCrow31-Dec-12 5:25 
AnswerRe: Empty String Pin
manem21k2-Jan-13 1:26
membermanem21k2-Jan-13 1:26 
GeneralRe: Empty String Pin
jeron12-Jan-13 4:21
memberjeron12-Jan-13 4:21 
GeneralRe: Empty String Pin
manem21k2-Jan-13 22:32
membermanem21k2-Jan-13 22:32 
QuestionRe: Empty String Pin
CPallini2-Jan-13 10:09
mvpCPallini2-Jan-13 10:09 
QuestionCasting structures - another basic question Pin
Vaclav_Sal24-Dec-12 4:38
memberVaclav_Sal24-Dec-12 4:38 
Sorry, fat fingers, it just got posted before I fixed the formating!


<pre lang="text">

Could someone please explain this or give me some reference?

I am processing WM_DEVICECHANGE and trying to get info on the USB device (LittleWire ). I think I got the basic figured out, but do not quite get the casting from from wParam to device "dbcc_name".

From PDEV_BROADCAST_HDR to PDEV_BROADCAST_DEVICEINTERFACE.

How does C++ compiler does this since the structures definitions are not same?



</pre>




<small></small> if ( DBT_DEVICEARRIVAL == wParam || DBT_DEVICEREMOVECOMPLETE == wParam ) {
// cast to generic structure
PDEV_BROADCAST_HDR pHdr = (PDEV_BROADCAST_HDR)lParam;

// define specific device type structures
PDEV_BROADCAST_DEVICEINTERFACE pDevInf;

PDEV_BROADCAST_HANDLE pDevHnd;
PDEV_BROADCAST_OEM pDevOem;
PDEV_BROADCAST_PORT pDevPort;
PDEV_BROADCAST_VOLUME pDevVolume;



// analyze specific device type
switch( pHdr->dbch_devicetype ) {
case DBT_DEVTYP_DEVICEINTERFACE:
{
// cast to DBT_DEVTYP_DEVICEINTERFACE
pDevInf = (PDEV_BROADCAST_DEVICEINTERFACE)pHdr;
CString strName = pDevInf->dbcc_name;
//CString strGuid = pDevInf->dbcc_classguid;
TRACE("\nDEvice full name %s", strName);
//TRACE("\nDEvicre full guid %s", strGuid);
AnswerRe: Casting structures - another basic question Pin
Richard MacCutchan24-Dec-12 5:19
mvpRichard MacCutchan24-Dec-12 5:19 
GeneralSOLVED Casting structures - another basic question Pin
Vaclav_Sal24-Dec-12 8:04
memberVaclav_Sal24-Dec-12 8:04 
GeneralRe: SOLVED Casting structures - another basic question Pin
Erudite_Eric2-Jan-13 7:13
memberErudite_Eric2-Jan-13 7:13 
QuestionLinked List Via Disk File Pin
imboared117-Dec-12 19:01
memberimboared117-Dec-12 19:01 
SuggestionRe: Linked List Via Disk File Pin
Richard MacCutchan17-Dec-12 22:15
mvpRichard MacCutchan17-Dec-12 22:15 
Questionwhat is the purpose of & in constructors Pin
alaaan7315-Dec-12 7:49
memberalaaan7315-Dec-12 7:49 
AnswerRe: what is the purpose of & in constructors Pin
Maximilien15-Dec-12 14:29
memberMaximilien15-Dec-12 14:29 
GeneralRe: what is the purpose of & in constructors Pin
alaaan7318-Dec-12 4:43
memberalaaan7318-Dec-12 4:43 
AnswerRe: what is the purpose of & in constructors Pin
Erudite_Eric16-Dec-12 21:43
memberErudite_Eric16-Dec-12 21:43 
GeneralRe: what is the purpose of & in constructors Pin
alaaan7318-Dec-12 4:43
memberalaaan7318-Dec-12 4:43 
AnswerRe: what is the purpose of & in constructors Pin
CPallini16-Dec-12 22:42
mvpCPallini16-Dec-12 22:42 
GeneralRe: what is the purpose of & in constructors Pin
alaaan7318-Dec-12 4:42
memberalaaan7318-Dec-12 4:42 
AnswerRe: what is the purpose of & in constructors Pin
sajeesh.c17-Dec-12 4:33
membersajeesh.c17-Dec-12 4:33 
GeneralRe: what is the purpose of & in constructors Pin
alaaan7318-Dec-12 4:42
memberalaaan7318-Dec-12 4:42 
AnswerRe: what is the purpose of & in constructors Pin
April Fans22-Dec-12 20:32
memberApril Fans22-Dec-12 20:32 
Questionerror LNK2019: unresolved external symbol "public: SOLVED Pin
alaaan7314-Dec-12 0:24
memberalaaan7314-Dec-12 0:24 
AnswerRe: error LNK2019: unresolved external symbol "public: Pin
Jochen Arndt14-Dec-12 0:38
memberJochen Arndt14-Dec-12 0:38 
GeneralRe: error LNK2019: unresolved external symbol "public: Pin
alaaan7314-Dec-12 0:49
memberalaaan7314-Dec-12 0:49 
AnswerRe: error LNK2019: unresolved external symbol "public: Pin
Graham Breach14-Dec-12 0:40
memberGraham Breach14-Dec-12 0:40 
GeneralRe: error LNK2019: unresolved external symbol "public: Pin
alaaan7314-Dec-12 0:50
memberalaaan7314-Dec-12 0:50 
Questionerror C2065: 'xlSheetVisible' undeclared Pin
ForNow11-Dec-12 10:18
memberForNow11-Dec-12 10:18 
QuestionRe: error C2065: 'xlSheetVisible' undeclared Pin
Richard MacCutchan11-Dec-12 11:12
mvpRichard MacCutchan11-Dec-12 11:12 
AnswerRe: error C2065: 'xlSheetVisible' undeclared Pin
ForNow11-Dec-12 11:19
memberForNow11-Dec-12 11:19 
GeneralRe: error C2065: 'xlSheetVisible' undeclared Pin
Richard MacCutchan11-Dec-12 11:25
mvpRichard MacCutchan11-Dec-12 11:25 
GeneralRe: error C2065: 'xlSheetVisible' undeclared Pin
ForNow11-Dec-12 11:41
memberForNow11-Dec-12 11:41 
GeneralRe: error C2065: 'xlSheetVisible' undeclared Pin
Richard MacCutchan11-Dec-12 11:48
mvpRichard MacCutchan11-Dec-12 11:48 
QuestionCMFCPropertyGridProperty - Protected methods don't get called Pin
Simon Langdon10-Dec-12 1:08
memberSimon Langdon10-Dec-12 1:08 
QuestionHow Static variable persists/retains its value.? Pin
mbatra319-Dec-12 19:53
membermbatra319-Dec-12 19:53 
AnswerRe: How Static variable persists/retains its value.? Pin
PecuniousPete9-Dec-12 20:20
memberPecuniousPete9-Dec-12 20:20 
AnswerRe: How Static variable persists/retains its value.? Pin
sajeesh.c9-Dec-12 20:25
membersajeesh.c9-Dec-12 20:25 
GeneralRe: How Static variable persists/retains its value.? Pin
PecuniousPete10-Dec-12 7:58
memberPecuniousPete10-Dec-12 7:58 
GeneralRe: How Static variable persists/retains its value.? Pin
sajeesh.c10-Dec-12 16:50
membersajeesh.c10-Dec-12 16:50 
GeneralRe: How Static variable persists/retains its value.? Pin
PecuniousPete11-Dec-12 7:18
memberPecuniousPete11-Dec-12 7:18 
QuestionVC6.0 compiler error C2664 while using GUID Pin
Vaclav_Sal9-Dec-12 5:44
memberVaclav_Sal9-Dec-12 5:44 
AnswerRe: VC6.0 compiler error C2664 while using GUID Pin
Richard MacCutchan9-Dec-12 6:02
mvpRichard MacCutchan9-Dec-12 6:02 
GeneralRe: VC6.0 compiler error C2664 while using GUID Pin
Vaclav_Sal9-Dec-12 7:14
memberVaclav_Sal9-Dec-12 7:14 

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 |
Web03 | 2.8.170813.1 | Last Updated 21 Aug 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid