ATL COM object..
-
Hi, I have the COM object "MyObj" which is inheriting from Interface "IX". This I can simply add "ATL simple object" through wizard. My qestion is I want to add one more Interface "IY" to the same object. This is posible thorugh wizard or do I need to add all the stuff manually ?? Thanks & Regards, Siva
-
Hi, I have the COM object "MyObj" which is inheriting from Interface "IX". This I can simply add "ATL simple object" through wizard. My qestion is I want to add one more Interface "IY" to the same object. This is posible thorugh wizard or do I need to add all the stuff manually ?? Thanks & Regards, Siva
I think you simply add the new ATLclass from New Class Wizards Knock out 'T' from CAN'T , You 'CAN' if you think you 'CAN' :cool:
-
I think you simply add the new ATLclass from New Class Wizards Knock out 'T' from CAN'T , You 'CAN' if you think you 'CAN' :cool:
Hi Laxman, Thanks for your reply, think you are not clear with the question, I dont want to add new class for my new Interface. I will just explain with example. My ATL class is "TestATLClassIX" which is inheriting IX and on same class I want to implemnet inter face "IY". I dont want to create a new class and derive from IY , again it goes to other ATL object. class TestATLClassIX : public IX, public IY { } This is posible through wizard ?? Thanks, Siva
-
Hi Laxman, Thanks for your reply, think you are not clear with the question, I dont want to add new class for my new Interface. I will just explain with example. My ATL class is "TestATLClassIX" which is inheriting IX and on same class I want to implemnet inter face "IY". I dont want to create a new class and derive from IY , again it goes to other ATL object. class TestATLClassIX : public IX, public IY { } This is posible through wizard ?? Thanks, Siva
Yes, Right click on the class select implement interface and select your typelib from the list if it is not present into the list then browse and select the path where it present that's enough. hope it is correct now.;) Knock out 'T' from CAN'T , You 'CAN' if you think you 'CAN' :cool:
-
Yes, Right click on the class select implement interface and select your typelib from the list if it is not present into the list then browse and select the path where it present that's enough. hope it is correct now.;) Knock out 'T' from CAN'T , You 'CAN' if you think you 'CAN' :cool:
Hi, Thanks for your info. Again if I right click and select "Implement interface" option it is asking Type Library info. I don't have any type libray stuff. But my question is very simple. Just I create a simple ATL object using wizard ( Simple object option ) let say it as "CMyATLObj" for this I gave interface "IMyATLObj". Now my component is ready. Just I want to add new Interface "IMyATLObj2" and implementaiton I want to porive in same object. Bottom line is my ATL object is going to inherit from two interfaces. is ther any way to do this by wizard or I need to edit all the files manually. Thanks, Siva
-
Hi, Thanks for your info. Again if I right click and select "Implement interface" option it is asking Type Library info. I don't have any type libray stuff. But my question is very simple. Just I create a simple ATL object using wizard ( Simple object option ) let say it as "CMyATLObj" for this I gave interface "IMyATLObj". Now my component is ready. Just I want to add new Interface "IMyATLObj2" and implementaiton I want to porive in same object. Bottom line is my ATL object is going to inherit from two interfaces. is ther any way to do this by wizard or I need to edit all the files manually. Thanks, Siva
See the following Links Help me[^]
Siva Sankar Koyi wrote:
Just I want to add new Interface "IMyATLObj2" and implementaiton I want to porive in same object.
Do you want to add the existing interface ??? if yes ,then for every com object .tlb file is generated that file is the Typelibrary steps to implement interface: implement interface->click typelib->select the library name/browse from file. -> ok -> select the interfaces from the list->ok done. Knock out 't' from can't, You can if you think you can :cool:
-
Hi, Thanks for your info. Again if I right click and select "Implement interface" option it is asking Type Library info. I don't have any type libray stuff. But my question is very simple. Just I create a simple ATL object using wizard ( Simple object option ) let say it as "CMyATLObj" for this I gave interface "IMyATLObj". Now my component is ready. Just I want to add new Interface "IMyATLObj2" and implementaiton I want to porive in same object. Bottom line is my ATL object is going to inherit from two interfaces. is ther any way to do this by wizard or I need to edit all the files manually. Thanks, Siva
You mean You want just a class which supports two interfaces rite? Loka Samastha Sukhino Bhavanthu..!!! ( May all beings be happy and free )
-
You mean You want just a class which supports two interfaces rite? Loka Samastha Sukhino Bhavanthu..!!! ( May all beings be happy and free )
Yes..I want my component should be support two interfaces, can I do with wizard..in ATL.. Thanks, Siva
-
Yes..I want my component should be support two interfaces, can I do with wizard..in ATL.. Thanks, Siva
Hi Siva, To do that, you can add a class like what you normally do. Thereafter is the tricky part, to remove the class and leave the interface around. To do that, in the idl file remove the code below for your second class. [ uuid(8D1E05B3-F610-4450-984E-4DCC4D2442E5), helpstring("SubClass1 Class") ] coclass SubClass1 { [default] interface ISubClass1; }; In your second class's header file, remove the 2 lines below. The second line will remove unnecessary register entry. public CComCoClass, DECLARE_REGISTRY_RESOURCEID(IDR_SUBCLASS1) In the main cpp file, remove this line OBJECT_ENTRY(CLSID_SubClass1, CSubClass1) If I do not remember wrongly that will be it, 2 interface in one COM object. I had done this in one of my DLL and it works. But if I do not remember wrongly again, you will not be able to see your second interface in VB or .Net whichever the client u are using. What I did, I had to pass the interface out. Hence I will see the interface like this in VB. dim a as FirstClass a.SecondClass.method() Hope I got your question right as I had also spend a lot of time on something like that.