Click here to Skip to main content
15,889,909 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
JokeRe: Indeed... Pin
Matthew Faithfull21-Dec-07 3:04
Matthew Faithfull21-Dec-07 3:04 
GeneralRe: Indeed... Pin
CPallini21-Dec-07 3:15
mveCPallini21-Dec-07 3:15 
GeneralRe: Extra bytes between struct elements spoiling match between structs and binary file formats: cure found Pin
Mark Salsbery21-Dec-07 8:14
Mark Salsbery21-Dec-07 8:14 
Questionis such exception handling approach good? Pin
George_George21-Dec-07 1:42
George_George21-Dec-07 1:42 
AnswerRe: is such exception handling approach good? Pin
Matthew Faithfull21-Dec-07 2:05
Matthew Faithfull21-Dec-07 2:05 
QuestionThread using COleDispatchDriver always causes exception on second execution Pin
Streifenhoernchen21-Dec-07 1:42
Streifenhoernchen21-Dec-07 1:42 
GeneralRe: Thread using COleDispatchDriver always causes exception on second execution Pin
Nathan Holt at EMOM21-Dec-07 7:43
Nathan Holt at EMOM21-Dec-07 7:43 
GeneralSubclassing (using MFC) a wndow under explorer process Pin
Nishad S21-Dec-07 1:38
Nishad S21-Dec-07 1:38 
Hi,

Isn't it possible to subclass a window in the explorer process, using CWnd::SubclassWindow() ?

My intention is to skin the systray clock.

What I did:

1. Created a MFC dll.
2. Injected it to the explorer process using "CreateRemoteThread - LoadLibrary" technique.
3. Took the window handle of systray clock in the dll's InitInstance.
4. Replaced the window proc using SetWindowLong.

These were successful, and in the replaced proc, I could do the custom draw by processing WM_PAINT.

The problem:

I derived a class from CWnd, say CMyClock. And subclassed the systray clock window with CMyClock object (member) instead of proc replacement. Now the explorer crashes.

I tried to debug the explorer process.

I found that subclassing is fine, and InitInstance completed successfully. After a very little time it crashed and the call stack was as follows...

	ntdll.dll!7c901230() 	
>	msvcr71d.dll!_CrtDbgBreak()  Line 93	C
 	msvcr71d.dll!_CrtDbgReport(int nRptType=2, const char * szFile=0x01b44c68, int nLine=384, const char * szModule=0x00000000, const char * szFormat=0x00000000, ...)  Line 427	C
 	mfc71d.dll!AfxAssertFailedLine(const char * lpszFileName=0x01b44c68, int nLine=384)  Line 28 + 0x14	C++
 	mfc71d.dll!AfxWndProc(HWND__ * hWnd=0x000f01c8, unsigned int nMsg=15, unsigned int wParam=0, long lParam=0)  Line 384 + 0x15	C++
 	MyClockDll.dll!AfxWndProcDllStatic(HWND__ * hWnd=0x000f01c8, unsigned int nMsg=15, unsigned int wParam=0, long lParam=0)  Line 53 + 0x15	C++
 	user32.dll!7e418734() 	
 	user32.dll!7e418816() 	
 	user32.dll!7e41b4c0() 	
 	user32.dll!7e41b50c() 	
 	ntdll.dll!7c90eae3() 	
 	user32.dll!7e4194d2() 	
 	user32.dll!7e41b530() 	
 	user32.dll!7e42d950() 	
 	user32.dll!7e418a10() 	
 	user32.dll!7e42dbbf() 	
 	user32.dll!7e42593f() 	
 	user32.dll!7e43a91e() 	

What could be wrong? Any suggestions or ideas?

Thanks in advance.
- NS -
[ODBaseBtn]

QuestionReference are always lvalue? Pin
George_George21-Dec-07 1:11
George_George21-Dec-07 1:11 
AnswerRe: Reference are always lvalue? Pin
Budric B.21-Dec-07 5:09
Budric B.21-Dec-07 5:09 
GeneralRe: Reference are always lvalue? Pin
George_George21-Dec-07 19:16
George_George21-Dec-07 19:16 
Questionhow to get the number of lines shown in editbox Pin
rajneshmalik21-Dec-07 1:06
rajneshmalik21-Dec-07 1:06 
AnswerRe: how to get the number of lines shown in editbox Pin
CPallini21-Dec-07 3:05
mveCPallini21-Dec-07 3:05 
GeneralDatashowing problem want to get rid of from if-else statement Pin
Y_Kaushik20-Dec-07 23:53
Y_Kaushik20-Dec-07 23:53 
GeneralRe: Datashowing problem want to get rid of from if-else statement Pin
Hamid_RT21-Dec-07 0:02
Hamid_RT21-Dec-07 0:02 
GeneralRe: Datashowing problem want to get rid of from if-else statement Pin
Cedric Moonen21-Dec-07 0:13
Cedric Moonen21-Dec-07 0:13 
GeneralRe: Datashowing problem want to get rid of from if-else statement Pin
Cedric Moonen21-Dec-07 0:11
Cedric Moonen21-Dec-07 0:11 
GeneralRe: Datashowing problem want to get rid of from if-else statement Pin
Matthew Faithfull21-Dec-07 0:11
Matthew Faithfull21-Dec-07 0:11 
GeneralRe: Datashowing problem want to get rid of from if-else statement Pin
Y_Kaushik21-Dec-07 19:08
Y_Kaushik21-Dec-07 19:08 
GeneralDynamically providing version information to a exe Pin
neha.agarwal2720-Dec-07 22:50
neha.agarwal2720-Dec-07 22:50 
GeneralRe: Dynamically providing version information to a exe Pin
jhwurmbach20-Dec-07 23:08
jhwurmbach20-Dec-07 23:08 
GeneralRe: Dynamically providing version information to a exe Pin
Chris Losinger21-Dec-07 5:45
professionalChris Losinger21-Dec-07 5:45 
GeneralChecking the camera is connecte or not Pin
Deepu Antony20-Dec-07 22:26
Deepu Antony20-Dec-07 22:26 
General"imapi.h" file missing - SDK version Pin
palanirajan20-Dec-07 22:04
palanirajan20-Dec-07 22:04 
GeneralRe: "imapi.h" file missing - SDK version Pin
ashishbhatt20-Dec-07 22:12
ashishbhatt20-Dec-07 22:12 

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.