How to get a function from an ATL COM dll.
-
I have an ATL com dll and i want to get a function from it. The question is what is the syntax. Lets say the name of my dll is: Test and the name of my function is getName ?.
-
I have an ATL com dll and i want to get a function from it. The question is what is the syntax. Lets say the name of my dll is: Test and the name of my function is getName ?.
The syntax... the syntax of what? The syntax of the function? Do you mean the function prototype, do you need to know the function's prototype? Or perhaps you want to know how to go about calling that function. Please clarify. Regards, Alvaro
Give a man a fish, he owes you one fish. Teach a man to fish, you give up your monopoly on fisheries.
-
The syntax... the syntax of what? The syntax of the function? Do you mean the function prototype, do you need to know the function's prototype? Or perhaps you want to know how to go about calling that function. Please clarify. Regards, Alvaro
Give a man a fish, he owes you one fish. Teach a man to fish, you give up your monopoly on fisheries.
I want to know how to call the function.
-
I want to know how to call the function.
You'd do it the same way you call any COM method. First you need to get a hold of the COM object, and then you can call its method. There are several alternatives: - Import the DLL's type library into your project. Look at the
#import
directive. - Use the Class Wizard to add a class wrapper for the COM object. Open Class Wizard/Add Class/From a type library. - Use one of the template classes likeCComQIPtr
(ATL), orcom_ptr_t
. - Use theCoCreateInstance
API. If my memory serves me right the first option is the easiest -- look into it. Good luck! Regards, Alvaro
Give a man a fish, he owes you one fish. Teach a man to fish, you give up your monopoly on fisheries.
-
You'd do it the same way you call any COM method. First you need to get a hold of the COM object, and then you can call its method. There are several alternatives: - Import the DLL's type library into your project. Look at the
#import
directive. - Use the Class Wizard to add a class wrapper for the COM object. Open Class Wizard/Add Class/From a type library. - Use one of the template classes likeCComQIPtr
(ATL), orcom_ptr_t
. - Use theCoCreateInstance
API. If my memory serves me right the first option is the easiest -- look into it. Good luck! Regards, Alvaro
Give a man a fish, he owes you one fish. Teach a man to fish, you give up your monopoly on fisheries.
thx.