Click here to Skip to main content
15,909,822 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Filling the Clipboard using the CDC Pin
Maximilien19-May-04 4:36
Maximilien19-May-04 4:36 
GeneralRe: Filling the Clipboard using the CDC Pin
Cedar Sith19-May-04 5:07
Cedar Sith19-May-04 5:07 
GeneralRe: Filling the Clipboard using the CDC Pin
Maximilien19-May-04 5:23
Maximilien19-May-04 5:23 
GeneralRe: Filling the Clipboard using the CDC Pin
John R. Shaw19-May-04 12:46
John R. Shaw19-May-04 12:46 
GeneralGlobal Variables Pin
asv19-May-04 2:32
asv19-May-04 2:32 
GeneralRe: Global Variables Pin
valikac19-May-04 5:09
valikac19-May-04 5:09 
GeneralRe: Global Variables Pin
asv19-May-04 6:26
asv19-May-04 6:26 
GeneralRe: Global Variables Pin
Andrew Quinn AUS19-May-04 6:06
Andrew Quinn AUS19-May-04 6:06 
Hi,

You cannot cast AfxGetApp() to CMyListView! AfxGetApp() returns a pointer to your main CWinApp.

If you want to get a pointer to your ListView, then try:

CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
if (pFrame && pFrame->GetSafeHwnd())
{
   // Get the active MDI child window.
   CMDIChildWnd* pChild = (CMDIChildWnd *)pFrame->GetActiveFrame();
   if (pChild && pChild->GetSafeHwnd())
   {
      // Get the active view attached to the active MDI child window.
      CMyView* pView = (CMyView*)pChild->GetActiveView();
   }
}


Assuming that it is the current view...

If you have any questions, I'd be happy to help,
Andy
GeneralRe: Global Variables Pin
asv19-May-04 6:36
asv19-May-04 6:36 
GeneralRe: Global Variables Pin
Andrew Quinn AUS19-May-04 6:52
Andrew Quinn AUS19-May-04 6:52 
GeneralRe: Global Variables Pin
asv19-May-04 21:56
asv19-May-04 21:56 
GeneralOutput redirect Pin
no_reg_name19-May-04 2:16
no_reg_name19-May-04 2:16 
GeneralRe: Output redirect Pin
Roger Allen19-May-04 3:55
Roger Allen19-May-04 3:55 
GeneralNon Modal Dialogs Pin
pavneet19-May-04 1:45
pavneet19-May-04 1:45 
GeneralRe: Non Modal Dialogs Pin
Prakash Nadar19-May-04 1:48
Prakash Nadar19-May-04 1:48 
GeneralRe: Non Modal Dialogs Pin
User 665819-May-04 2:48
User 665819-May-04 2:48 
GeneralRe: Non Modal Dialogs Pin
Prakash Nadar19-May-04 7:54
Prakash Nadar19-May-04 7:54 
GeneralRe: Non Modal Dialogs Pin
pavneet20-May-04 0:25
pavneet20-May-04 0:25 
Generalpointer error Pin
Ni@m19-May-04 1:35
Ni@m19-May-04 1:35 
GeneralRe: pointer error Pin
Prakash Nadar19-May-04 1:46
Prakash Nadar19-May-04 1:46 
GeneralRe: pointer error Pin
Dennis Gourjii19-May-04 1:58
Dennis Gourjii19-May-04 1:58 
GeneralRe: pointer error Pin
Tim Smith19-May-04 3:49
Tim Smith19-May-04 3:49 
GeneralRe: pointer error Pin
Dennis Gourjii21-May-04 0:39
Dennis Gourjii21-May-04 0:39 
GeneralRe: pointer error Pin
Cedric Moonen19-May-04 1:51
Cedric Moonen19-May-04 1:51 
GeneralRe: pointer error Pin
valikac19-May-04 5:11
valikac19-May-04 5:11 

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.