No post programming questions in The Lounge. Nobody said anything about programming answers. ;P
GizzoF
Posts
-
Links to close a window -
help for COM ebooksI recommend you to have a look in the MSDN library[^] . There is a lot of information there. And there are a lot of articles very helpful here in The Code Project. For example... From Joao C. Morais -- All of them. The articles are a very good introduction to COM Architecture[^] From Lim Bio Liong -- All of them are indispensables. Have a look in the Beginners and COM sections. -- modified at 11:43 Tuesday 4th October, 2005
-
COM getting phased out ?Don Box wrote something about this http://msdn.microsoft.com/msdnmag/issues/1200/com/[^] I agree with the previous post. I'm new in COM (6 months ago I didn't known anything about), and it's true that there won't be anything new, but somehow it's surviving. People continue developing components (starting at me).
-
Could any of you make me a favour?Yes! That was the problem. Someone decided that we can not do certain things...like use the messenger, and i didn`t know it. Sorry for my ignorance.
-
Could any of you make me a favour?I tried it before posting my message here. And this is what I get (more or less ...) It was not posible to connect with the server Setup: Account: msnews.microsoft.com Server: msnews.microsoft.com Protocol: NNTP Port: 119 Security (SSL): 0 Code: 800ccc0e
-
Could any of you make me a favour?I've been all the morning trying to sign in here: http://support.microsoft.com/[^] I just wanted to post a question in the newsgroup win32.programmer.ole, but it seems i can`t do it, I don`t know why. The question is the same I posted in the COM forum: http://www.codeproject.com/script/comments/forums.asp?forumid=1648#xx1238402xx[^] Could any of you post this question in the Microsoft win32.programmer.ole newsgroup? Just copy/paste....come on thanks
-
How to put a struct into a VARIANT?Maybe this could help` http://www.mvps.org/vcfaq/com/4.htm[^]
-
Thorwing a event with a collectionI have a COM object that throws an event with a collection of others COM objects. I’m not sure about the way I have to do it. The code I have implemented is like....
ICollection * pInterfaceCollection; CCollection * pCollection = new CCollection (); pCollection->QueryInterface(IID_ICollection, (void**) &pInterfaceCollection); pInterfaceCollection->Release(); result = Fire_OnColletionItems(pInterfaceCollection); if(FAILED(result)) { ... }
The problem here is that I have memory leaks. I fire the event, the client (an VB application) manages it, I shut down the client, and then I shut down my application (the server)... and there they are. I thought that the client was who release the object so I shouldn’t do it. How should I to do this? Thank you in advance. PD: sorry for my english -- modified at 13:54 Tuesday 27th September, 2005 -
take a breakjust take a look here...http://www.boreme.com/boreme/funny-2005/ping-pong-3d-p1.php[^]
-
Congrats!!!!!!!!!Just brilliant! I´m going to be fired, because my boss catched me...reading a supposed "related work site"... And who is John Simmons?
-
Throwing an event with a nested UDTHi! I'm trying to implement a event that fires an UDT which contains another UDT. I have some doubts and questions. Here is the idl code:
//------------------------------------------------------------------------ typedef enum { S1_item1 = 0, // and more ... }enumSample1; //------------------------------------------------------------------------ typedef enum { s2_item1 = 100, // and more ... }enumSample2; //------------------------------------------------------------------------ typedef struct { BSTR m_string1; // and many more... all BSTRs enumSample1 m_enum1; enumSample2 m_enum2; }st_NestedUDT; //------------------------------------------------------------------------ typedef enum { s3_item1 = -1, //<-- Is this ok? s3_item2 = 0, // and more ... }enumSample_3;
Q1: Is the s3_item1 ok? I read somewhere that enums are finally unsigned short.//------------------------------------------------------------------------ typedef struct { enumSample_3 m_eS; // And here is where I want tht st_NestedUDT. // st_NestedUDT m_stNested; // VARIANT m_vntNested; }st_MainStruct
Q2: Should be the nested UDT member a VARIANT or just a st_NestedUDT member? //------------------------------------------------------------------------ And the event is like:[id(2), helpstring("method OnNewOrder")] HRESULT OnNewOrder(st_MainStruct stInfo);
And finally, how should I encapsulate the stInfo in order to call Invoke? My first thought was:IRecordInfo * pRI; hr = GetRecordInfoFromGuids(LIBID_MyLibraryLib, 1, 0, 0, IID_st_Main_Struct, &pRI); if(FAILED(hr)) return hr; CComVariant avarParams[1]; avarParams[0].vt = VT_RECORD; avarParams[0].pvRecord = stInfo; avarParams[0].pRecInfo = pRI; CComVariant varResult; DISPPARAMS params = { avarParams, NULL, 1, 0 }; hr = pConnection->Invoke(2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, ¶ms, &varResult, NULL, NULL);
Q3: Is that right? Thank you in advance Gizzo -
Yet another fun C-puzzleNishant S wrote: BTW 100 printfs don't count why not? It is a solution, isn't it?
-
Handling COM events in VB for Applications:omg::wtf:
-
Who's a begginer, cause i am.Could you post a difficult one?
-
vb conceptI strongly recommend to read the thread "vb concept" in VB.NET forum.
-
vb conceptI can't stop laughing. :laugh::laugh::laugh::laugh:
-
QueryInterface callsHi again, IFeed is my interface and it is derived from IDispatch. The class that implements IFeed is CFeedCOM... i think i'm going to post it...
class CFeedCOM : public CReferenceCountedObject, public IFeed, public ISupportErrorInfo, public IConnectionPointContainerImpl, public CProxy_IFeedEvents
CReferenceCountedObject is taken from Lim Bio Liong (this guy have saved my life with his articles). The reason I wanted to know what happens under the hood of an object creation is: When a client fails (sometimes, not always) the next client trying to connect to the server doesn't follow the same steps that the previous one. Instead of querying all the interfaces posted in my previous message, my object is asked for: 1. IUnknown 2. IMarshal x2 3. {0000001B-0000-0000-C000-000000000046} 4. IID_IUnknown And now, something happens, and my object is released until m_cRef goes to zero. Then, QI is called for IManagedObject, m_cRef is incremented to 2, and again released until zero. This causes the destruction of my object of course what I'm trying to avoid. I don't know if I explained the problem. I only want to know what is happening there. Thanks for answering. Best regards, Gizzo. -
QueryInterface callsHi! I have observed that when a COM object is created its QI method is called for the following interfaces: 1. IUnknown 2. IMarshal x2 3. {0000001B-0000-0000-C000-000000000046} (IdentityUnmarshal ??) 4. IUnknown 5. ISdtMarshalInfo 6. IExternalConnection 7. {4C1E39E1-E3E3-4296-AA86-3C938D896E92} :wtf: 8. IManagedObject 9. IConnectionPointContainer x2 10.{1C73A30-2A1C-11CE-ADE5-00AA0044773D} :sigh: 11. IFeed (this is my interface) 12. {1C73A30-2A1C-11CE-ADE5-00AA0044773D} 13. IFeed Could any of you explain where these calls come from? Could be SCM doing his things? Proxy/Stub related? :confused: Thanks in advance Gizzo
-
Flippin coinsyaddaYoda wrote: we flip a coin 1000 times, then in a perfect enviroment 500 should be heads and 500 should be tails In a perfect enviroment, and under the same conditions you will have 1000 / 0.
-
Is it possible to release a COM object from the server?Is it possible to do exactly a client does when it releases a COM object, but from the server?