Click here to Skip to main content
15,890,557 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionRegarding Adobe Acrobat Reader6.0 Add-in Pin
NATARAJAN VENKATARAMANI5-Mar-09 4:03
NATARAJAN VENKATARAMANI5-Mar-09 4:03 
QuestionHow can we create a dynamic button, label and a listview control on a window created in ATL/WTL ? Pin
Dharmendra Bhargava4-Mar-09 22:03
Dharmendra Bhargava4-Mar-09 22:03 
AnswerRe: How can we create a dynamic button, label and a listview control on a window created in ATL/WTL ? Pin
Jonathan Davies8-Mar-09 5:40
Jonathan Davies8-Mar-09 5:40 
GeneralRe: How can we create a dynamic button, label and a listview control on a window created in ATL/WTL ? Pin
Dharmendra Bhargava9-Mar-09 21:57
Dharmendra Bhargava9-Mar-09 21:57 
GeneralRe: How can we create a dynamic button, label and a listview control on a window created in ATL/WTL ? Pin
Jonathan Davies10-Mar-09 1:13
Jonathan Davies10-Mar-09 1:13 
Questionnon dialog object sink advise causing assert to be thrown during advise initialisation Pin
TClarke4-Mar-09 0:26
TClarke4-Mar-09 0:26 
AnswerRe: non dialog object sink advise causing assert to be thrown during advise initialisation Pin
Jonathan Davies6-Mar-09 1:01
Jonathan Davies6-Mar-09 1:01 
GeneralRe: non dialog object sink advise causing assert to be thrown during advise initialisation Pin
TClarke6-Mar-09 1:25
TClarke6-Mar-09 1:25 
Hi, thanks for the response.

I have something very similar.
In my class declaration I have:

public IDispEventSimpleImpl<0, COfficeDlgX, &__uuidof(_IOfficeAutomaterEvents)>,
public IDispEventImpl<IDC_WB,COfficeDlgX>,


In my class I then create a typedef for calling the advise method.

typedef IDispEventSimpleImpl<0, COfficeDlgX, &__uuidof(_IOfficeAutomaterEvents)> OfficeAutomaterEventsImpl;


Then I generate the sink map:

BEGIN_SINK_MAP(COfficeDlgX)
	SINK_ENTRY(IDC_WB, 259, DocumentCompleteWb)
	SINK_ENTRY(IDC_WB, 252, NavigateComplete2Wb)
	SINK_ENTRY(IDC_WB, 250, BeforeNavigate2Wb)
	SINK_ENTRY_INFO(0, __uuidof(_IOfficeAutomaterEvents), 1, &COfficeDlgX::__OnDocumentClosed, &OnMenuItemClickedInfo)
	SINK_ENTRY_INFO(0, __uuidof(_IOfficeAutomaterEvents), 2, &COfficeDlgX::__OnMenuItemClicked, &OnMenuItemClickedInfo)
END_SINK_MAP()


in my code, when I create an instance of IOfficeAutomater I call:

hr = OfficeAutomaterEventsImpl::DispEventAdvise((IUnknown*)m_spOfficeAutomater, &__uuidof(_IOfficeAutomaterEvents));


IDC_WB is the dialog id of my WebBrowser.
I don't have to call DispEventAdvise for the web browser control myself as the framework does it for me. It does it by using the id to get to the control. Herein lies the problem. Somehow, the framework now thinks all the sink entry ids refer to an item on the dialog box. The system therefore runs through all the sink entry id and calls GetDlgItem with them. When it uses the id of my non dialog item ie 0, it of course comes back NULL. This value runs through an assert and hey presto I get a message box up telling me something's wrong.
On one hand it's only an assert and so it won't come up in the release build and it in no way affects whether my app works or not but it does seem very messy. What would be ideal is having two sink maps. One for dialog items and the other for anything else.

Cheers
Tom

Philosophy: The art of never getting beyond the concept of life.
Religion: Morality taking credit for the work of luck.

GeneralRe: non dialog object sink advise causing assert to be thrown during advise initialisation Pin
Jonathan Davies6-Mar-09 2:16
Jonathan Davies6-Mar-09 2:16 
GeneralRe: non dialog object sink advise causing assert to be thrown during advise initialisation Pin
TClarke6-Mar-09 2:43
TClarke6-Mar-09 2:43 
QuestionDerived class from a template base class Pin
yellowine3-Mar-09 17:34
yellowine3-Mar-09 17:34 
AnswerRe: Derived class from a template base class Pin
led mike4-Mar-09 4:34
led mike4-Mar-09 4:34 
Questionset_union question (about the parameter _Result) Pin
followait2-Mar-09 3:51
followait2-Mar-09 3:51 
AnswerRe: set_union question (about the parameter _Result) Pin
Stuart Dootson2-Mar-09 7:25
professionalStuart Dootson2-Mar-09 7:25 
GeneralRe: set_union question (about the parameter _Result) Pin
followait2-Mar-09 14:41
followait2-Mar-09 14:41 
GeneralRe: set_union question (about the parameter _Result) Pin
«_Superman_»2-Mar-09 17:52
professional«_Superman_»2-Mar-09 17:52 
GeneralRe: set_union question (about the parameter _Result) Pin
Stuart Dootson2-Mar-09 19:20
professionalStuart Dootson2-Mar-09 19:20 
QuestionPerformance clarification on vectors? Pin
mmayur27-Feb-09 5:58
mmayur27-Feb-09 5:58 
AnswerRe: Performance clarification on vectors? Pin
Stuart Dootson27-Feb-09 8:19
professionalStuart Dootson27-Feb-09 8:19 
Questionhelp: A C++ template question [modified] Pin
yellowine24-Feb-09 11:12
yellowine24-Feb-09 11:12 
AnswerRe: help: A C++ template question Pin
Stuart Dootson24-Feb-09 11:20
professionalStuart Dootson24-Feb-09 11:20 
GeneralRe: help: A C++ template question Pin
yellowine24-Feb-09 11:24
yellowine24-Feb-09 11:24 
GeneralRe: help: A C++ template question Pin
Stuart Dootson24-Feb-09 12:53
professionalStuart Dootson24-Feb-09 12:53 
QuestionMap access violation problem with release build Pin
Kyudos23-Feb-09 15:30
Kyudos23-Feb-09 15:30 
AnswerRe: Map access violation problem with release build Pin
Kyudos23-Feb-09 16:15
Kyudos23-Feb-09 16:15 

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.