Fax Software

Community Forums

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2733
    Anonymous
    Member

    I am trying to use WinFax DDE from
    a CBuilder6.0 application. I am using WinFax Pro ver10.03 with Windows XP. When I try to initiate a DDE I am unable to set the Hot ADvise Loop. I am not able to assign the DDEItem “sendfax” and the like. I am able
    to receive fax using connection through “FAXMNG32|CONTROL”, as it does
    not need to connect to any DDE Item . Please help

    #4676
    Anonymous
    Member

    @Renju wrote:

    I am trying to use WinFax DDE from
    a CBuilder6.0 application. I am using WinFax Pro ver10.03 with Windows XP. When I try to initiate a DDE I am unable to set the Hot ADvise Loop. I am not able to assign the DDEItem “sendfax” and the like. I am able
    to receive fax using connection through “FAXMNG32|CONTROL”, as it does
    not need to connect to any DDE Item . Please help

    10.03 should work with Windows XP and DDE. I would recommend posting the code you are using

    #4677
    Anonymous
    Member

    Thanks for replying to the query. Below is the entire code added in the buttonClick function for Sending Fax. The Connect Mode selected for the DdeClientConv1 control in the Object Inspector is “ddeAutomatic”. Please help

    AnsiString fillcover, cover,attach, showsend,resolution,faxui;
    AnsiString coverpage = “C:Program FilesWinFaxCoverBasic1.cvp”;
    AnsiString covertext = “PCLT Registration”;
    AnsiString attachment = “C:Program FilesWinFaxData165001.FXR”;

    AnsiString receipient = AnsiString(“recipient(“)
    + ContactFaxLabel->Caption + “,”
    + Now().CurrentDate() + “,”
    + Now().CurrentTime()+ “,”
    + CustomerNameLabel->Caption + “,”
    + ManagerLabel->Caption + “,”
    + “PCLT Registration” + “,”
    + “Registration Key Code” + “,”
    + ” “+ “,” + “Fax”+ “)”;
    //DdeClientItem1
    DdeClientConv1->DdeService = “FAXMNG32”;
    DdeClientConv1->DdeTopic = “CONTROL”;
    //DdeClientConv1->OpenLink();
    if(!DdeClientConv1->ExecuteMacro(“GoIdle”,False))
    {
    Application->MessageBoxA(“GoIdle Failure”,”CONTROL”,MB_OK);
    }

    DdeClientConv1->DdeService = “FAXMNG32”;
    DdeClientConv1->DdeTopic = “TRANSMIT”;
    DdeClientItem1->DdeItem = “sendfax”;
    //DdeClientConv1->ConnectMode = ddeAutomatic;
    if(DdeClientConv1->StartAdvise())
    {
    Application->MessageBox(“Start advise “,”TRANSMIT”,MB_OK);
    }
    DdeClientItem1->Text = receipient;
    if(DdeClientConv1->PokeData(DdeClientItem1->DdeItem,
    DdeClientItem1->Text.c_str()))
    {
    Application->MessageBox(“Poke recipient”,”TRANSMIT”,MB_OK);
    }
    cover = AnsiString(“setcoverpage(“)+ “”” + coverpage + “”” + “)”;
    DdeClientItem1->Text = cover;
    if(DdeClientConv1->PokeData(DdeClientItem1->DdeItem,
    DdeClientItem1->Text.c_str()))
    {
    Application->MessageBox(“Setcover success”,”TRANSMIT”,MB_OK);
    }

    fillcover = AnsiString(“fillcoverpage(“) + “”” +covertext + “”” + “)”;
    DdeClientItem1->Text = fillcover;
    if(DdeClientConv1->PokeData(DdeClientItem1->DdeItem,
    DdeClientItem1->Text.c_str()))
    {
    Application->MessageBox(“FillCover success”,”TRANSMIT”,MB_OK);
    }
    attach = AnsiString(“attach(“) + “”” + attachment + “”” + “)”;
    DdeClientItem1->Text = attach;
    if(DdeClientConv1->PokeData(DdeClientItem1->DdeItem,
    DdeClientItem1->Text.c_str()))
    {
    Application->MessageBox(“Attach success”,”TRANSMIT”,MB_OK);
    }
    showsend = “showsendscreen(“”1″”)”;
    DdeClientItem1->Text = showsend;
    if(DdeClientConv1->PokeData(DdeClientItem1->DdeItem,
    DdeClientItem1->Text.c_str()))
    {
    Application->MessageBox(“Show send success”,”TRANSMIT”,MB_OK);
    }
    resolution = “resolution(“”HIGH””)”;
    DdeClientItem1->Text = resolution;
    if(DdeClientConv1->PokeData(DdeClientItem1->DdeItem,
    DdeClientItem1->Text.c_str()))
    {
    Application->MessageBox(“Resolution success”,”TRANSMIT”,MB_OK);
    }
    faxui = “SendfaxUI”;
    DdeClientItem1->Text = faxui;
    if(DdeClientConv1->PokeData(DdeClientItem1->DdeItem,
    DdeClientItem1->Text.c_str()))
    {
    Application->MessageBox(“Sendfaxui success”,”TRANSMIT”,MB_OK);
    }

    DdeClientConv1->DdeService = “FAXMNG32”;
    DdeClientConv1->DdeTopic = “CONTROL”;
    //DdeClientConv1->OpenLink();
    if(DdeClientConv1->ExecuteMacro(“GoActive”,TRUE))
    {
    Application->MessageBox(“GoActive success”,”Control”,MB_OK);
    }

    #4678
    Anonymous
    Member

    NOTE: The elements of the string passed to WinFax must be delineated exactly as illustrated,
    including the quotation marks, commas and parentheses. You may have to add CHr$(34) — ASCII double quote — values to your string, or double up the quotes (“”,””).

    Code Sample

    DDEPoke ChanNum, “SendFaxâ€

    #4679
    orion7
    Member

    Automatic faxing with C++ Builder from commandline: wfx «faxnummber» «recipient» «attachment_path»
    You must start WinFax Controller before faxing!

    //
    

    void __fastcall Tfwfx::FormCreate(TObject *Sender)
    {
     // You can add more parameters as you need
     if (ParamCount()>0) {
       faxnumber = ParamStr(1); faxrecipient = ParamStr(2); attachment = ParamStr(3);
     }
     if (faxnumber!="") { SendFax(); Sleep(1000); Application->Terminate(); }
    }
    //

    void Tfwfx::SendFax(void)
    {
     //
     coverpage = "C:/Program Files/Symantec/WinFax/Cover/Basic1.cvp";
     covertext = "CovertText";
     faxreccomp = "MyCompany";
     faxsubject = "FaxSubject";
     //if(faxnumber=="") faxnumber = "123456789"; // Default Fax number
     //if(faxrecipient=="") faxrecipient = "Recipient"; // Default Fax recipient
     //if(attachment=="") attachment = "C:/faxdoc.doc"; // Default Fax attachment if any

     receipient = AnsiString("recipient(")
       + """ + faxnumber + """ + ",,,," //  Fax number (delete one comma if you uncomment some commented line!
       //+ """ + FormatDateTime("hh:nn:ss", Time())  + """ + "," // Time (Optional)
       //+ """ + FormatDateTime("dd/mm/yy", Date()) + """ + ","  // Date (Optional)
       + """ + faxrecipient + """ + "," // Recipient Name (Optional)
       + """ + faxreccomp + """ + ","  // Company Name (Optional)
       + """ + faxsubject + """ + ",,,"  // Subject (Optional)
       //+ """ + "" + """ + "," // Key words (Optional)
       //+ """ + "" + """ + "," // Billing code (Optional)
       + """ + "Fax" + """ // Mode
       + ")";
     //
     //DdeClientConv1->ConnectMode = ddeManual; // Must be set in Object Inspector!
     //DdeClientConv1->DdeService = "FAXMNG32"; // Must be set in Object Inspector!
     //DdeClientConv1->DdeTopic = "CONTROL"; // Must be set in Object Inspector!
     DdeClientConv1->OpenLink();

     if(!DdeClientConv1->ExecuteMacro("GoIdle",false)) Application->MessageBoxA("GoIdle Failure","CONTROL",MB_OK);
     Sleep(1000);

     DdeClientConv1->DdeTopic = "TRANSMIT";
     DdeClientItem1->DdeItem = "SendFax";

     if(!DdeClientConv1->StartAdvise()) Application->MessageBox("Start advise failure","TRANSMIT",MB_OK);
     Sleep(1000);

     // Setting Recipient
     DdeClientItem1->Text = receipient;
     if(!DdeClientConv1->PokeData("SendFax", receipient.c_str())) Application->MessageBox("Poke recipient failure","TRANSMIT",MB_OK);
     Sleep(1000);

     // Setting Coverpage (Optional)
     cover = AnsiString("setcoverpage(")+ """ + coverpage + """ + ")";
     DdeClientItem1->Text = cover;
     if(!DdeClientConv1->PokeData("SendFax", cover.c_str())) Application->MessageBox("Setcover failure","TRANSMIT",MB_OK);
     Sleep(1000);

     // Filling Coverpage (Optional)
     fillcover = AnsiString("fillcoverpage(") + """ +covertext + """ + ")";
     DdeClientItem1->Text = fillcover;
     if(!DdeClientConv1->PokeData("SendFax", fillcover.c_str())) Application->MessageBox("FillCover failure","TRANSMIT",MB_OK);
     Sleep(1000);

     // Attaching document (Optional)
     attach = AnsiString("attach(") + """ + attachment + """ + ")";
     DdeClientItem1->Text = attach;
     if(!DdeClientConv1->PokeData("SendFax", attach.c_str())) Application->MessageBox("Attach failure","TRANSMIT",MB_OK);
     Sleep(1000);

     // Setting Sendscreen
     showsend = AnsiString("showsendscreen(") + ""0"" + ")";
     DdeClientItem1->Text = showsend;
     if(!DdeClientConv1->PokeData("SendFax", showsend.c_str())) Application->MessageBox("Show send failure","TRANSMIT",MB_OK);
     Sleep(1000);

     // Setting Resolution
     resolution = AnsiString("resolution(") + ""HIGH"" + ")";
     DdeClientItem1->Text = resolution;
     if(!DdeClientConv1->PokeData("SendFax", resolution.c_str())) Application->MessageBox("Resolution set failure","TRANSMIT",MB_OK);
     Sleep(1000);

     // Setting UI
     faxui = "SendfaxUI";
     DdeClientItem1->Text = faxui;
     if(!DdeClientConv1->PokeData("SendFax", faxui.c_str())) Application->MessageBox("Sendfaxui failure","TRANSMIT",MB_OK);
     Sleep(1000);

     // Sending Fax
     DdeClientConv1->DdeTopic = "CONTROL";
     if(!DdeClientConv1->ExecuteMacro("GoActive",true)) Application->MessageBox("GoActive failure","Control",MB_OK);
     Sleep(1000);
     DdeClientConv1->CloseLink();
    }
    //

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.