Click here to Skip to main content
15,923,689 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Registering dll after install Pin
ThatsAlok14-Nov-04 22:11
ThatsAlok14-Nov-04 22:11 
GeneralRe: Registering dll after install Pin
Florin Ochiana14-Nov-04 23:13
Florin Ochiana14-Nov-04 23:13 
GeneralRe: Registering dll after install Pin
ThatsAlok14-Nov-04 23:36
ThatsAlok14-Nov-04 23:36 
GeneralRe: Registering dll after install Pin
Florin Ochiana15-Nov-04 2:10
Florin Ochiana15-Nov-04 2:10 
GeneralRe: Registering dll after install Pin
ThatsAlok15-Nov-04 3:13
ThatsAlok15-Nov-04 3:13 
GeneralRe: How to use Chars in a CString ? Pin
Master^Tristar14-Nov-04 20:47
Master^Tristar14-Nov-04 20:47 
Generalhi.... Pin
namaskaaram14-Nov-04 19:18
namaskaaram14-Nov-04 19:18 
Generalhelp plz!!!! Pin
namaskaaram14-Nov-04 19:13
namaskaaram14-Nov-04 19:13 
plz help!!!!!Cry | :((

HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR1 );
SetCursor( hIcon );
return TRUE; 

is a working code coz i have put this in my Dialog based application (Xyz) in a class called CXyzDlg..... that is, i have already added this function "OnSetCursor()".....and the cursor changes......in the main Dlg box but..... i have derived a class from the CStatic Class named it as "CMyClass".....and i have created obcts of it in the CXyzDlg class.....basically these objects i have created by placing the "static control" on the dialog box and then..... thru the class wizard created an object linking it with the picture control of type CMyClass(that is .....SUBCLASSING).....
also in thiz CMyClass i have added the "OnSetCursor()" function as well......and many other mouse functions like "onmousemove()","LbuttonDown()".....etc.....but here when i put in the same code as i had put in the main Dlg box for the "OnsetCursor()".....it does not change!!!!!......y???


heres the code......that i have put in the derived class CMyClass......

// MyClass.cpp : implementation file
//

#include "stdafx.h"
#include "creamz.h"
#include "MyClass.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMyStaticpot1

CMyClass::CMyClass()
{
m_DragOn1=FALSE;
m_pot1=0;
m_update=TRUE;
//AfxMessageBox("constructor activated");
}

CMyClass::~CMyClass()
{
}


BEGIN_MESSAGE_MAP(CMyClass, CStatic)
//{{AFX_MSG_MAP(CMyStaticpot1)
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_MOUSEMOVE()
ON_WM_SETCURSOR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyClass message handlers

void CMyClass::OnLButtonDown(UINT nFlags, CPoint point) 
{
// TODO: Add your message handler code here and/or call default

HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR2 );
SetCursor( hIcon );
m_DragOn1=TRUE;


CStatic::OnLButtonDown(nFlags, point);
}

void CMyClass::OnLButtonUp(UINT nFlags, CPoint point) 
{
// TODO: Add your message handler code here and/or call default
//AfxMessageBox("click up");

HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR1 );
SetCursor( hIcon );
m_DragOn1=FALSE;


CStatic::OnLButtonUp(nFlags, point);
}

void CMyClass::onmousemove(UINT nFlags, CPoint point) 
{
// TODO: Add your message handler code here and/or call default

//AfxMessageBox("move");

if(m_DragOn1==TRUE)
{

if(m_pot1<62)
m_pot1+=1;
else
m_pot1=0;

//AfxMessageBox("dragging");
// Invalidate();
if(m_pot1%2==0)
m_update=TRUE;

}//end of if(m_DragOn==TRUE)




CStatic::onmousemove(nFlags, point);
}

BOOL CMyClass::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) 
{
// TODO: Add your message handler code here and/or call default

if(m_DragOn1==FALSE)
{

//AfxMessageBox("CURSOR SET");

HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR1 );
SetCursor( hIcon );
}
else
{
HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR2 );
SetCursor( hIcon );
} 


return TRUE;


// return CStatic::OnSetCursor(pWnd, nHitTest, message);
}


plz help me out......
thanx in advance.....and thanx for ur intrest!!!!!
GeneralCheckbox Pin
picasso214-Nov-04 18:28
picasso214-Nov-04 18:28 
GeneralRe: Checkbox Pin
namaskaaram14-Nov-04 18:43
namaskaaram14-Nov-04 18:43 
GeneralRe: Checkbox Pin
pubududilena14-Nov-04 18:45
pubududilena14-Nov-04 18:45 
GeneralRe: Checkbox Pin
ThatsAlok14-Nov-04 18:45
ThatsAlok14-Nov-04 18:45 
QuestionHow to get Driver Names of the hardisk using C++ ? Pin
pubududilena14-Nov-04 17:51
pubududilena14-Nov-04 17:51 
AnswerRe: How to get Driver Names of the hardisk using C++ ? Pin
ThatsAlok14-Nov-04 18:25
ThatsAlok14-Nov-04 18:25 
GeneralRe: How to get Driver Names of the hardisk using C++ ? Pin
pubududilena14-Nov-04 18:32
pubududilena14-Nov-04 18:32 
GeneralRe: How to get Driver Names of the hardisk using C++ ? Pin
ThatsAlok14-Nov-04 18:41
ThatsAlok14-Nov-04 18:41 
GeneralRe: How to get Driver Names of the hardisk using C++ ? Pin
Eyal Kaplan15-Nov-04 7:04
Eyal Kaplan15-Nov-04 7:04 
GeneralError: _CrtIsValidHeapPointer(pUserData) Pin
suninwater14-Nov-04 17:45
suninwater14-Nov-04 17:45 
GeneralLAN Pin
don7cry14-Nov-04 16:01
don7cry14-Nov-04 16:01 
GeneralRe: LAN Pin
Ryan Binns14-Nov-04 17:27
Ryan Binns14-Nov-04 17:27 
GeneralRe: LAN Pin
don7cry14-Nov-04 20:37
don7cry14-Nov-04 20:37 
GeneralRe: LAN Pin
Antony M Kancidrowski15-Nov-04 0:17
Antony M Kancidrowski15-Nov-04 0:17 
GeneralRe: LAN Pin
Anonymous15-Nov-04 1:03
Anonymous15-Nov-04 1:03 
GeneralRe: LAN Pin
Anonymous15-Nov-04 1:10
Anonymous15-Nov-04 1:10 
QuestionHow to detect the audio device is recoding? Pin
ErisonWu14-Nov-04 14:04
ErisonWu14-Nov-04 14:04 

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.