Click here to Skip to main content
15,895,777 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionProblem on modeless dialog on Excel Pin
Member 311342211-Oct-12 7:23
Member 311342211-Oct-12 7:23 
Hi Team,

I have create modeless dialog, which contain Edit Box, and put it in Excel.
C++


The problem is every time I enter a text to my edit, the text disappear in Edit Box instead it show in a active cell in Excel.

Does someone has any suggestion?

Below is a code snipped
<pre lang="c++">BOOL CALLBACK ToolDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_COMMAND:
break;
case WM_GETDLGCODE:
return TRUE;
case WM_SETFOCUS:
return TRUE;
case WM_KILLFOCUS:
return TRUE;
default:
return FALSE;
}
return TRUE;
}

void CWPFInDialog::CreateMyDialog(HWND a_hwnd)
{

//a_hwnd is an excel handle get from Excel::_Application::get_Hwnd() funcrtion

m_dialogHwnd = CreateDialog(g_hinstDLL, MAKEINTRESOURCE(IDD_DIALOGHOST), a_hwnd, ToolDlgProc);

if(m_dialogHwnd == NULL)

{
ShowWindow(m_dialogHwnd, SW_SHOW);
}
}


Thanks,

PS
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 
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 

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.