2012-10-26 1 views
0

내 COM 추가 기능 내에서 대화 상자를 만든 다음 외부 프로세스에서 메시지를 보냅니다. 나는 HWND_BROADCASTRegisterWindowMessage을 사용합니다.MS Word COM 추가 기능이 XP에서 메시지를받을 수 없습니다.

그러나 이러한 메시지는 COM 추가 기능의 대화 상자 proc에서 수신되지 않습니다. 대화 상자 proc에 의해 수신 된 모든 메시지를 기록하고 또한 RegisterWindowMessage에 의해 반환 된 값을 기록하기 때문에 이것을 알 수 있습니다. 나는이 오류가 왜 대화가 부모 창을 가질 때

INT_PTR CALLBACK ProgressDialogProc(__in HWND hwndDlg,__in UINT uMsg,__in WPARAM wParam,__in LPARAM lParam) 
{ 
    static UINT nCloseMessage = 0; 
    if (!nCloseMessage) 
     nCloseMessage = RegisterWindowMessage(_T("MyCloseMessage"));  
    if (uMsg == nCloseMessage) 
     MessageBox(0,_T("Caught"),0,0); 

    return FALSE; 
} 

답변

0
내가 발견

HWND_BROADCAST이 작동하지 않습니다 : COM 추가 기능에서

static UINT nCloseMessage = 0; 
if (!nCloseMessage) 
    nCloseMessage = RegisterWindowMessage(_T("MyCloseMessage"));  
PostMessage(HWND_BROADCAST, nCloseMessage, 0, 0); 

: 외부 과정에서

.

부모 용 NULL ~ CreateDialog을 전달하면 오류가 해결되었습니다.

관련 문제