locked
calling .NET COM object from MFC gives 0xE06D7363 error code RRS feed

  • Question

  • hi, please help with my problem. basically i have a C# class that i use through COM. when using visual basic as the client, i am able to call the functions without error. i use createobject method in making an instance of the C# object. but our project requires that i should use MFC, so i tried the following code:

        CString msg;
        MyServiceClient::_ServiceClient *com_ptr;
        CoInitialize(NULL);
        MyServiceClient::_ServiceClientPtr p(__uuidof(MyServiceClient::HelloService));

        com_ptr=p;

        com_ptr->Initialize();
        msg.Format("Message from web service: {0}",com_ptr->TestHello("asd"));
        MessageBox(msg);

     

    but my MFC application always crash.

    my VB code looks like this and it works

        Dim x As Object
        Dim lRet As Long
       
        Set x = CreateObject("MyServiceClient.ServiceClient")
        lRet = x.Initialize()
        If lRet = 0 Then
            MsgBox x.TestHello("asd")
        Else
            MsgBox "Error"
        End If

     

    do you guys have any idea what went wrong?

     

    Thursday, June 24, 2010 4:37 PM

Answers

  • I'd suggest to download and install the Debugging Tools for Windows Suite from here. Then make sure to set the symbol path correctly and reproduce the problem when running under WinDbg. Have a look at the call stack window which should give you some more clues. 0xE06D7363 is a generic VC exception that is raised with every "throw".

    -John

    • Marked as answer by SamAgain Friday, July 2, 2010 3:02 AM
    Saturday, June 26, 2010 10:08 AM