Click here to Skip to main content
15,896,269 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
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 
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 
Looking at my ATL Internals (B.Rector & C.Sells) they say:

Easiest way...event sinks...derive ... from IDispEventImpl...

... when the event source is a contained control and the event recipient is a composite control, the identifier is the contained control's child window identifier.

When your class is a composite control, you should use the AtlAdviseSinkMap function to establish and remove connections...of the contained controls listed in the sink map...Using CWindow::GetDlgItem method, AtlAdviseSinkMap navigates to a child window handle...

When your class isn't a composite control you must explicitly call the DispEventAdvise method of each of your IDispEventSimpleImpl ... base classes to connect.

You seem to have the correct use of IDispEventImpl and IDispEventSimpleImpl. It also seems use of AtlAdviseSinkMap is out due to its requirement of "contained controls listed in the sink map" as one of your mapped controls isn't contained - as you say. So it seems you can't prevent AtlAdviseSinkMap calling GetDlgItem.

All it would seem you can do is not use AtlAdviseSinkMap but do it manually by using GetDlgItem etc on one and "explicitly call the DispEventAdvise" of the other (or both).
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 
AnswerRe: Map access violation problem with release build Pin
Stuart Dootson24-Feb-09 8:48
professionalStuart Dootson24-Feb-09 8:48 

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.