I'm doing a application using MFC.
My problem is when I call OpenClipboard the program crashes because the member m_hWnd of class CWnd is not valid.
I tried gave a HWND handle for it , because you have direct access to that member, but dosen't work either, i gave the HWND of my child window, the crash stop but my child window closes.
Anyone knows something?
Why is the m_hWnd member not valid? Does your CWnd class represent a created window?
You can always just open the clipboard with the win32 function. Pass NULL as the parameter, so the clipboard is associated with your current task.
I dont know why is invalid =(
The strange thing is that in another function of the same class dont crash, the only difference is that this class is a afx msg function.
I cant use the standard GetForegroundWindow, the compiler dont allow me.
Thanks for attention =)
Why? What does it output, which error?
Originally Posted by gadu