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. Problem in using com (not have .h file)

Problem in using com (not have .h file)

Scheduled Pinned Locked Moved COM
csharphelpquestionc++com
9 Posts 3 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.
  • M Offline
    M Offline
    Manish_Home
    wrote on last edited by
    #1

    Hi, I have a already created COM :^) (.dll file only) which was used in c#.net code but i have to use it in C++ code :confused: :confused: . I dont have .h file for this COM,had only dll file. Can Anyone help me in : How can i use this COM im my c++ code :doh: ?? Thanx in advance :)

    Manish

    S 1 Reply Last reply
    0
    • M Manish_Home

      Hi, I have a already created COM :^) (.dll file only) which was used in c#.net code but i have to use it in C++ code :confused: :confused: . I dont have .h file for this COM,had only dll file. Can Anyone help me in : How can i use this COM im my c++ code :doh: ?? Thanx in advance :)

      Manish

      S Offline
      S Offline
      Steve S
      wrote on last edited by
      #2

      You can use #import to get wrapper classes for the stuff implemented, providing that the DLL has a typelibrary embedded in it.

      Steve S Developer for hire

      M 1 Reply Last reply
      0
      • S Steve S

        You can use #import to get wrapper classes for the stuff implemented, providing that the DLL has a typelibrary embedded in it.

        Steve S Developer for hire

        M Offline
        M Offline
        Manish_Home
        wrote on last edited by
        #3

        Thanx Steve:) Did u mean i should call getprocaddress on all functions i needed from that dll and make a wrapper around those functions...

        Manish

        P 1 Reply Last reply
        0
        • M Manish_Home

          Thanx Steve:) Did u mean i should call getprocaddress on all functions i needed from that dll and make a wrapper around those functions...

          Manish

          P Offline
          P Offline
          prasad_som
          wrote on last edited by
          #4

          You need to use #import "yourdll.dll" statement in your code. Doing so, .tlh, and .tli will be generated in debug/release folder. You can use .tlh as header.

          Prasad Notifier using ATL | Operator new[],delete[][^]

          M 1 Reply Last reply
          0
          • P prasad_som

            You need to use #import "yourdll.dll" statement in your code. Doing so, .tlh, and .tli will be generated in debug/release folder. You can use .tlh as header.

            Prasad Notifier using ATL | Operator new[],delete[][^]

            M Offline
            M Offline
            Manish_Home
            wrote on last edited by
            #5

            Thanx prasad :) I have used #import "mydll.dll" in my code but it giving error as "fatal error C1083: Cannot open type library file: 'mydll.dll': Error loading type library/DLL" Any alternative do you want to suggest,i think type library is not embeded in this dll...

            Manish

            P 1 Reply Last reply
            0
            • M Manish_Home

              Thanx prasad :) I have used #import "mydll.dll" in my code but it giving error as "fatal error C1083: Cannot open type library file: 'mydll.dll': Error loading type library/DLL" Any alternative do you want to suggest,i think type library is not embeded in this dll...

              Manish

              P Offline
              P Offline
              prasad_som
              wrote on last edited by
              #6

              You need to give, full path, mentioning "\\".

              Prasad Notifier using ATL | Operator new[],delete[][^]

              M 1 Reply Last reply
              0
              • P prasad_som

                You need to give, full path, mentioning "\\".

                Prasad Notifier using ATL | Operator new[],delete[][^]

                M Offline
                M Offline
                Manish_Home
                wrote on last edited by
                #7

                I ve tried all combinations with #import. If i delete this dll then it shows no such file menas it currectly points to this dll. Any sugestions or alternative??

                Manish

                P 1 Reply Last reply
                0
                • M Manish_Home

                  I ve tried all combinations with #import. If i delete this dll then it shows no such file menas it currectly points to this dll. Any sugestions or alternative??

                  Manish

                  P Offline
                  P Offline
                  prasad_som
                  wrote on last edited by
                  #8

                  Is type library for same dll is not there?

                  Prasad Notifier using ATL | Operator new[],delete[][^]

                  M 1 Reply Last reply
                  0
                  • P prasad_som

                    Is type library for same dll is not there?

                    Prasad Notifier using ATL | Operator new[],delete[][^]

                    M Offline
                    M Offline
                    Manish_Home
                    wrote on last edited by
                    #9

                    no!! i was having only dll with me,how can i use that dll then??

                    Manish

                    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