Powerbuilder COM+ generated DLL cannot be invoked from C++ ( Visual Studio 2012 )

266 Views Asked by At

We have developed a COM+ DLL (pb125com.dll) using powerbuilder 12.5 NVOs. We want to call these classes from C++ in VS2012. However we have the following issue when trying to run the C++ code

First-chance exception at 0x74DEC41F in Project1.exe: Microsoft C++ exception: _com_error at memory location 0x0021F884. The program '[6544] Project1.exe' has exited with code 1 (0x1).

The code part is :

#import "F:\test\pb125com.dll"

int main(int argc, TCHAR* argv[], TCHAR* envp[])
{
    pb125com::In_ops_routerPtr obj;

    obj.CreateInstance(__uuidof(pb125com::COClass_n_ops_router));
    try
    {
        obj->of_request1(2);
    } catch (_com_error e) {
    printf("Error1: %ls\n", (wchar_t*)e.Description());
    printf("Error2: %ls\n", (wchar_t*)e.ErrorMessage());
    }
    return 1;
}

Any ideas ?

Thank you in advance

0

There are 0 best solutions below