I have an ATL/COM implementation of an interface, which I need to instantiate in my main code and pass to another COM object. This implementation is in C++.
From my main C++ code, I would like to access directly to the object (not through the COM port), and access class members and methods directly.
I think that the way to go is to add DECLARE_NO_REGISTRY() in the ATL/COM class; then call myCOMClass:CreateObject() instead of CoCreateInstance; but I do not know how to use this (and did not find any example).
I tried several combinations with no success.
In my main code:
//I added this line to call the lib directly
#include "comClass\StdAfx.h"
#include "comClass\comClass_i.c"
#include "comClass\comClass.h"
//I removed this line to bypass COM
//#import "comClass\comClass.dll"
//What can I put here to replace this block, bypass COM
//and being able to access class members??
CoInitialize(NULL);
comClassInterface *myObject = NULL;
HRESULT hr = ::CoCreateInstance(__uuidof(comClass),
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(comClassInterface),
(void**)&myObject);