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. using #import

using #import

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
3 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.
  • V Offline
    V Offline
    vijisu
    wrote on last edited by
    #1

    I wanted to import one active X control(.ocx) and start calling methods. in Visual C++. I understand we can do it by using #import "myocx.ocx" . Could anyone please give me complete example to do it?

    G 1 Reply Last reply
    0
    • V vijisu

      I wanted to import one active X control(.ocx) and start calling methods. in Visual C++. I understand we can do it by using #import "myocx.ocx" . Could anyone please give me complete example to do it?

      G Offline
      G Offline
      GeMe_Hendrix
      wrote on last edited by
      #2

      aaahhhh COM run for the hills. Truthfully this is my usually reaction. But FEAR NOT!!! Your dealing with an OCX file. Simply register the file on your system using regsvr32.exe. Then in the fabulous VC6 menu system 'Project', 'Add to Project', 'Components and Controls' then choose the Registered ActiveX Controls folder and select your component. This will automatically generate all the wrapper classes for you (up yours VB boys :laugh:) Then you can drag and drop on your new active control and get events, manipulate it whatever. #import is really used for interacting with ATL COM objects that are not ActiveX based.

      C 1 Reply Last reply
      0
      • G GeMe_Hendrix

        aaahhhh COM run for the hills. Truthfully this is my usually reaction. But FEAR NOT!!! Your dealing with an OCX file. Simply register the file on your system using regsvr32.exe. Then in the fabulous VC6 menu system 'Project', 'Add to Project', 'Components and Controls' then choose the Registered ActiveX Controls folder and select your component. This will automatically generate all the wrapper classes for you (up yours VB boys :laugh:) Then you can drag and drop on your new active control and get events, manipulate it whatever. #import is really used for interacting with ATL COM objects that are not ActiveX based.

        C Offline
        C Offline
        coralsnake_
        wrote on last edited by
        #3

        Hi , just an question from a novice like me : how to use #import in c programme ? not c++ is there an directive like it for c ? it's for use ADO in a c program thank you Adan that which hesitates is lost.

        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