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

ATL / WTL / STL

 
AnswerRe: how to change toolbar in session expiary Pin
yytg11-Oct-07 5:32
yytg11-Oct-07 5:32 
QuestionFinding in a vector of Structure Pin
Pankaj.Jain5-Oct-07 19:59
professionalPankaj.Jain5-Oct-07 19:59 
AnswerRe: Finding in a vector of Structure Pin
John R. Shaw5-Oct-07 23:53
John R. Shaw5-Oct-07 23:53 
AnswerRe: Finding in a vector of Structure Pin
Stephen Hewitt7-Oct-07 14:38
Stephen Hewitt7-Oct-07 14:38 
Questionhow to use max_element with a vector Pin
s196675m5-Oct-07 13:21
s196675m5-Oct-07 13:21 
AnswerRe: how to use max_element with a vector Pin
John R. Shaw6-Oct-07 0:27
John R. Shaw6-Oct-07 0:27 
QuestionMessage handling Pin
_tasleem5-Oct-07 11:13
_tasleem5-Oct-07 11:13 
QuestionProblem with DispEventAdvise Pin
sandeepkavade4-Oct-07 18:50
sandeepkavade4-Oct-07 18:50 
hi all,
i am having a sdk with fires an event.
i am trying to catch that event in other C++ console application,
i have derived my CEventSink class from IDispEventImpl

EventSink.h:

#pragma once


static _ATL_FUNC_INFO OnEvent = {CC_STDCALL, VT_EMPTY, 5, {VT_UI4, VT_BSTR, VT_BSTR, VT_I2, VT_BSTR}};
class ATL_NO_VTABLE CEventSink : public IDispEventImpl<1, CEventSink, &__uuidof(_ISourceEvents)>
{
public:

BEGIN_SINK_MAP(CEventSink)
SINK_ENTRY_INFO(1, __uuidof(_ISourceEvents), 1, OnEventES , &OnEvent )
END_SINK_MAP()

CEventSink(void);
~CEventSink(void);

HRESULT STDMETHODCALLTYPE OnEventES (DWORD dwSession, BSTR bszFilePath, BSTR bszName, SHORT Action, BSTR bszMessage);
};

OnEvent method from the sdk is:

[id(0x00000001), helpstring("method OnEvent ")]
HRESULT OnEvent (
[in] long dwSession,
[in] BSTR bszFilePath,
[in] BSTR bszName,
[in] short Result,
[in] BSTR bszMessage);


TestApp.cpp:
#include "stdafx.h"
#include "eventsink.h"
int _tmain(int argc, _TCHAR* argv[])
{
CoInitialize(NULL);
ISource *spEventFiringObject = NULL;
CEventSink* pEventSink = NULL;
HRESULT hr = CoCreateInstance(CLSID_Source, NULL, CLSCTX_ALL, IID_ISource, reinterpret_cast<void **="">(&spEventFiringObject));

if(SUCCEEDED(hr))
{
pEventSink = new CEventSink();
hr = pEventSink->DispEventAdvise(spEventFiringObject, &__uuidof(_ISourceEvents));
}
CoUninitialize();
return 0;
}

but DispEventAdvise returns something like

hr = 0xc0000005 The instruction at "0x

what is wrong here?

Thanx in advance.
AnswerRe: Problem with DispEventAdvise Pin
Stuart Dootson4-Oct-07 21:48
professionalStuart Dootson4-Oct-07 21:48 
QuestionWhich DWebBrowserEvents2 function is called when we Rrefresh a webpage Pin
Dhiraj kumar Saini4-Oct-07 1:56
Dhiraj kumar Saini4-Oct-07 1:56 
QuestionAdding a dialog in resource as child window at runtime? Pin
Gyan Prakash3-Oct-07 21:44
Gyan Prakash3-Oct-07 21:44 
QuestionVector Pin
mcsherry3-Oct-07 5:17
mcsherry3-Oct-07 5:17 
AnswerRe: Vector Pin
Chris Losinger3-Oct-07 5:36
professionalChris Losinger3-Oct-07 5:36 
GeneralRe: Vector Pin
mcsherry3-Oct-07 5:47
mcsherry3-Oct-07 5:47 
GeneralRe: Vector Pin
mcsherry3-Oct-07 5:54
mcsherry3-Oct-07 5:54 
GeneralRe: Vector Pin
Chris Losinger3-Oct-07 6:11
professionalChris Losinger3-Oct-07 6:11 
GeneralRe: Vector Pin
Nemanja Trifunovic3-Oct-07 7:47
Nemanja Trifunovic3-Oct-07 7:47 
AnswerRe: Vector Pin
Nathan Holt at EMOM3-Oct-07 11:10
Nathan Holt at EMOM3-Oct-07 11:10 
AnswerRe: Vector Pin
John R. Shaw6-Oct-07 0:55
John R. Shaw6-Oct-07 0:55 
QuestionHow to detect page refresh in vc++ Pin
rindam3-Oct-07 3:19
rindam3-Oct-07 3:19 
Questionsending sms through aspx.cs code in c# Pin
sh_india61@yahoo.com3-Oct-07 2:39
sh_india61@yahoo.com3-Oct-07 2:39 
AnswerRe: sending sms through aspx.cs code in c# Pin
vadivelub7-Apr-09 5:07
vadivelub7-Apr-09 5:07 
QuestionString problem Pin
david bagaturia1-Oct-07 22:19
david bagaturia1-Oct-07 22:19 
AnswerRe: String problem Pin
Jonas Larsson2-Oct-07 0:49
Jonas Larsson2-Oct-07 0:49 
GeneralRe: String problem Pin
david bagaturia2-Oct-07 3:38
david bagaturia2-Oct-07 3:38 

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.