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. VERY newbie COM question

VERY newbie COM question

Scheduled Pinned Locked Moved COM
questioncomsysadminhelptutorial
5 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.
  • J Offline
    J Offline
    JDMoore
    wrote on last edited by
    #1

    Hi all, I know this is probably a stupidly simple question but if anyone can give me an answer or point me to a tutorial I'd appreciate it. I have created a COM object that plays animation files. What I need to be able to so is talk to the object from the server to play the next frame etc. How do I reference the COM object so I can use one of it's methods? Am I looking at this all wrong? Cheers for the help. James.

    M Y 4 Replies Last reply
    0
    • J JDMoore

      Hi all, I know this is probably a stupidly simple question but if anyone can give me an answer or point me to a tutorial I'd appreciate it. I have created a COM object that plays animation files. What I need to be able to so is talk to the object from the server to play the next frame etc. How do I reference the COM object so I can use one of it's methods? Am I looking at this all wrong? Cheers for the help. James.

      M Offline
      M Offline
      Mazdak
      wrote on last edited by
      #2

      1.import your dll into your project(you can do it in stdafx.h): #import"F:\ProjectVC++\ComTest0\Debug\ComTest0.dll" no_namespace 2.compile stdafx.cpp,then put two file with .tli,.tlh in your "DLL" directory 3. CoInitialize(NULL); { ITestComPtr pTest; HRESULT hr=pTest.CreateInstance(__uuidof(TestCom)); if(SUCCEEDED(hr)) { pTest->.... } } ::CoUninitialize(); I hope it was clear for you Mazy Don't Marry a Person You Can Live With... Marry Someone You Can Not Live Without

      1 Reply Last reply
      0
      • J JDMoore

        Hi all, I know this is probably a stupidly simple question but if anyone can give me an answer or point me to a tutorial I'd appreciate it. I have created a COM object that plays animation files. What I need to be able to so is talk to the object from the server to play the next frame etc. How do I reference the COM object so I can use one of it's methods? Am I looking at this all wrong? Cheers for the help. James.

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

        I forgot to say one point,the name of my interface is ITestCom,but when I want refrence pointer to it I HAVE TO add "Ptr" to the name of it,clear?good of cource this is one and,and you can find another ways to refrence COM object :) Mazy Don't Marry a Person You Can Live With... Marry Someone You Can Not Live Without

        1 Reply Last reply
        0
        • J JDMoore

          Hi all, I know this is probably a stupidly simple question but if anyone can give me an answer or point me to a tutorial I'd appreciate it. I have created a COM object that plays animation files. What I need to be able to so is talk to the object from the server to play the next frame etc. How do I reference the COM object so I can use one of it's methods? Am I looking at this all wrong? Cheers for the help. James.

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

          Again please forgive me for my bad memory,you can check COM/ATL part of codeproject,therre are some tutorials to help you:-D Mazy Don't Marry a Person You Can Live With... Marry Someone You Can Not Live Without

          1 Reply Last reply
          0
          • J JDMoore

            Hi all, I know this is probably a stupidly simple question but if anyone can give me an answer or point me to a tutorial I'd appreciate it. I have created a COM object that plays animation files. What I need to be able to so is talk to the object from the server to play the next frame etc. How do I reference the COM object so I can use one of it's methods? Am I looking at this all wrong? Cheers for the help. James.

            Y Offline
            Y Offline
            yamini
            wrote on last edited by
            #5

            There is other way of communicating with the component. Let Component:CMyComponent. Interface:IMyInterface. Now the code goes trhis way(inside the main if client is console else other suitable function.) ************************************************************ CoInitialize(NULL); HRESULT hr=CoCreateInstance(CLSID_CMyComponent,NULL,CLSCTX_LOCAL_SERVER/*Depends*/,IID_IMyInterface,(void**)&pMyInterface); //pMyInterface is a pointer to interface. pMyInterface->.... CoUninitialize(); ************************************************************ Let me know if u understood. Regards, Y.Yamini Devi.

            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