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