I need some help about COM..
-
I am new to COM technology. I am tryimg to write my first componant but it gives error. i.e error in loadimg library file Pl'z go through the code........ I gave proper address of unknwn file ,still it gives error. #import "unknwn.idl" [ object, uuid(C21D0200-2FB6-11d2-8952-444553540000), helpstring(“Car driving”) ] interface ICar : IUnknown { HRESULT SetSpeed( [in] long nSpeed ); }; [ object, uuid(C21D0200-2FB6-11d2-8952-444553540000), helpstring(“Engine control”) ] interface IEngine : IUnknown { HRESULT Start(); HRESULT Stop(); }; [ uuid(310C97F4-3ABE-11d2-915E-52544C004D83), version(1.0), helpstring(“Car library 1.0”) Distributed Computing Topics PART V 816 ] library YourLib { importlib “stdole2.tlb” importlib “stdole32.tlb” [ uuid(310C97D0-3ABE-11d2-915E-52544C004D83}, helpstring(“Car class”) ] coclass Car { [default] interface ICar; interface IEngine; }; }; Yuwraj
-
I am new to COM technology. I am tryimg to write my first componant but it gives error. i.e error in loadimg library file Pl'z go through the code........ I gave proper address of unknwn file ,still it gives error. #import "unknwn.idl" [ object, uuid(C21D0200-2FB6-11d2-8952-444553540000), helpstring(“Car driving”) ] interface ICar : IUnknown { HRESULT SetSpeed( [in] long nSpeed ); }; [ object, uuid(C21D0200-2FB6-11d2-8952-444553540000), helpstring(“Engine control”) ] interface IEngine : IUnknown { HRESULT Start(); HRESULT Stop(); }; [ uuid(310C97F4-3ABE-11d2-915E-52544C004D83), version(1.0), helpstring(“Car library 1.0”) Distributed Computing Topics PART V 816 ] library YourLib { importlib “stdole2.tlb” importlib “stdole32.tlb” [ uuid(310C97D0-3ABE-11d2-915E-52544C004D83}, helpstring(“Car class”) ] coclass Car { [default] interface ICar; interface IEngine; }; }; Yuwraj
Yuwraj, please note that messages posted in these forums are coming from real persons and not compilers. Hence do not post messages that are kind of the-following-code-contains-errors-please-find-them without any explanation. Describe the error, what environment you are using and what you are trying to do and then, maybe, someone can provide you with some help. The more information you give about your problem, the more detailed help you can be given. This is also why your post has not been answered earlier. Now, about your code... Both IEngine and ICar have the same UUID in the code snippet you posted. If this doesn't help you, post some more information about what errors you get when you're building. -- Roger
It's supposed to be hard, otherwise anybody could do it!
-
Yuwraj, please note that messages posted in these forums are coming from real persons and not compilers. Hence do not post messages that are kind of the-following-code-contains-errors-please-find-them without any explanation. Describe the error, what environment you are using and what you are trying to do and then, maybe, someone can provide you with some help. The more information you give about your problem, the more detailed help you can be given. This is also why your post has not been answered earlier. Now, about your code... Both IEngine and ICar have the same UUID in the code snippet you posted. If this doesn't help you, post some more information about what errors you get when you're building. -- Roger
It's supposed to be hard, otherwise anybody could do it!
LIBID and CLSIDs are equal too. Not that I think that will mean any problems. The two IIDs will however.
-
I am new to COM technology. I am tryimg to write my first componant but it gives error. i.e error in loadimg library file Pl'z go through the code........ I gave proper address of unknwn file ,still it gives error. #import "unknwn.idl" [ object, uuid(C21D0200-2FB6-11d2-8952-444553540000), helpstring(“Car driving”) ] interface ICar : IUnknown { HRESULT SetSpeed( [in] long nSpeed ); }; [ object, uuid(C21D0200-2FB6-11d2-8952-444553540000), helpstring(“Engine control”) ] interface IEngine : IUnknown { HRESULT Start(); HRESULT Stop(); }; [ uuid(310C97F4-3ABE-11d2-915E-52544C004D83), version(1.0), helpstring(“Car library 1.0”) Distributed Computing Topics PART V 816 ] library YourLib { importlib “stdole2.tlb” importlib “stdole32.tlb” [ uuid(310C97D0-3ABE-11d2-915E-52544C004D83}, helpstring(“Car class”) ] coclass Car { [default] interface ICar; interface IEngine; }; }; Yuwraj