Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. I need some help about COM..

I need some help about COM..

Scheduled Pinned Locked Moved COM
comhelpannouncement
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yuwraj
    wrote on last edited by
    #1

    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

    R M 2 Replies Last reply
    0
    • Y 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

      R Offline
      R Offline
      Roger Stoltz
      wrote on last edited by
      #2

      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!

      J 1 Reply Last reply
      0
      • R Roger Stoltz

        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!

        J Offline
        J Offline
        Jorgen Sigvardsson
        wrote on last edited by
        #3

        LIBID and CLSIDs are equal too. Not that I think that will mean any problems. The two IIDs will however.

        1 Reply Last reply
        0
        • Y 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

          M Offline
          M Offline
          Malli_S
          wrote on last edited by
          #4

          Hello Yuwraj ! When I objserved you code, I found two things : 1. you put same IID for both the interfaces 2. same ID for class and library. But actully all these are to be different. so, put different IDs for all the elements... :) - Malli...!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups