I have an Executable ActiveX component created with VB 6, consumed by an application made with C++ (32bits) that Instantiate it.
Everything works fine under win 7, XP, Win 2003 32 bits, but when I run under Windows 7 or windows 2012 64 bits I got “-2147221503 (0x80040001) Invalid advise flags”
I’m using VS2008 ….
C++ code :
UINT test_exe_ativex_call()
{
HRESULT hr;
CLSID clsid;
_Arquivo *cls = NULL;
CoInitializeEx(NULL, COINIT_MULTITHREADED);
hr = CLSIDFromProgID(OLESTR("ACTIVEX.Class"), &clsid);
hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER, __uuidof(_Arquivo), (LPVOID*) &cls);
return 1;
}
… my stdafx.h has the reference for the executable activeX:
# import "ACTIVEX.tlb"
using namespace ACTIVEX;
The error happens executing CoCreateInstance.
I debugged my vb 6 code trying to understand and I realize that the main block of my activex module “Sub Main()” is executed well but when it is supposed to call my Class “Private Sub Class_Initialize()” the C++ program receive the error “0x80040001 Invalid advise flags”.
The same code works perfectly fine when I run on any 32bits windows version.
User contributions licensed under CC BY-SA 3.0