Re: document class
On 22 Sep., 01:44, Joseph M. Newcomer <newco...@flounder.com> wrote:
See below...
On Tue, 21 Sep 2010 14:54:57 -0700 (PDT), mfc <mfcp...@googlemail.com> wr=
ote:
On 21 Sep., 23:37, mfc <mfcp...@googlemail.com> wrote:
On 21 Sep., 23:22, Joseph M. Newcomer <newco...@flounder.com> wrote:
OK, but note that you must not use PostThreadMessage to a visible wi=
ndow; it is not
guaranteed to work. RTFM.
However, in this case, the problem is to identify a window to your W=
eb page (the server is
on the other end of the wire).
=
joe
could you explain me your last point (to identify a window)? The
webserver is running on the same side (my mfc project will create this
webpage and send it to a user`s computer).
CMainFrame* pFrame = (CMainFrame*)AfxGetApp()->m_pMainWnd;
is this method valid and ok to use to get the pbulic methods from the
mainframe?
****
But where is this taking place? Giving a line like that, out of contex=
t, is meaningless.
It is necessary to understand where the code is executing, and what threa=
d it is executing
in.
joe
****
In the document class; but then it should also be possible or better
(as you pointed it out) to use AfxGetApp() to access a public method
of the application class from the doc class to access the private
member-variables of these classes (display class, network class -
which includes no mainframe information but application information).
Is it also good practice to install only if it necessary, public
member variables? Or is it also ok in such a case to install public
members in the application class of each additional class (display
class etc.) to access these classes without a additional step
(including a public method in the application class)
class CMIApp : public CWinApp
{
public:
CMIApp();
void CDisplayGetInfoFromDocClass(UINT info1, UINT
info2);
private:
CDisplay m_VarDisp;
};
or without the need of such a function
class CMIApp : public CWinApp
{
public:
CMIApp();
CDisplay m_VarDisp;
private:
CDisplay m_VarDisp;
};
to access the CDisplay (class) directly with the member variable
(m_VarDisp)
best regards
Hans