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
Solved

Problems with local data

Posted on 2000-02-16
3
153 Views
Last Modified: 2013-11-20
I want to create a window, but the window needs data from upper class (CMainFrame). How can I be able to get data from this class outside into my CWnd-OnPaint function ?
0
Comment
Question by:alexott
3 Comments
 
LVL 9

Expert Comment

by:cdesigner
ID: 2529736
set data in you window creation
0
 
LVL 8

Accepted Solution

by:
VinExpert earned 10 total points
ID: 2529744
Hi,

I assume that, u have created the window. and u have the CWnd class for it. Then add a include as
#include "MainFrm.h" to its class

Then say u want to access the data in mainframe which is a string by name m_strData.

Then whenever u want to access the string do

CMainFrame *p_Main = (CMainFrame *)AfxGetMainWnd();
p_Main->m_strData will give u that variable.

Hope this helps.
VinExpert
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2529748
Using a global variable.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Pressing cancel button with C# UI Automation 3 81
how to use laptop or pad camera in vb.net windows application 2 86
x-bar in Google Sheets 2 71
Capture logon name 13 87
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.

828 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