Click here to Skip to main content
15,905,229 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
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 
GeneralRe: Serializing objects using XLM Pin
Christian Graus4-Apr-05 15:53
protectorChristian Graus4-Apr-05 15:53 
GeneralRe: Serializing objects using XLM Pin
Michael Dunn4-Apr-05 20:15
sitebuilderMichael Dunn4-Apr-05 20:15 
GeneralRe: Serializing objects using XLM Pin
Ernesto D.4-Apr-05 20:20
Ernesto D.4-Apr-05 20:20 
GeneralRe: Serializing objects using XLM Pin
Andrew Walker4-Apr-05 21:13
Andrew Walker4-Apr-05 21:13 
GeneralRe: Serializing objects using XLM Pin
Ernesto D.5-Apr-05 2:34
Ernesto D.5-Apr-05 2:34 
GeneralSmart Tag for Rich Edit of Outlook email viewer Pin
Rajeev K Srivastava3-Apr-05 9:35
Rajeev K Srivastava3-Apr-05 9:35 
GeneralCan't get data from my vector. Help!!! Pin
Larry Mills Sr2-Apr-05 9:42
Larry Mills Sr2-Apr-05 9:42 
GeneralBrowser Helper Object Pin
nmhuy30-Mar-05 21:42
nmhuy30-Mar-05 21:42 
GeneralRe: Browser Helper Object Pin
Nicholas Cardi1-Apr-05 4:00
Nicholas Cardi1-Apr-05 4:00 
GeneralProblem while Persisting Image into Control Pin
ajalilqarshi30-Mar-05 3:58
ajalilqarshi30-Mar-05 3:58 
GeneralMultiple Inclusion Pin
Gomzy29-Mar-05 22:09
sussGomzy29-Mar-05 22:09 
QuestionPlease help. Is multimap what I need? Pin
knapak29-Mar-05 13:37
knapak29-Mar-05 13:37 
AnswerRe: Please help. Is multimap what I need? Pin
Joaquín M López Muñoz30-Mar-05 6:27
Joaquín M López Muñoz30-Mar-05 6:27 
GeneralRe: Please help. Is multimap what I need? Pin
knapak30-Mar-05 11:44
knapak30-Mar-05 11:44 

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.