Click here to Skip to main content
15,913,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow can i Get Hard Drive Modal details? Pin
Le@rner12-Nov-08 21:58
Le@rner12-Nov-08 21:58 
AnswerRe: How can i Get Hard Drive Modal details? Pin
SandipG 12-Nov-08 22:24
SandipG 12-Nov-08 22:24 
AnswerRe: How can i Get Hard Drive Modal details? Pin
_AnsHUMAN_ 12-Nov-08 22:26
_AnsHUMAN_ 12-Nov-08 22:26 
AnswerRe: How can i Get Hard Drive Modal details? [modified] Pin
User 21559712-Nov-08 22:26
User 21559712-Nov-08 22:26 
QuestionHow to get disk's capacitance of remote computer with ip? Pin
ZhiLiangLin12-Nov-08 20:00
ZhiLiangLin12-Nov-08 20:00 
AnswerRe: How to get disk's capacitance of remote computer with ip? [modified] Pin
User 21559712-Nov-08 22:18
User 21559712-Nov-08 22:18 
QuestionRe: How to get disk's capacitance of remote computer with ip? Pin
David Crow13-Nov-08 3:13
David Crow13-Nov-08 3:13 
QuestionOnDragOver/OnDropEx cannot used in CStatic? [modified] Pin
kaviniswell12-Nov-08 19:44
kaviniswell12-Nov-08 19:44 
in my programme,OnDragOver/OnDropEx cannot be executed(can compile), but i dont know why...
the code is:
(thanks!)
--------
A.h
--------
class A: public CStatic
{
    ... ... // other codes

	// Generated message map functions
protected:
	//{{AFX_MSG(CEMap)
	afx_msg void OnPaint();
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	//}}AFX_MSG

	afx_msg	BOOL OnDrop(WPARAM pDropInfoClass, LPARAM lParm);
	afx_msg	DROPEFFECT OnDropEx(WPARAM pDropInfoClass, LPARAM lParm);
	afx_msg	DROPEFFECT OnDragOver(WPARAM pDropInfoClass, LPARAM lParm);

	DECLARE_MESSAGE_MAP()

protected:
    COleDropTargetEx   m_dropEx;
    static WORD s_wNvrChnClipboardFormat;

    ... ... // other codes

}

----
A.cpp
----
WORD A::s_wNvrChnClipboardFormat = 0X0;

BEGIN_MESSAGE_MAP(A, CStatic)
	//{{AFX_MSG_MAP(A)
	ON_WM_PAINT()
	ON_WM_ERASEBKGND()
	ON_WM_SIZE()
	ON_WM_WINDOWPOSCHANGED()
	ON_WM_LBUTTONDOWN()
	ON_WM_LBUTTONDBLCLK()
	ON_WM_MOUSEMOVE()
	ON_WM_LBUTTONUP()
	ON_WM_CREATE()
	//}}AFX_MSG_MAP

	ON_MESSAGE(DROPM_DRAGOVER,OnDragOver)
	ON_MESSAGE(DROPM_DROPEX,OnDropEx)
	ON_MESSAGE(DROPM_DROP,OnDrop)

END_MESSAGE_MAP()

int A::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CStatic::OnCreate(lpCreateStruct) == -1)
		return -1;	
        s_wNvrChnClipboardFormat = RegisterClipboardFormat(NAME_NC_NVRCHN_CLPFMT);	
	BOOL bRet = m_dropEx.Register (this);
	ASSERT(bRet);
	return 0;
}

// OnDragOver cannot be executed 
DROPEFFECT A::OnDragOver(WPARAM pDropInfoClass,LPARAM lParm)
{
	COleDropInfo* pInfo = (COleDropInfo* )pDropInfoClass;
	ASSERT(pInfo->IsKindOf(RUNTIME_CLASS(COleDropInfo)));

	if( pInfo->m_pDataObject->IsDataAvailable(s_wNvrChnClipboardFormat) )
		return DROPEFFECT_COPY;
	else
		return DROPEFFECT_NONE;
}

// OnDropEx cannot be executed 
DROPEFFECT A::OnDropEx(WPARAM pDropInfoClass, LPARAM lParm)
{
    return (DROPEFFECT)-1;
}


modified on Thursday, November 13, 2008 1:54 AM

AnswerRe: OnDragOver/OnDropEx cannot used in CStatic? Pin
kaviniswell12-Nov-08 20:35
kaviniswell12-Nov-08 20:35 
Questionhow do i create shortcut for my application through coding Pin
puppya12-Nov-08 19:22
puppya12-Nov-08 19:22 
AnswerRe: how do i create shortcut for my application through coding Pin
Hamid_RT12-Nov-08 20:27
Hamid_RT12-Nov-08 20:27 
QuestionGet FolderSize Pin
NewVC++12-Nov-08 18:59
NewVC++12-Nov-08 18:59 
AnswerRe: Get FolderSize Pin
Hamid_RT12-Nov-08 19:10
Hamid_RT12-Nov-08 19:10 
AnswerRe: Get FolderSize Pin
ShilpiP12-Nov-08 19:11
ShilpiP12-Nov-08 19:11 
AnswerRe: Get FolderSize Pin
_AnsHUMAN_ 12-Nov-08 19:17
_AnsHUMAN_ 12-Nov-08 19:17 
AnswerRe: Get FolderSize Pin
Iain Clarke, Warrior Programmer13-Nov-08 3:10
Iain Clarke, Warrior Programmer13-Nov-08 3:10 
GeneralRe: Get FolderSize Pin
Hamid_RT13-Nov-08 9:00
Hamid_RT13-Nov-08 9:00 
QuestionDecrypt string Pin
cpvc++12-Nov-08 18:53
cpvc++12-Nov-08 18:53 
AnswerRe: Decrypt string Pin
enhzflep12-Nov-08 20:34
enhzflep12-Nov-08 20:34 
AnswerRe: Decrypt string Pin
ShilpiP12-Nov-08 20:38
ShilpiP12-Nov-08 20:38 
QuestionHow to create a setup for an mfc application Pin
Dhiraj kumar Saini12-Nov-08 18:26
Dhiraj kumar Saini12-Nov-08 18:26 
AnswerRe: How to create a setup for an mfc application Pin
_AnsHUMAN_ 12-Nov-08 18:29
_AnsHUMAN_ 12-Nov-08 18:29 
GeneralRe: How to create a setup for an mfc application Pin
Dhiraj kumar Saini12-Nov-08 18:47
Dhiraj kumar Saini12-Nov-08 18:47 
AnswerRe: How to create a setup for an mfc application Pin
Hamid_RT12-Nov-08 19:12
Hamid_RT12-Nov-08 19:12 
AnswerRe: How to create a setup for an mfc application Pin
Cedric Moonen12-Nov-08 20:04
Cedric Moonen12-Nov-08 20: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.