none
FAXCOMEX.DLL Example RRS feed

  • Question

  • Hi All,

    I am working on a application where I need to send a Fax from a C#.Net code.

    Primarily I used a "FAXCOMLib" which works fine for the local machine. Then I used that same code to send a Fax from a Multi - Functioned Device. If I mention a server IP or a MFD Fax name, it is throwing error saying, 

    "Cannot connect to fax server (-----). Grant permission to ASP.NET Machine Account to manage fax configuration under Printer and Fax, Fax properties | Fax security."

    I tried to give the permissions as per the blogs I did find. But no luck. I tried to give the wrong server name and run a code again, got the same error message. It looks like if it does not find a server, it throws this error. 

    On one of the blog I did find comments as, if you want send a Fax through a remote server in that case use "FAXCOMEXLib".

    Now I started looking at code samples for "FAXCOMEXLib". But now I started facing the problems of using this library.

    Its showing error at compiled time saying "Interop type 'FAXCOMEXLib.FaxDocumentClass' cannot be embedded. Use the applicable interface instead.".

    Is there anyone knows the example that I can refer for "FAXCOMEXLib".

    Also any suggestions, tips, recommendations will really help.

    Thanks.


    Kaps (MCPD)

    Monday, August 12, 2013 4:40 PM

Answers

  • Here is the example for using FAXCOMEXLIB,

    http://msdn.microsoft.com/en-us/library/windows/desktop/ms692936(v=vs.85).aspx

    And with respect to the error, here is how you can resolve it.

    http://blogs.msdn.com/b/mshneer/archive/2009/12/07/interop-type-xxx-cannot-be-embedded-use-the-applicable-interface-instead.aspx

    I hope this helps.


    Please mark this post as answer if it solved your problem. Happy Programming!

    Tuesday, August 13, 2013 5:52 AM
  •  

    Hi Kapi,

    Thanks for your reply.

    From your description, I think that you can check your configuration files and windows event log .I also research your error in  the following:

    Error 1:Fax Server is not accessible or the name/Ip is not correct. you can refer Managing Fax Server User Accounts and Groups ,Fax provides fax-related user accounts for privacy and management of faxes. Users can use accounts for accessing different types of fax services such as the local fax modem and a fax server.

    Error 1: The RPC server is unavailable, you can refer Troubleshooting "The RPC server is unavailable".

    In addition,you can refer this article: Fax Server Step-by-Step Guide   and   Fax Service   that  allows users to send and receive faxes from their desktop applications using either a local  fax device or a shared network fax device.

    Hope these help.


    Lilia Gong
    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 16, 2013 1:46 AM
    Moderator
  • Hi Kapi,

    Thanks for your reply.

    From your description,I think that you can capture  network package which was sent out by FAXCOMEXLib and TextFile or MS Word ,then you can compare the difference  between these two kinds of packages ,maybe FAXCOMEXLib didn't send any network packet at all or send packages with wrong format.

    Microsoft Network Monitor:http://www.microsoft.com/en-us/download/details.aspx?id=4865

    Hope these help.


    Lilia Gong

    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.



    Tuesday, August 20, 2013 3:24 PM
    Moderator
  • Hi Lilia,

    Thanks for the reply.

    I tried all the possible solutions, but it did not work. 

    Finally after talking with the other people(support guys), here is the conclusion,

    The device that I am trying to use for sending Fax is MFP. It is a printer and not a Fax.

    We can not configure Printer device as a Fax, even if we can send Fax manually using that device. 

    Sending Fax manually works as, the MFP is configured as a Printer. So to send Fax we send a Print to that device then device converts those print documents to Fax and send it.

    This is the same reason I was not able to configure that device as a Fax server. 

    Now to be able to send Fax,

    I will should have a server with modem which will directly connected to the telephone line. Then only this server can work as a Fax server. 

    Using this setup, I can send Fax from API - "FAXCOMLib".



    Kaps (MCPD)

    • Marked as answer by Kapil Khadgi Thursday, September 19, 2013 9:11 AM
    Thursday, September 19, 2013 9:11 AM

All replies

  • Here is the example for using FAXCOMEXLIB,

    http://msdn.microsoft.com/en-us/library/windows/desktop/ms692936(v=vs.85).aspx

    And with respect to the error, here is how you can resolve it.

    http://blogs.msdn.com/b/mshneer/archive/2009/12/07/interop-type-xxx-cannot-be-embedded-use-the-applicable-interface-instead.aspx

    I hope this helps.


    Please mark this post as answer if it solved your problem. Happy Programming!

    Tuesday, August 13, 2013 5:52 AM
  • Thanks Adavesh for the reply.

    Problem resolved for "Interop type 'FAXCOMEXLib.FaxDocumentClass' cannot be embedded. Use the applicable interface instead.".

    I just made one change in the property window "Embed Interop Types -> False" for FAXCOMEXLib. This resolved the problem.

    I tried to use code to connect to the MFP device to send Fax. 

    Here is the code,

      FaxServerClass objFaxServer = new FaxServerClass();

       objFaxServer.Connect("ServerName");

    While trying to connect to Fax server, its throwing error for "The RPC server is unavailable."

    If I am correct then, this error indicates that the Fax Server is not accessible or the name/Ip is not correct. 

    I further tried to make Fax server as Shared, gave permission to access this Fax to all the users including IUSR user. But no luck.

    The device that I am trying to use is a MFP(Multi Function Printer). Is there any specific settings that I am missing here? 

    I also dig down to check the actual error for "FAXCOMLib" while connecting to Fax server. Its a "Error HResult e_fail has been returned from a call to a COM component". 

    I do not understand what this error is indicating. 

    Is there any one can help to understand and resolve this issue.


    Kaps (MCPD)

    Tuesday, August 13, 2013 10:03 AM
  •  

    Hi Kapi,

    Thanks for your reply.

    From your description, I think that you can check your configuration files and windows event log .I also research your error in  the following:

    Error 1:Fax Server is not accessible or the name/Ip is not correct. you can refer Managing Fax Server User Accounts and Groups ,Fax provides fax-related user accounts for privacy and management of faxes. Users can use accounts for accessing different types of fax services such as the local fax modem and a fax server.

    Error 1: The RPC server is unavailable, you can refer Troubleshooting "The RPC server is unavailable".

    In addition,you can refer this article: Fax Server Step-by-Step Guide   and   Fax Service   that  allows users to send and receive faxes from their desktop applications using either a local  fax device or a shared network fax device.

    Hope these help.


    Lilia Gong
    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 16, 2013 1:46 AM
    Moderator
  • Thanks Lilia for the reply,

    I checked with the URL you shared.

    There are good details in it.

    The way the MFP is configured is allowing me to send a Fax manually. So I can open a text file or MS Office Word file and send a Fax. This means the Fax is configured correctly on the server. 

    Only my C# code is not able to connect to that Fax IP using FAXCOMEXLib. 

    Is it something that I am trying but its not possible using FAXCOMEXLib?

    Is the FAXCOMEXLib is not supported to send a Fax for MFP from C#?

    If I send a Fax to local machine, it goes to local windows fax application. I also tried to add a Fax Account to Windows Fax application. But I am unable to connect to Fax IP from "Connect To Fax Server on My Network" option. Is it not possible to add MFP IP in Fax Account?

    Any help?


    Kaps (MCPD)

    Monday, August 19, 2013 7:28 AM
  • Hi Kapi,

    Thanks for your reply.

    From your description,I think that you can capture  network package which was sent out by FAXCOMEXLib and TextFile or MS Word ,then you can compare the difference  between these two kinds of packages ,maybe FAXCOMEXLib didn't send any network packet at all or send packages with wrong format.

    Microsoft Network Monitor:http://www.microsoft.com/en-us/download/details.aspx?id=4865

    Hope these help.


    Lilia Gong

    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.



    Tuesday, August 20, 2013 3:24 PM
    Moderator
  • Hi Lilia,

    Thanks for the reply.

    I tried all the possible solutions, but it did not work. 

    Finally after talking with the other people(support guys), here is the conclusion,

    The device that I am trying to use for sending Fax is MFP. It is a printer and not a Fax.

    We can not configure Printer device as a Fax, even if we can send Fax manually using that device. 

    Sending Fax manually works as, the MFP is configured as a Printer. So to send Fax we send a Print to that device then device converts those print documents to Fax and send it.

    This is the same reason I was not able to configure that device as a Fax server. 

    Now to be able to send Fax,

    I will should have a server with modem which will directly connected to the telephone line. Then only this server can work as a Fax server. 

    Using this setup, I can send Fax from API - "FAXCOMLib".



    Kaps (MCPD)

    • Marked as answer by Kapil Khadgi Thursday, September 19, 2013 9:11 AM
    Thursday, September 19, 2013 9:11 AM