Click here to Skip to main content
15,921,179 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Elegant solution for alignment Pin
James Brown7-Oct-06 7:04
James Brown7-Oct-06 7:04 
QuestionDebugger - Visualizer (VS2005) [modified] Pin
Abyss6-Oct-06 6:33
Abyss6-Oct-06 6:33 
QuestionChange color of dialog border Pin
vasmvr6-Oct-06 6:13
vasmvr6-Oct-06 6:13 
AnswerRe: Change color of dialog border Pin
Hamid_RT19-Oct-06 8:39
Hamid_RT19-Oct-06 8:39 
QuestionUninstall VS2003 SP1? Pin
Todd Smith6-Oct-06 5:52
Todd Smith6-Oct-06 5:52 
AnswerRe: Uninstall VS2003 SP1? Pin
David Crow6-Oct-06 6:03
David Crow6-Oct-06 6:03 
GeneralRe: Uninstall VS2003 SP1? Pin
Todd Smith6-Oct-06 6:07
Todd Smith6-Oct-06 6:07 
QuestionRuntime change MDI/SDI Pin
Endaroza6-Oct-06 5:28
Endaroza6-Oct-06 5:28 
Hello everyone!

I have developed an SDI application with MFC, not supporting doc/view, then i made some modification to convert it to MDI, and everything works fine.
Now the weird:
My boss asked to make some trick so that someone could decide in RUNTIME to run the SDI or the MDI version. My first idea was to create 2 classes, CMainFrameSDI->CFrameWnd and CMainFrameMDI->CMDIFrameWnd and instantiate them into the global CApp, taking care to avoid the inizialisations not needed by the MDI and vice versa.
One other thing i did was creating a pure abstract class, CMainFrame, with only methods and only public functions, and deriving both CMainFrameSDI and CMainFrameMDI EVEN from it.
Inside the application the class used is then a pointer to CMainFrame and in case of specific functions it becomes its SDI or MDI version, depending on a flag present in all the three classes.
Everything explode suddenly....Confused | :confused:
I tried to build a sample with all this stuff but everything explode apparently without any cause into the LoadFrame. The only thing that i can notice is at a certain point unexpectedly the m_hWnd member of the SDI/MDI (depending on what started) become null...

I know i am doing bad things... but someone every did something like this just to take some advice on how to do such thing?

If u need i can provide my sample to give it a check

Best regards &cheers to everyone
A bleeding programmer with a big headache!!! Dead | X|

-Yes, i don't write a good english- Smile | :)
Unlukily it's not a Joke... Frown | :(
Hope you'll understand!! Wink | ;)

AnswerRe: Runtime change MDI/SDI Pin
led mike6-Oct-06 5:49
led mike6-Oct-06 5:49 
GeneralRe: Runtime change MDI/SDI Pin
Mark Salsbery6-Oct-06 5:52
Mark Salsbery6-Oct-06 5:52 
AnswerRe: Runtime change MDI/SDI Pin
Mark Salsbery6-Oct-06 6:03
Mark Salsbery6-Oct-06 6:03 
GeneralRe: Runtime change MDI/SDI Pin
led mike6-Oct-06 7:15
led mike6-Oct-06 7:15 
GeneralRe: Runtime change MDI/SDI Pin
Mark Salsbery6-Oct-06 14:47
Mark Salsbery6-Oct-06 14:47 
AnswerRe: Runtime change MDI/SDI Pin
Andre xxxxxxx6-Oct-06 7:23
Andre xxxxxxx6-Oct-06 7:23 
AnswerRe: Runtime change MDI/SDI Pin
PJ Arends6-Oct-06 14:57
professionalPJ Arends6-Oct-06 14:57 
AnswerGOTCHA!!! Pin
Endaroza5-May-07 5:41
Endaroza5-May-07 5:41 
QuestionGetPixel Pin
Johpoke6-Oct-06 5:08
Johpoke6-Oct-06 5:08 
AnswerRe: GetPixel Pin
Mark Salsbery6-Oct-06 5:16
Mark Salsbery6-Oct-06 5:16 
GeneralRe: GetPixel Pin
Johpoke6-Oct-06 5:25
Johpoke6-Oct-06 5:25 
GeneralRe: GetPixel Pin
Mark Salsbery6-Oct-06 5:31
Mark Salsbery6-Oct-06 5:31 
GeneralRe: GetPixel Pin
Hamid_RT6-Oct-06 19:49
Hamid_RT6-Oct-06 19:49 
GeneralRe: GetPixel Pin
Mark Salsbery7-Oct-06 8:44
Mark Salsbery7-Oct-06 8:44 
QuestionProblem understanding image rotation. Pin
Mark F.6-Oct-06 4:39
Mark F.6-Oct-06 4:39 
AnswerRe: Problem understanding image rotation. Pin
Maximilien6-Oct-06 4:46
Maximilien6-Oct-06 4:46 
GeneralRe: Problem understanding image rotation. Pin
Mark F.6-Oct-06 4:48
Mark F.6-Oct-06 4:48 

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.