Thanks! :-p
-scott
Thanks! :-p
-scott
hmmmm. This may be related to that online launch event that CP hosted for Visual Studio.
-scott
That's my point. But it did happen. I have an e-mail address specific to CP, as I do with a lot of websites that require registration.
-scott
The e-mail address I'm using for code project is now getting spam from OpenMakeSoftware. Anyone else seeing this? I'm not particularly happy about this, considering I opted out of the e-mail newsletters etc. from CP.
-scott
I recently got a MacBook Pro and I'm a heavy Windows guy. (not overweight, I use Windows a lot.) I'm liking the OS X for the non-work related stuff. However, I used MSDN XP Pro ISO for the Windows partition. Everything is working flawlessly. It's the best lap top I've ever owned. I have had a ThinkPad (good, but stripped down) and several Dells (nothing really wrong or right about Dell). I would highly recommend the Mac, as it seams like they spent more than 15 minutes on the industrial design.... Also, Lenovo is not IBM. The quality and customer service is beginning to change for the ThinkPads.
-Scott
One of the good things about using connection points is that the client doesn't need to manage the connection to the incoming interface. That is, to connect to the COM server callback interface, the client must pass a reference of itself to the server. Is there a way for the server to determine if the client is still there before calling the callback function? Is there a way for the server to implicitly connect to the client when the client instantiates an object from the server? I'm not sure that made sense...oh well __scott
:confused: That's one of the problems with VB, it's hard to know exactly what's going on. I guess my question should be, how do I create an event function that returns parameters from the client (without using a callback interface)? Anyone have a clue on this one? __scott
That's odd... Because, and I know this isn't the best example, but if I create a quick COM object with VB and define an outgoing interface with a byref parameter, it works great. The resulting IDL is below: [id(0x00000001)] void TestEvent( [in] short eventByVal, [in, out] short* eventAsRef, [in, out] VARIANT_BOOL* eventBoolRef); So, I'm thinking there must be a C++/ATL equivalent, but I can't figure it out...I know I could use a call back interface, but using a connection point would make it more straight forward from the client side... Any idea how to get this to work? __scott
X| Does anyone know the trick to getting a connection point method to pass parameters by reference? Below is an example of a simple event, which should return a short from the client, but the variant varResult always returns empty?!? Any ideas? IDL: [ uuid(48053E7C-D307-40D2-A380-3B9CB25282AB), version(1.0), helpstring("atl_event 1.0 Type Library") ] library ATL_EVENTLib { importlib("stdole32.tlb"); importlib("stdole2.tlb"); [ uuid(224E5ED5-D64E-4556-A785-5ACE0DD8F0B3), helpstring("_IEventTestEvents Interface") ] dispinterface _IEventTestEvents { properties: methods: [id(1), helpstring("method TestEvent")] HRESULT TestEvent([in, out] short* sVar ); }; [ uuid(840EF1AE-F80F-4F71-9802-03DFE6555B19), helpstring("EventTest Class") ] coclass EventTest { [default] interface IEventTest; [default, source] dispinterface _IEventTestEvents; }; }; C++: template class CProxy_IEventTestEvents : public IConnectionPointImpl { //Warning this class may be recreated by the wizard. public: HRESULT Fire_TestEvent(SHORT * sVar) { CComVariant varResult; T* pT = static_cast(this); int nConnectionIndex; CComVariant* pvars = new CComVariant[1]; int nConnections = m_vec.GetSize(); for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++) { pT->Lock(); CComPtr sp = m_vec.GetAt(nConnectionIndex); pT->Unlock(); IDispatch* pDispatch = reinterpret_cast(sp.p); if (pDispatch != NULL) { VariantClear(&varResult); pvars[0] = *sVar; DISPPARAMS disp = { pvars, NULL, 1, 0 }; pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL); } } delete[] pvars; // *sVar = varResult.iVal; return varResult.scode; } }; __scott