[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

AfxGetMainWnd() function in VisualStudio 8

Posted on 2006-07-13
2
Medium Priority
?
457 Views
Last Modified: 2013-11-20
Hi Experts,

I have to port our sourcecode from Visual Studio 6 to Visual Studio 8 (2005).

In the existing code quite at the beginning of the program the function OnNewDocument() is called.
Calls made there to  AfxGetMainWnd()  return NULL in Visual Studio 8 while they return useful values when the same sourcecode is compiled with Visual Studio 6.


At that point there is still no window drawn
0
Comment
Question by:PYTHALAB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
snyp earned 500 total points
ID: 17187039
create a pointer to the CMainFrame object and use that pointer instead of what AfxGetMainWnd() is returning. the CMainFrame object remains constant throughout the lifetime of the application's runtime, so there's no reason to call AfxGetMainWnd() to return it for you when it's there already.
0
 
LVL 1

Author Comment

by:PYTHALAB
ID: 17200895
Thank you very much !!!
This works and helped me now a lot.
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question