Click here to Skip to main content
15,899,025 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRTTI Question: testing for inheritance Pin
Jonathan Gilligan11-Sep-00 19:04
Jonathan Gilligan11-Sep-00 19:04 
GeneralRe: RTTI Question: testing for inheritance Pin
Erik Funkenbusch13-Sep-00 11:57
Erik Funkenbusch13-Sep-00 11:57 
QuestionHow to use ADO to connect to the database and retrieve the database . Pin
Kalyan Tej M11-Sep-00 18:14
sussKalyan Tej M11-Sep-00 18:14 
AnswerRe: How to use ADO to connect to the database and retrieve the database . Pin
Mike Eriksson12-Sep-00 3:14
Mike Eriksson12-Sep-00 3:14 
Generalcomctl32 Error Pin
Daniel Barcelos11-Sep-00 17:16
sussDaniel Barcelos11-Sep-00 17:16 
GeneralRe: comctl32 Error Pin
Michael Dunn12-Sep-00 8:52
sitebuilderMichael Dunn12-Sep-00 8:52 
GeneralTrying to find VB equivalent controls Pin
Sean Capstick11-Sep-00 16:51
Sean Capstick11-Sep-00 16:51 
GeneralSubclassing Pin
Jamie Nordmeyer11-Sep-00 9:19
Jamie Nordmeyer11-Sep-00 9:19 
What's wrong with the follwing code?
//Header file...
class CSubclassWnd : public CWnd
{
private:
HWND m_hwnd;
BOOL m_bIsSubclassed;
static WNDPROC m_oldWndProc;
public:
CSubclassWnd();
~CSubclassWnd();

BOOL CaptureWindow(HWND hWnd);
void ReleaseWindow();

inline BOOL IsSubclassed(){return m_bIsSubclassed;}

static LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
};

//Implementation file...
CSubclassWnd::CSubclassWnd()
{
m_bIsSubclassed=FALSE;
}

CSubclassWnd::~CSubclassWnd()
{
ReleaseWindow();
}

BOOL CSubclassWnd::CaptureWindow(HWND hWnd)
{
m_oldWndProc=(WNDPROC)::SetWindowLong(hWnd, GWL_WNDPROC, (LONG)WindowProc);
if (m_oldWndProc!=0)
{
m_hwnd=hWnd;
m_bIsSubclassed=TRUE;
return TRUE;
}
return FALSE;
}

void CSubclassWnd::ReleaseWindow()
{
if (m_bIsSubclassed)
{
m_bIsSubclassed=FALSE;
::SetWindowLong(m_hwnd, GWL_WNDPROC, (LONG)m_oldWndProc);
}
}

LRESULT CALLBACK CSubclassWnd::WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if (message==WM_MOVING)
MessageBeep((UINT)-1);

return ::CallWindowProc(m_oldWndProc, hWnd, message, wParam, lParam);
}

When I compile the above, I get the following error:

error LNK2001: unresolved external symbol "private: static long (__stdcall* CSubclassWnd::m_oldWndProc)(struct HWND__ *,unsigned int,unsigned int,long)" (?m_oldWndProc@CSubclassWnd@@0P6GJPAUHWND__@@IIJ@ZA)

Any ideas? Thanks in advance.
GeneralRe: Subclassing Pin
Nick Hodapp11-Sep-00 11:13
sitebuilderNick Hodapp11-Sep-00 11:13 
GeneralRe: Subclassing Pin
Jamie Nordmeyer11-Sep-00 11:22
Jamie Nordmeyer11-Sep-00 11:22 
GeneralRe: Subclassing Pin
Nick Hodapp11-Sep-00 11:29
sitebuilderNick Hodapp11-Sep-00 11:29 
GeneralRe: Subclassing Pin
Sam Hobbs11-Sep-00 17:34
Sam Hobbs11-Sep-00 17:34 
GeneralRe: Subclassing Pin
Jamie Nordmeyer12-Sep-00 4:54
Jamie Nordmeyer12-Sep-00 4:54 
GeneralRe: Subclassing Pin
Sam Hobbs12-Sep-00 5:38
Sam Hobbs12-Sep-00 5:38 
GeneralToolbar and Dialog Pin
Henrik Pedersen11-Sep-00 4:10
Henrik Pedersen11-Sep-00 4:10 
GeneralCFtpConnection - host type Pin
Alex Chaikin11-Sep-00 4:02
sussAlex Chaikin11-Sep-00 4:02 
GeneralRe: CFtpConnection - host type Pin
Member 120896511-Sep-00 9:47
Member 120896511-Sep-00 9:47 
GeneralRe: CFtpConnection - host type Pin
Member 120896512-Sep-00 4:33
Member 120896512-Sep-00 4:33 
Questionhow to unrar archives ? Pin
Androme11-Sep-00 3:42
Androme11-Sep-00 3:42 
AnswerRe: how to unrar archives ? Pin
m29-Sep-00 6:48
m29-Sep-00 6:48 
GeneralWebBrowser control doesn't work on 98 Pin
Parvesh Sharma13-Sep-00 6:42
Parvesh Sharma13-Sep-00 6:42 
GeneralMultiple Threads Pin
Andrew12-Sep-00 0:57
Andrew12-Sep-00 0:57 
GeneralRe: Multiple Threads Pin
Nick Hodapp12-Sep-00 11:14
sitebuilderNick Hodapp12-Sep-00 11:14 
GeneralHOOKs again and again Pin
Mustafa Demirhan11-Sep-00 2:53
Mustafa Demirhan11-Sep-00 2:53 
GeneralRe: HOOKs again and again Pin
Feng Yuan www.fengyuan.com12-Sep-00 8:32
sussFeng Yuan www.fengyuan.com12-Sep-00 8:32 

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.