Click here to Skip to main content
15,923,376 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
Generalquick bind1st question Pin
marinme6-Apr-05 23:56
marinme6-Apr-05 23:56 
GeneralRe: quick bind1st question Pin
Mike Dimmick7-Apr-05 2:06
Mike Dimmick7-Apr-05 2:06 
Generalusing bind2nd function on map Pin
fordge6-Apr-05 17:24
fordge6-Apr-05 17:24 
GeneralRe: using bind2nd function on map Pin
Stuart Dootson6-Apr-05 21:16
professionalStuart Dootson6-Apr-05 21:16 
GeneralRe: using bind2nd function on map Pin
fordge7-Apr-05 1:23
fordge7-Apr-05 1:23 
GeneralRe: using bind2nd function on map Pin
Stuart Dootson7-Apr-05 2:37
professionalStuart Dootson7-Apr-05 2:37 
Questionmultiple key containers?? Pin
fordge6-Apr-05 17:17
fordge6-Apr-05 17:17 
AnswerRe: multiple key containers?? Pin
Stuart Dootson6-Apr-05 21:18
professionalStuart Dootson6-Apr-05 21:18 
GeneralCCommandBarCtrl menu appears as a toolbar button Pin
Paper#6-Apr-05 13:16
Paper#6-Apr-05 13:16 
GeneralProblem using ATL Object in other ATL Server Pin
andreasf5-Apr-05 20:22
andreasf5-Apr-05 20:22 
GeneralImmediate repainting of a listctrl Pin
Franz Klein5-Apr-05 0:17
Franz Klein5-Apr-05 0:17 
GeneralRe: Immediate repainting of a listctrl Pin
Michael Dunn5-Apr-05 7:14
sitebuilderMichael Dunn5-Apr-05 7:14 
QuestionCan a ConnectionPoint Object have function like "HRESULT Test([in, out] Byte* pData)" Pin
samfromcn4-Apr-05 16:36
samfromcn4-Apr-05 16:36 
AnswerRe: Can a ConnectionPoint Object have function like "HRESULT Test([in, out] Byte* pData)" Pin
Michael Dunn4-Apr-05 20:12
sitebuilderMichael Dunn4-Apr-05 20:12 
GeneralRe: Can a ConnectionPoint Object have function like "HRESULT Test([in, out] Byte* pData)" Pin
samfromcn4-Apr-05 21:39
samfromcn4-Apr-05 21:39 
GeneralRe: Can a ConnectionPoint Object have function like "HRESULT Test([in, out] Byte* pData)" Pin
Stuart Dootson4-Apr-05 21:52
professionalStuart Dootson4-Apr-05 21:52 
GeneralRe: Can a ConnectionPoint Object have function like "HRESULT Test([in, out] Byte* pData)" Pin
samfromcn4-Apr-05 22:27
samfromcn4-Apr-05 22:27 
GeneralRe: Can a ConnectionPoint Object have function like "HRESULT Test([in, out] Byte* pData)" Pin
Stuart Dootson4-Apr-05 23:05
professionalStuart Dootson4-Apr-05 23:05 
GeneralRe: Can a ConnectionPoint Object have function like "HRESULT Test([in, out] Byte* pData)" Pin
samfromcn4-Apr-05 23:28
samfromcn4-Apr-05 23:28 
GeneralRe: Can a ConnectionPoint Object have function like "HRESULT Test([in, out] Byte* pData)" Pin
Stuart Dootson4-Apr-05 23:43
professionalStuart Dootson4-Apr-05 23:43 
GeneralRe: Can a ConnectionPoint Object have function like "HRESULT Test([in, out] Byte* pData)" Pin
samfromcn5-Apr-05 16:14
samfromcn5-Apr-05 16:14 
GeneralRe: Can a ConnectionPoint Object have function like "HRESULT Test([in, out] Byte* pData)" Pin
Stuart Dootson5-Apr-05 22:17
professionalStuart Dootson5-Apr-05 22:17 
Hmmmm - COleDispatchImpl is part of MFC, not ATL...

Anyway - I've built a sample COM object (with connection point) using ATL and a harness executable (built using ATL to implement the connection point interface). This passes a BSTR as the event parameter and it seems to work fine...

I've got this code to fire the event:
STDMETHODIMP CPooh::Trigger()
{
   BSTR bs;
   BYTE a[10] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x0, 0x1, 0x2, 0x3, 0x4 };
   bs = ::SysAllocStringByteLen((const char*)a, 10);

   Fire_Pooh(bs);
   
   return S_OK;
}


and this code catching the event:
void __stdcall OnPooh(BSTR bs)
{
   size_t s = ::SysStringByteLen(bs);
   BYTE* data = (BYTE*)bs;
}


I'm getting s set to 10, and data containing the 10 bytes set in the Trigger method.

As I said - I'm using ATL code all the way and it works fine...

Stuart Dootson

'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
GeneralRe: Can a ConnectionPoint Object have function like "HRESULT Test([in, out] Byte* pData)" Pin
samfromcn6-Apr-05 15:57
samfromcn6-Apr-05 15:57 
GeneralRe: Can a ConnectionPoint Object have function like "HRESULT Test([in, out] Byte* pData)" Pin
Stuart Dootson6-Apr-05 21:02
professionalStuart Dootson6-Apr-05 21:02 
GeneralSerializing objects using XLM Pin
Ernesto D.4-Apr-05 15:01
Ernesto D.4-Apr-05 15:01 

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.