I have run into a small problem using the Library. I am attempting to make a DLL using the MinGW compiler in C++ without .NET. I am basing this on the BCB5 example as it seems the most applicable to me (C++, no .NET). I am creating the handle to IPmacDevice this way:
IPmacDevice *g_idevice = NULL;
HRESULT result;
result = CoCreateInstance(CLSID_PmacDevice, NULL, CLSCTX_LOCAL_SERVER, IID_IPmacDevice, (void **)&g_idevice);
if(SUCCEEDED(result))
{
g_idevice->AddRef();
}
I then open the device.
short itemp;
VARIANT_BOOL success;
long d = 0;
g_idevice->Open(d, &success);
Device 0 has already been setup using PEWINPRO2 so I do not need SelectDevice at this time. At this point this function succeeds and returns VARIANT_TRUE. The trouble comes when I run this function:
wchar_t *answer = new wchar_t[256];
wchar_t *question = new wchar_t[256];
long d = 0;
long g_lasterror;
swprintf(question,L"TYPE");
g_idevice->GetResponseEx(d,question,VARIANT_FALSE,&answer,&g_lasterror);
It is here that I get a crash and an "Unknown signal" message from my debugger. Have I missed anything in using the library at this point?