none
Creating wrapper for com object (Fax Server) RRS feed

  • General discussion

  • I have an application which I need to get to communicate with the microsoft fax server. Unfortunately it has its own proprietary language, which does not play that nicely with com objects (which is the default way for passing data to the MS fax server). It does, however, play nicely with .net objects/dll's. So the solution seems obvious - create a .net wrapper for the fax server.

    To do this, I have done the following steps:

    1. Created a new C# .NET 2 Class library in visual studio 2010.
    2. Added "Microsoft Fax Service Extended COM Type Library" as a reference. (It shows as FAXCOMEXLib, while creating a "Interop.FAXCOMEXLib.dll" file).
    3. Created the appropriate properties and methods in the library class.

    This gives me a "FaxServerWrapper" class/dll. When I compile, the files "FaxServerWrapper.dll", "Interop.FAXCOMEXLib.dll" and "FaxServerWrapper.pdb".

    In addition, I have created a simple test app. A windows forms application, which uses the FaxServerWrapper as a resource, and calls it.

    When I test this on my test application, it seems to work. I cant actually send a fax, but the error indicates it is trying to connect, but cannot find the fax server.

    When I copy this to the clients environment, it does not work. I run the test, the winforms test app opens up, but when I click on "Send Fax", I get the following error:

    Unable to cast COM object of type 'FAXCOMEXLib.FaxDocumentClass' to interface type 'FAXCOMEXLib.IFaxDocument2'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{E1347661-F9EF-4D6D-B4A5-C0A068B65CFF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

    I'm quite sure that both environments (my dev and the clients machine I'm testing on) have the fax server installed. In any case, I have tried setting "Isolated" to true, which then includes the com dll in the output (fxscomex.dll), but this did not help either. (I get different errors)

    So - why does it work locally, but not on the clients machine? What would cause the difference?

    I have included a screenshot below of the project, in case any there are any obvious mistakes. I have tried a few things, and then commented them out when they did not help.

    Thanks.

    Thursday, August 1, 2013 12:52 AM

All replies

  • Hi,

    Thank you for posting in the MSDN forum. It seems that it is not the correct forum for this issue, since this forum is to discuss Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.

    I am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum. Thanks for your understanding.

    Have a nice day,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, August 2, 2013 6:00 AM
  • Hi, fweeee

    Could you create a new thread here because of pasting a long time?

    Thanks for your understanding!

    Best Regard!


    Wednesday, August 7, 2013 12:09 PM
  • Hi, fweeee

    Have it worked well? If so, Please excute me to close this thread as a discussion. If it is still failed to work, please create a new thread and we will try our best to help you! this thread is so early that the most of programmers won't join in.

    Best Regard!

    Friday, August 9, 2013 1:35 AM
  • Xiaoliang,

    I have not had much of a chance to investigate this further yet. But it looks like it is not getting much attention, so I guess we can close it, and I'll start a new thread should I need to investigate again.

    Friday, August 9, 2013 4:02 AM