"blimeyoreilly" <mark_s_howie@hotmail.com> wrote in message
news:1117108430.493286.117610@g49g2000cwa.googlegr oups.com...[color=blue]
> Hi
> I've a small problem .. can anyone figure it out?
>
> I am working in VS.NET in C++ with MFC. I have a CWinApp-based class
> called CTestHarnessApp. I keep getting the 'differs in levels of
> indirection from' error whenever I compile this:[/color]
MFC is not C++. Ask a relevent newsgroup for that proprietary language. Code
that only runs in Windows is off-topic here.
[color=blue]
>
> CTestHarnessApp theApp;
> //CTestHarnessApp* pTheApp = &theApp;
> CTestHarnessApp* pTheApp;
> pTheApp = &theApp;
>
> (missing storage-class or type specifiers)
> ('int' differs in levels of indirection from 'CTestHarnessApp *')
> ('initializing' : cannot convert from 'CTestHarnessApp *__w64 ' to
> 'int' This conversion requires a reinterpret_cast, a C-style cast or
> function-style cast)[/color]
Isn't this expected and documented with MFC? Try...
CWnd * p = theApp.m_pMainWnd; // if decade old memrory cells still work
Last but not least, consider switching from MFC to WTL if you are going to
do only Windows. Unfortunately for MS, WTL is not documented which in my
humble opinion is a strategic blunder of infinite proportions. A very big
boo-boo. It outdoes MFC so much so in every respect that the small community
that supports WTL have finally convinced MS to release it as open-source
(unfortunately, MS's ATL is still required to run it which means that you
still have to have VC). Some organisations never learn. What a shame.
http://sourceforge.net/projects/wtl/ http://www.codeproject.com/wtl/
Actually, here is an even better proposal, take a look at wxwindows, a cross
platform GUI that is MFC-like which is quickly growing in popularity (you
can't compete with open source):
http://www.wxwindows.org/
[color=blue]
>
>
> But everything is okay when I compile this:
>
> CTestHarnessApp theApp;
> CTestHarnessApp* pTheApp = &theApp;
> //CTestHarnessApp* pTheApp;
> //pTheApp = &theApp;
>
>
> Me no understand!!!
> BOR
>[/color]