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. C / C++ / MFC
  4. How to import a namespace

How to import a namespace

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
4 Posts 2 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.
  • J Offline
    J Offline
    john5632
    wrote on last edited by
    #1

    Hi I have a dll file.But the interface is in dll also exist in oaidl.h file.Whenever i try to CreateInstance of the interface it recognise the .h file intreface. How can i resolve ambiguity. Can i use to namespace of dll file if yes please tell me how? Thanx in advance.

    T 1 Reply Last reply
    0
    • J john5632

      Hi I have a dll file.But the interface is in dll also exist in oaidl.h file.Whenever i try to CreateInstance of the interface it recognise the .h file intreface. How can i resolve ambiguity. Can i use to namespace of dll file if yes please tell me how? Thanx in advance.

      T Offline
      T Offline
      Tim Paaschen
      wrote on last edited by
      #2

      I guess that you are talking of a COM-DLL and the #import directive. In this case you can use the rename attribute. If the COM-DLL already provides a namespace the attribute rename-namespace may be useful, too.

      Regards, Tim

      J 1 Reply Last reply
      0
      • T Tim Paaschen

        I guess that you are talking of a COM-DLL and the #import directive. In this case you can use the rename attribute. If the COM-DLL already provides a namespace the attribute rename-namespace may be useful, too.

        Regards, Tim

        J Offline
        J Offline
        john5632
        wrote on last edited by
        #3

        But sir The main thing how can i know about the namespace the dll provide ?

        T 1 Reply Last reply
        0
        • J john5632

          But sir The main thing how can i know about the namespace the dll provide ?

          T Offline
          T Offline
          Tim Paaschen
          wrote on last edited by
          #4

          If I remember correctly, the default namespace matches the name of the library. Use the "OLE/COM Object Viewer" (you find it in the Tools menu of Visual Studio), browse to the according Type Library and open it. Somewhere you will find something like:

          [
          ...
          ]
          library SERVERLib
          {
          ...
          }

          In this case SERVERLib will be the default namespace.

          Regards, Tim

          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