Click here to Skip to main content
15,881,757 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to enable re-sizing window without using WS_THICKKFRAME Pin
Richard Andrew x6412-Oct-12 12:25
professionalRichard Andrew x6412-Oct-12 12:25 
GeneralRe: How to enable re-sizing window without using WS_THICKKFRAME Pin
Hari-Adarapu14-Oct-12 15:51
Hari-Adarapu14-Oct-12 15:51 
SuggestionRe: How to enable re-sizing window without using WS_THICKKFRAME Pin
David Crow13-Oct-12 9:11
David Crow13-Oct-12 9:11 
QuestionProblem on modeless dialog on Excel Pin
Member 311342211-Oct-12 7:23
Member 311342211-Oct-12 7:23 
AnswerRe: Problem on modeless dialog on Excel Pin
Richard MacCutchan11-Oct-12 11:26
mveRichard MacCutchan11-Oct-12 11:26 
GeneralRe: Problem on modeless dialog on Excel Pin
Member 311342211-Oct-12 17:54
Member 311342211-Oct-12 17:54 
GeneralRe: Problem on modeless dialog on Excel Pin
Richard MacCutchan11-Oct-12 21:03
mveRichard MacCutchan11-Oct-12 21:03 
GeneralRe: Problem on modeless dialog on Excel Pin
Member 311342211-Oct-12 21:20
Member 311342211-Oct-12 21:20 
This is full class definition of creating dialog.
This class is an export class.

header file
C++
#pragma once

#include "WPFInDialogDefs.h"
#include "WPFWrapper.h"

// This class is exported from the WPFInDialog.dll
class WPFINDIALOG_API CWPFInDialog {
public:
	CWPFInDialog(void);
	void CreateMyDialog(HWND a_hwnd);
private:
	HWND m_dialogHwnd;
	CWPFWrapper m_wrapper;
};


cpp file
C++
#include "stdafx.h"
#include "WPFInDialog.h"
#include "resource.h"

extern HINSTANCE  g_hinstDLL;

CWPFInDialog::CWPFInDialog()
{
}

BOOL CALLBACK ToolDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
	switch(Message)
	{
		case WM_COMMAND:
			break;
		default:
			return FALSE;
	}
	return TRUE;
}

void CWPFInDialog::CreateMyDialog(HWND a_hwnd)
{
	m_dialogHwnd = CreateDialog(g_hinstDLL, MAKEINTRESOURCE(IDD_DIALOGHOST), a_hwnd, ToolDlgProc);
	if(m_dialogHwnd != NULL)
	{
		ShowWindow(m_dialogHwnd, SW_SHOW);
	}
}


To create the the dialog, I just
C++
CWPFInDialog* l_atsWrapper = new CWPFInDialog();
l_atsWrapper->CreateMyDialog(l_hwndExcel);

l_hwndExcel is an excel handle
to get the excel handle I call
C++
CComPtr<Excel::_Application> l_excelApp;
HRESULT l_hr = g_excelMgrSingleton.GetExcelApplication(&l_excelApp);

HWND l_hwndExcel;
l_hr = l_excelApp->get_Hwnd((long*)&l_hwndExcel);

no clean up for l_atsWrapper
GeneralRe: Problem on modeless dialog on Excel Pin
Richard MacCutchan11-Oct-12 22:17
mveRichard MacCutchan11-Oct-12 22:17 
GeneralRe: Problem on modeless dialog on Excel Pin
David Crow12-Oct-12 10:26
David Crow12-Oct-12 10:26 
QuestionFatal Error C1902 Pin
pix_programmer10-Oct-12 22:42
pix_programmer10-Oct-12 22:42 
AnswerRe: Fatal Error C1902 Pin
Jochen Arndt10-Oct-12 22:51
professionalJochen Arndt10-Oct-12 22:51 
GeneralRe: Fatal Error C1902 Pin
pix_programmer10-Oct-12 22:59
pix_programmer10-Oct-12 22:59 
GeneralRe: Fatal Error C1902 Pin
Jochen Arndt10-Oct-12 23:05
professionalJochen Arndt10-Oct-12 23:05 
GeneralRe: Fatal Error C1902 Pin
pix_programmer10-Oct-12 23:18
pix_programmer10-Oct-12 23:18 
GeneralRe: Fatal Error C1902 Pin
Jochen Arndt10-Oct-12 23:27
professionalJochen Arndt10-Oct-12 23:27 
GeneralRe: Fatal Error C1902 Pin
pix_programmer10-Oct-12 23:43
pix_programmer10-Oct-12 23:43 
GeneralRe: Fatal Error C1902 Pin
Jochen Arndt10-Oct-12 23:52
professionalJochen Arndt10-Oct-12 23:52 
QuestionCRichEditCtrl halt any visual updates for a sec !! Pin
sdancer7510-Oct-12 4:59
sdancer7510-Oct-12 4:59 
AnswerRe: CRichEditCtrl halt any visual updates for a sec !! Pin
Jochen Arndt10-Oct-12 5:39
professionalJochen Arndt10-Oct-12 5:39 
AnswerRe: CRichEditCtrl halt any visual updates for a sec !! Pin
chaau10-Oct-12 11:27
chaau10-Oct-12 11:27 
GeneralRe: CRichEditCtrl halt any visual updates for a sec !! Pin
sdancer7510-Oct-12 21:38
sdancer7510-Oct-12 21:38 
QuestionHow to get which Radio button is Checked? Pin
Fresher1610-Oct-12 2:14
Fresher1610-Oct-12 2:14 
AnswerRe: How to get which Radio button is Checked? Pin
_AnsHUMAN_ 10-Oct-12 2:29
_AnsHUMAN_ 10-Oct-12 2:29 
QuestionRe: How to get which Radio button is Checked? Pin
David Crow10-Oct-12 2:38
David Crow10-Oct-12 2:38 

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.