OpenSync

Home Forums OpenSync How to Execute OSRun from Delphi Program

This topic contains 6 replies, has 2 voices, and was last updated by  Yudel Rosales 4 months, 2 weeks ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #62743

    dennisbullocpa
    Participant

    From my end, I was able to run OSRun from command line (or DOS) and no worries all.

    But when I tried, running it from my Delphi program using the following procedure, no avail:

    procedure TfrmGTX.btnQuickBooksSyncClick(Sender: TObject);
    begin
    ShellExecute(0, PChar(‘open’), PChar(‘/k cd “C:\Program Files (x86)\Synergration\OpenSync\OSRun”
    MyTask’), nil, nil, SW_SHOW);
    end;

    I am not sure exactly what’s missing with this procedure or my procedure is a wrong approach in the first place. I believed there must be a correct way to call OSRun procedure from Delphi project.

    Any help would be greatly appreciated.

    Many thanks in advance!

    #62745

    Yudel Rosales
    Keymaster

    You should be able to shell it.

    #62758

    dennisbullocpa
    Participant

    Appreciate the swift response and guide me that shell is the way to go.

    However, after 2 days of trying to figure out no avail on my end.
    A very quick one, can you give me the sample of shell executing osrun?
    I can take it from there.

    Thanks again!

    #62763

    Yudel Rosales
    Keymaster

    vb.net code
    Shell(“Path on your computer” & “\OSRun.exe /CONNECT ” & s, vbNormalFocus)
    or you can uses
    Process.Start(“Path on your computer” & “\OSRun.exe”)

    I hope it helps you.

    Best Regards,

    #62774

    dennisbullocpa
    Participant

    Thanks Yudel. By the way, I am using Delphi. I’ll have to crack this vb.net code.
    Anyways, here’s my latest code. I am not sure if you could help me with this but trying my luck here.

    procedure TfrmGTX.btnQuickBooksSyncClick(Sender: TObject);
    var
    ExecuteResult : integer;
    Path : string;
    begin
    Path := IncludeTrailingPathDelimiter(ExtractFilePath(‘OSRun.exe’));
    ExecuteResult := ShellExecute(0, nil, PChar(Path + ‘cd C:\Program Files
    (x86)\Synergration\OpenSync\OSRun.exe a_Sales /Connect’), nil, nil,
    SW_SHOWNORMAL);
    case ExecuteResult of
    0 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: The
    operating system is out of memory or resources.’);
    2 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: The
    specified file was not found.’);
    3 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: The
    specified path was not found.’);
    5 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: Windows 95
    only: The operating system denied access to the specified
    file.’);
    8 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: Windows 95
    only: There was not enough memory to complete the operation.’);
    10 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: Wrong
    Windows version.’);
    11 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: The .EXE
    file is invalid (non-Win32 .EXE or error in .EXE image).’);
    12 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: Application
    was designed for a different operating system.’);
    13 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: Application
    was designed for MS-DOS 4.0.’);
    15 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: Attempt to
    load a real-mode program.’);
    16 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: Attempt to
    load a second instance of an application with non-readonly data
    segments.’);
    19 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: Attempt to
    load a compressed application file.’);
    20 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: Dynamic-
    link library (DLL) file failure.’);
    26 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: A sharing
    violation occurred.’);
    27 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: The
    filename association is incomplete or invalid.’);
    28 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: The DDE
    transaction could not be completed because the request timed
    out.’);
    29 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: The DDE
    transaction failed.’);
    30 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: The DDE
    transaction could not be completed because other DDE
    transactions were being processed.’);
    31 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: There is no
    application associated with the given filename extension.’);
    32 : ShowMessage(‘Error ‘ + IntToStr(ExecuteResult) + ‘: Windows 95
    only: The specified dynamic-link library was not found.’);
    else ShowMessage(‘Unknown Error.’);
    end;

    end;

    #65140

    dennisbullocpa
    Participant

    Hello Yudel,

    Pardon me to bother you.
    I have difficulty accessing your website.
    Do you have any new website?

    It looks like your website has some bugs.
    Here’s the message that will appear in every interaction I did in your website
    *** Forbidden. Data submitted too often. Please wait a few minutes. ***

    I will appreciate any swift response.

    Thank you,

    Dennis

    #65146

    Yudel Rosales
    Keymaster

    The webpage was checked. You should be good to go. I don’t know Delphi, sorry. I can help you with vb.net and c#.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.