Ajouter un commentaire

Delirium6

Quote:
J'aimerais bien avoir une vision plus claire de la chose.

Je comprend tout a fait que sans avoir une vision plus grande de la chose, vous ayez du mal a tout comprendre

Je peux vous envoyer si vous le souaitée le fichier concerné! Sinon voici déjà mon organisation :

// COENotifyWnd dialog used for App About

class COENotifyWnd : public CWnd
{
public:
	COENotifyWnd();

// Dialog Data
	//enum { IDD = IDD_OENOTIFYWND };

	//VOID SetRes(HMODULE hResModule){ AfxGetResourceHandle() = hResModule; }

public:
	afx_msg LRESULT OnNewMsgs(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnFolderNotify(WPARAM wParam, LPARAM lParam);

	VOID SetFolder(IStoreFolder* pFolder){ m_pFolder = pFolder; }

	IStoreFolder* m_pFolder;

	protected:
	//HMODULE AfxGetResourceHandle();
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//virtual BOOL OnInitDialog();
// Implementation
protected:
	DECLARE_MESSAGE_MAP()
};

COENotifyWnd::COENotifyWnd()// : CDialog(COENotifyWnd::IDD)
{
}

void COENotifyWnd::DoDataExchange(CDataExchange* pDX)
{
	CWnd::DoDataExchange(pDX);
}

BEGIN_MESSAGE_MAP(COENotifyWnd, CWnd)
	ON_MESSAGE(WM_NEWMSGS,COENotifyWnd::OnNewMsgs)
	ON_MESSAGE(WM_FOLDERNOTIFY,COENotifyWnd::OnFolderNotify)
END_MESSAGE_MAP()


//
//	OnNewMsgs
//
/////////////////////////////////////////////////////////////////////////
LRESULT COENotifyWnd::OnNewMsgs(WPARAM wParam, LPARAM lParam)
{	MessageBox("OnNewMsgs","OnNewMsgs",MB_OK);
#ifdef IS_MANAGEMUTLFOLDERS_OE
	OEPlugin_OnNewMsgs( wParam, lParam, m_pFolder );
#else
	OEPlugin_OnNewMsgs( wParam, lParam );
#endif

	return 0;
}


//
//	OnFolderNotify
//
/////////////////////////////////////////////////////////////////////////
LRESULT COENotifyWnd::OnFolderNotify(WPARAM wParam, LPARAM lParam)
{
	OEPlugin_OnFolderNotify( wParam, lParam );
	return 0;
}

class COEFolderWrapper
{
public:
	COEFolderWrapper():
			m_pFolder(NULL),
			m_pOENotifyWnd(NULL)
	{
	}

	~COEFolderWrapper()
	{
		if( m_pOENotifyWnd )
		{
			m_pOENotifyWnd->DestroyWindow();

			delete m_pOENotifyWnd;
			m_pOENotifyWnd = NULL;
		}
	}
	}

	//
	//	SetFolder
	//
	/////////////////////////////////////////////////////////////////////////
	VOID SetFolder(CComPtr<IStoreFolder> pFolder)
	{
		HRESULT hr = S_OK;

		m_pFolder = pFolder;

		if( m_pFolder )
		{
			m_pFolder->AddRef();

			CRect rect(10, 10, 100, 100);

			m_pOENotifyWnd = new(COENotifyWnd);

			if( m_pOENotifyWnd->CreateEx( NULL, AfxRegisterWndClass(0,0,0,0),_T("OENotifyWnd"),WS_POPUP,rect, NULL, NULL, NULL ))
			{
				m_pOENotifyWnd->SetFolder( m_pFolder );

				hr = m_pFolder->RegisterNotification( 0, m_pOENotifyWnd->m_hWnd );
		//#ifdef IS_TEST
					FOLDERPROPS props;
					props.cbSize = sizeof(FOLDERPROPS);

					m_pFolder->GetFolderProps( 0, &props );
					if( hr == E_INVALIDARG )
					{
						MessageBox( NULL, props.szName, "E_INVALIDARG : COEFolderWrapper::SetFolder", MB_OK );
					}
					if( hr == E_FAIL )
					{
						MessageBox( NULL, props.szName, "E_FAIL : COEFolderWrapper::SetFolder", MB_OK );
					}

					if( hr != S_OK )
					{
	CString str;
	str.Format("%d",hr);
	MessageBox( NULL, str, "S_OK : COEFolderWrapper::SetFolder", MB_OK );
						MessageBox( NULL, props.szName, "S_OK : COEFolderWrapper::SetFolder", MB_OK );
					}

					if( hr == S_OK )
					{
	CString str;
	str.Format("%d",hr);
	MessageBox( NULL, str, "S_OK : COEFolderWrapper::SetFolder", MB_OK );
						MessageBox( NULL, props.szName, "ISGOOD : COEFolderWrapper::SetFolder", MB_OK );
					}
			//#endif
			}
			else
				MessageBox( NULL, "BAD", "BAD", MB_OK );

		}
	}

	//
	//	Unregister
	//
	/////////////////////////////////////////////////////////////////////////
	VOID Unregister()
	{
		if( m_pFolder )
		{
			m_pFolder->UnregisterNotification( 0, m_pOENotifyWnd->m_hWnd );

			m_pFolder->Release();
			m_pFolder = NULL;
		}
	}

	IStoreFolder* m_pFolder;

	COENotifyWnd* m_pOENotifyWnd;
};

Filtered HTML

Plain text

CAPTCHA
Cette question permet de vérifier que vous n'êtes pas un robot spammeur :-)
 EEEE  W     W   QQQ    W     W  H  H 
E W W Q Q W W H H
EEE W W W Q Q W W W HHHH
E W W W Q QQ W W W H H
EEEE W W QQQQ W W H H
Q