Click here to Skip to main content
15,920,801 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Depcrecated stl-streams Pin
klawipo3-Dec-02 11:52
klawipo3-Dec-02 11:52 
GeneralRe: Depcrecated stl-streams Pin
Christian Graus4-Dec-02 9:43
protectorChristian Graus4-Dec-02 9:43 
GeneralRe: Depcrecated stl-streams Pin
Taka Muraoka5-Dec-02 16:09
Taka Muraoka5-Dec-02 16:09 
QuestionATL 7: How to _Module.GetModuleInstance()? Pin
Binky3-Dec-02 5:49
Binky3-Dec-02 5:49 
AnswerRe: ATL 7: How to _Module.GetModuleInstance()? Pin
geo_m4-Dec-02 3:25
geo_m4-Dec-02 3:25 
GeneralNeed help in firing event from second thread using shared variable!! Pin
bahruddina3-Dec-02 5:29
bahruddina3-Dec-02 5:29 
GeneralRe: Need help in firing event from second thread using shared variable!! Pin
geo_m5-Dec-02 1:14
geo_m5-Dec-02 1:14 
GeneralRe: Need help in firing event from second thread using shared variable!! Pin
bahruddina6-Dec-02 20:16
bahruddina6-Dec-02 20:16 
hi, thankx a lot for ur reply ! Smile | :)

For ur info I've used a comarshal :

STDMETHODIMP CIBMSSchedule::ExplicitInitialize()<br />
{<br />
	HRESULT hr =::CoMarshalInterThreadInterfaceInStream(IID_IInternalExec, static_cast<IInternalExec*>(this), &m_pStream);<br />
	<br />
	if (FAILED(hr))<br />
	{<br />
		MessageBox(NULL,"Could not CoMarshal", "CCom control", MB_OK | MB_ICONERROR);<br />
	}<br />
<br />
	StartThread();<br />
	<br />
	return S_OK;<br />
}<br />
<br />
void CIBMSSchedule::PreCommand()<br />
{<br />
	<br />
	HRESULT hr = CoInitialize(NULL);<br />
	if (FAILED(hr))<br />
		::MessageBox(NULL,"Bad Carma","ReceiveThread",MB_OK);<br />
	if (FAILED(::CoGetInterfaceAndReleaseStream(m_pStream, IID_IInternalExec, (void**)&m_pIInternalExec)))<br />
	{<br />
		::MessageBox(NULL,"Bad Carma, CoGetInterfaceAndReleaseStream","ReceiveThread",MB_OK);<br />
	}<br />
}

ExplicitInitialize() called by clients at client's initializion process; and PreCommand() called when this application is about to send event to every connected clients.

And by the way Im not understand what u mean by "the pointers you are using there should be unmarshalled"; however below is the code for Fire_NotifyAllConnectedClients :

VOID Fire_OnReceiveSchedule(BSTR str)<br />
	{<br />
		T* pT = static_cast<T*>(this);<br />
		int nConnectionIndex;<br />
		CComVariant* pvars = new CComVariant[1];<br />
		int nConnections = m_vec.GetSize();<br />
		<br />
		for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)<br />
		{<br />
			pT->Lock();<br />
			CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);<br />
			pT->Unlock();<br />
			IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);<br />
			if (pDispatch != NULL)<br />
			{<br />
				pvars[0] = str;<br />
				DISPPARAMS disp = { pvars, NULL, 1, 0 };<br />
				pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);<br />
			}<br />
		}<br />
		delete[] pvars;<br />
	<br />
	}

I will email to u the application together with program flow for ur reference. Is it possible to put attachments here ?

Thanx a lot in advance.

Regards,
newbie
GeneralRe: Need help in firing event from second thread using shared variable!! Pin
geo_m6-Dec-02 22:34
geo_m6-Dec-02 22:34 
GeneralRe: Need help in firing event from second thread using shared variable!! Pin
bahruddina7-Dec-02 6:34
bahruddina7-Dec-02 6:34 
GeneralRe: Need help in firing event from second thread using shared variable!! Pin
geo_m7-Dec-02 7:04
geo_m7-Dec-02 7:04 
GeneralRe: Need help in firing event from second thread using shared variable!! Pin
bahruddina7-Dec-02 21:23
bahruddina7-Dec-02 21:23 
GeneralRe: Need help in firing event from second thread using shared variable!! Pin
geo_m7-Dec-02 21:34
geo_m7-Dec-02 21:34 
Generalhandling events Pin
Dezz3-Dec-02 0:09
Dezz3-Dec-02 0:09 
GeneralATL attributed programming, need help! Pin
xi90430-Nov-02 15:56
xi90430-Nov-02 15:56 
GeneralRe: Is there an ATL equivalent for MFC's CObArray? Pin
Rene De La Garza30-Nov-02 7:52
Rene De La Garza30-Nov-02 7:52 
QuestionHow to implement a schedule in VC++ Pin
Anonymous29-Nov-02 21:45
Anonymous29-Nov-02 21:45 
AnswerRe: How to implement a schedule in VC++ Pin
Christian Graus29-Nov-02 22:15
protectorChristian Graus29-Nov-02 22:15 
AnswerRe: How to implement a schedule in VC++ Pin
geo_m4-Dec-02 3:35
geo_m4-Dec-02 3:35 
GeneralLinker error Pin
Paul Ingles28-Nov-02 10:46
Paul Ingles28-Nov-02 10:46 
GeneralRe: Linker error Pin
Rene De La Garza28-Nov-02 10:54
Rene De La Garza28-Nov-02 10:54 
GeneralRe: Linker error Pin
Paul Ingles28-Nov-02 11:21
Paul Ingles28-Nov-02 11:21 
GeneralDeallocation of Queue Memory Pin
Rizi28-Nov-02 5:33
Rizi28-Nov-02 5:33 
GeneralRe: Deallocation of Queue Memory Pin
Nick Parker28-Nov-02 6:36
protectorNick Parker28-Nov-02 6:36 

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.