Simplest method to create COM object -VC++
Here i am going to write steps that i used to create a object of component and call the functions of that object.
i was just having the progid of that component and i supposed to call the function of that component.
in VB it is very simple to do. u need to just call a function "CreateObject(progID)" and start wrking with that object.
Eg:
ProgId : abc.application.1
dim obj = CreateObject("abc.application.1e");
done.
but in VC++ it is quite complicated to call the function or object creation.
but lets see i have done the task.
required header files:
#include
#include "Objbase.h"
CLSID clsid;
LPUNKNOWN punk;
LPDISPATCH pdisp;
OLECHAR FAR* szMember = _T("GetIpAddress");
DISPID dispid;
DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
OleInitialize(NULL);// if OLE isn't already loaded.
CLSIDFromProgID(_T("abc.application.1"), &clsid);
CoCreateInstance(clsid, NULL, CLSCTX_SERVER,IID_IUnknown,...