Jump to content

billyChou

uniGUI Subscriber
  • Posts

    189
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by billyChou

  1. in Demos\Desktop\HTTP Post Callback - Browser Window modify procedure TMainForm.UniButton1Click(Sender: TObject); begin UniSession.UrlRedirect('http://www.google.com'); // --> it's ok end; add --------------------------------------------------------------------------- procedure TMainForm.UniFormShow(Sender: TObject); var sJson, sText : string; AUrl: string; begin sJson := ''; sText :=UniApplication.Parameters.Values['json']; if sText= 'test' then begin UniSession.UrlRedirect('http://www.google.com');// -> error halt end; end; url test localhost:8077/?json=test --> browser halt Thanks
  2. reference Demos\Desktop\URLParameters use http post Url -> http://localhost:8077/?userid=BB&pwd=AA return Json Data (with Develop RESTful API use in UNIGUI Thanks
  3. use URLParameters return new page without form, with Json Data. Thanks
  4. EntityDAC - ORM for Delphi with LINQ support https://www.devart.com/entitydac/
  5. Standalone Server can run another application ->call custome report.exe report.file generate report.pdf -> ok Service mode can run another application->call custome report.exe report.file generate report.pdf -> ok ( can run in backgroud) bRet := WinExecAndWait32(sExec, 0); command line is D:\myProj\EDragon\Tools\Rpt_Tools\RoneHo3.exe (space ) D:\MYPROJ\EDRAGON\TOOLS\RPT_TOOLS\EPO110R1.RH3 -I:S_STNO_FM,'A128512531';S_STNO_TO,'X220567374'; -OD:R-222844-593 ------------------------------------------------------------------------------------------------------------------------------------------ function WinExecAndWait32(FileName: string; Visibility: integer): boolean; var ComLineBuffer: array[0..512] of char; StartupInfo: TStartupInfo; ProcessInfo: TProcessInformation; fResult: dword; h : thandle; begin Result := false; StrPCopy(ComLineBuffer,FileName); FillChar(StartupInfo, Sizeof(StartupInfo), #0); StartupInfo.cb := Sizeof(StartupInfo); StartupInfo.dwFlags := STARTF_USESHOWWINDOW or STARTF_FORCEONFEEDBACK ; StartupInfo.wShowWindow := Visibility; h := 0; //if CreateProcess(nil, PChar(Filename), nil, nil, false, // CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nil, nil, // StartupInfo, ProcessInfo) then if CreateProcessAsUser(h,nil, ComLineBuffer, nil, nil, false, NORMAL_PRIORITY_CLASS, nil, nil, StartupInfo, ProcessInfo) then begin WaitforSingleObject(ProcessInfo.hProcess, INFINITE); GetExitCodeProcess(ProcessInfo.hProcess, fResult); CloseHandle(ProcessInfo.hProcess); CloseHandle(ProcessInfo.hThread); Result := true; end; end; ------------------------------------------------------------------- New problam -> can not generate report.pdf (about File Create Permissions) Thanks
  6. Standalone Server can run another application. ------------------------------------------------------------- Procedure WinExecAndWait(CommandLine:String); var ComLineBuffer: array[0..512] of char; StartupInfo: TStartupInfo; ProcessInfo: TProcessInformation; Re:Cardinal; begin StrPCopy(ComLineBuffer,CommandLine); FillChar(StartupInfo, Sizeof(StartupInfo), #0); StartupInfo.cb := Sizeof(StartupInfo); StartupInfo.dwFlags := STARTF_USESHOWWINDOW; StartupInfo.wShowWindow := SW_HIDE; if CreateProcess(nil, ComLineBuffer, { pointer to command line string } nil, { pointer to process security attributes } nil, { pointer to thread security attributes } True, { handle inheritance flag } CREATE_NEW_CONSOLE or { creation flags } NORMAL_PRIORITY_CLASS, nil, { pointer to new environment block } nil, { pointer to current directory name, PChar} StartupInfo, { pointer to STARTUPINFO } ProcessInfo) { pointer to PROCESS_INF } then begin WaitforSingleObject(ProcessInfo.hProcess, INFINITE); GetExitCodeProcess(ProcessInfo.hProcess, Re); CloseHandle(ProcessInfo.hProcess); { to prevent memory leaks } CloseHandle(ProcessInfo.hThread); end; end; ------------------------------------------------------------------------ Windows Service Server can run not another application. Thanks.
  7. Convert OK. Sample Copy Create ServiceModule.* to DBDemo ---------------------------- program DBDemo; uses SvcMgr, MidasLib, uniGUIISAPI, // Forms, / ServerModule in 'ServerModule.pas' {UniServerModule: TUniGUIServerModule}, MainModule in 'MainModule.pas' {UniMainModule: TUniGUIUserSession}, Main in 'Main.pas' {MainForm: TUniForm}, ServiceModule in 'ServiceModule.pas' {UniServiceModule: TUniGUIService}; {$R *.res} begin if not Application.DelayInitialize or Application.Installing then Application.Initialize; Application.CreateForm(TUniServiceModule, UniServiceModule); Application.Run; end. ----------------------------------------------- Command Line DBDemo.exe -install ->[msg] Service install sucessfully Service manager find [serviceModule.pas->Name] Net Start [serviceModule.pas->Name] Net Stop [serviceModule.pas->Name] DBDemo.exe -uninstall -> [msg] Service uninstall sucessfully Thanks skepsis
  8. XE8 Enterprise / Win7 Pro Create a new service project Porject2 -> Run Project2.dpr [dcc32 Error] uIdStackWindows.pas(711): E2003 Undeclared identifier: 'PIP_ADAPTER_ADDRESSES' [dcc32 Error] uIdStackWindows.pas(770): E2005 'PIP_ADAPTER_ADDRESSES' is not a type identifier [dcc32 Error] uIdStackWindows.pas(776): E2005 'PIP_ADAPTER_ADDRESSES' is not a type identifier [dcc32 Error] uIdStackWindows.pas(1300): E2007 Constant or type identifier expected [dcc32 Error] uIdStackWindows.pas(1301): E2003 Undeclared identifier: 'PIP_ADAPTER_UNICAST_ADDRESS' [dcc32 Error] uIdStackWindows.pas(1317): E2008 Incompatible types [dcc32 Error] uIdStackWindows.pas(1322): E2003 Undeclared identifier: 'GAA_FLAG_SKIP_ANYCAST' [dcc32 Error] uIdStackWindows.pas(1322): E2003 Undeclared identifier: 'GAA_FLAG_SKIP_MULTICAST' [dcc32 Warning] uIdStackWindows.pas(1322): W1024 Combining signed and unsigned types - widened both operands [dcc32 Error] uIdStackWindows.pas(1322): E2003 Undeclared identifier: 'GAA_FLAG_SKIP_DNS_SERVER' [dcc32 Error] uIdStackWindows.pas(1322): E2003 Undeclared identifier: 'GAA_FLAG_SKIP_FRIENDLY_NAME' [dcc32 Error] uIdStackWindows.pas(1343): E2008 Incompatible types [dcc32 Error] uIdStackWindows.pas(1358): E2029 ')' expected but identifier 'IfType' found [dcc32 Error] uIdStackWindows.pas(1361): E2017 Pointer type required [dcc32 Error] uIdStackWindows.pas(1362): E2015 Operator not applicable to this operand type [dcc32 Error] uIdStackWindows.pas(1364): E2017 Pointer type required [dcc32 Error] uIdStackWindows.pas(1366): E2017 Pointer type required [dcc32 Error] uIdStackWindows.pas(1368): E2017 Pointer type required [dcc32 Error] uIdStackWindows.pas(1368): E2029 '(' expected but ')' found [dcc32 Error] uIdStackWindows.pas(1368): E2029 'END' expected but ',' found [dcc32 Error] uIdStackWindows.pas(1370): E2066 Missing operator or semicolon [dcc32 Error] uIdStackWindows.pas(1371): E2017 Pointer type required [dcc32 Error] uIdStackWindows.pas(1371): E2029 'END' expected but ')' found [dcc32 Error] uIdStackWindows.pas(1372): E2029 'END' expected but 'ELSE' found [dcc32 Error] uIdStackWindows.pas(1373): E2066 Missing operator or semicolon [dcc32 Error] uIdStackWindows.pas(1386): E2029 ':=' expected but ':' found [dcc32 Error] uIdStackWindows.pas(1387): E2017 Pointer type required [dcc32 Error] uIdStackWindows.pas(1387): E2029 '(' expected but ')' found [dcc32 Error] uIdStackWindows.pas(1387): E2029 'END' expected but ',' found [dcc32 Error] uIdStackWindows.pas(1389): E2029 'UNTIL' expected but 'END' found [dcc32 Error] uIdStackWindows.pas(1390): E2125 EXCEPT or FINALLY expected [dcc32 Error] uIdStackWindows.pas(1391): E2017 Pointer type required [dcc32 Error] uIdStackWindows.pas(1393): E2125 EXCEPT or FINALLY expected [dcc32 Error] uIdStackWindows.pas(1394): E2017 Pointer type required [dcc32 Error] uIdStackWindows.pas(1395): E2029 'END' expected but 'UNTIL' found [dcc32 Error] uIdStackWindows.pas(1399): E2029 Declaration expected but 'FINALLY' found [dcc32 Error] uIdStackWindows.pas(1402): E2029 '.' expected but ';' found [dcc32 Warning] uIdStackWindows.pas(1405): W1011 Text after final 'END.' - ignored by compiler [dcc32 Error] uIdStackWindows.pas(208): E2065 Unsatisfied forward or external declaration: 'TIdSocketListWindows.FDSelect' [dcc32 Error] uIdStackWindows.pas(210): E2065 Unsatisfied forward or external declaration: 'TIdSocketListWindows.GetItem' [dcc32 Error] uIdStackWindows.pas(212): E2065 Unsatisfied forward or external declaration: 'TIdSocketListWindows.Add' [dcc32 Error] uIdStackWindows.pas(213): E2065 Unsatisfied forward or external declaration: 'TIdSocketListWindows.Remove' [dcc32 Error] uIdStackWindows.pas(214): E2065 Unsatisfied forward or external declaration: 'TIdSocketListWindows.Count' [dcc32 Error] uIdStackWindows.pas(215): E2065 Unsatisfied forward or external declaration: 'TIdSocketListWindows.Clear' [dcc32 Error] uIdStackWindows.pas(216): E2065 Unsatisfied forward or external declaration: 'TIdSocketListWindows.Clone' [dcc32 Error] uIdStackWindows.pas(217): E2065 Unsatisfied forward or external declaration: 'TIdSocketListWindows.ContainsSocket' [dcc32 Error] uIdStackWindows.pas(218): E2065 Unsatisfied forward or external declaration: 'TIdSocketListWindows.GetFDSet' [dcc32 Error] uIdStackWindows.pas(219): E2065 Unsatisfied forward or external declaration: 'TIdSocketListWindows.SetFDSet' [dcc32 Error] uIdStackWindows.pas(220): E2065 Unsatisfied forward or external declaration: 'TIdSocketListWindows.Select' [dcc32 Error] uIdStackWindows.pas(222): E2065 Unsatisfied forward or external declaration: 'TIdSocketListWindows.SelectRead' [dcc32 Error] uIdStackWindows.pas(223): E2065 Unsatisfied forward or external declaration: 'TIdSocketListWindows.SelectReadList' [dcc32 Error] uIdStackWindows.pas(229): E2065 Unsatisfied forward or external declaration: 'TIdStackWindows.WSQuerryIPv6Route' [dcc32 Error] uIdStackWindows.pas(231): E2065 Unsatisfied forward or external declaration: 'TIdStackWindows.WriteChecksumIPv6' [dcc32 Error] uIdStackWindows.pas(233): E2065 Unsatisfied forward or external declaration: 'TIdStackWindows.HostByName' [dcc32 Error] uIdStackWindows.pas(241): E2065 Unsatisfied forward or external declaration: 'TIdStackWindows.WSShutdown' [dcc32 Error] uIdStackWindows.pas(258): E2065 Unsatisfied forward or external declaration: 'TIdStackWindows.SetBlocking' [dcc32 Error] uIdStackWindows.pas(259): E2065 Unsatisfied forward or external declaration: 'TIdStackWindows.WouldBlock' [dcc32 Error] uIdStackWindows.pas(270): E2065 Unsatisfied forward or external declaration: 'TIdStackWindows.ReceiveMsg' [dcc32 Error] uIdStackWindows.pas(278): E2065 Unsatisfied forward or external declaration: 'TIdStackWindows.WSTranslateSocketErrorMsg' [dcc32 Error] uIdStackWindows.pas(284): E2065 Unsatisfied forward or external declaration: 'TIdStackWindows.Connect' [dcc32 Error] uIdStackWindows.pas(288): E2065 Unsatisfied forward or external declaration: 'TIdStackWindows.Disconnect' [dcc32 Error] uIdStackWindows.pas(289): E2065 Unsatisfied forward or external declaration: 'TIdStackWindows.GetPeerName' [dcc32 Error] uIdStackWindows.pas(291): E2065 Unsatisfied forward or external declaration: 'TIdStackWindows.GetSocketName' [dcc32 Error] uIdStackWindows.pas(294): E2065 Unsatisfied forward or external declaration: 'TIdStackWindows.GetSocketOption' [dcc32 Error] uIdStackWindows.pas(296): E2065 Unsatisfied forward or external declaration: 'TIdStackWindows.SetSocketOption' [dcc32 Error] uIdStackWindows.pas(299): E2065 Unsatisfied forward or external declaration: 'TIdStackWindows.IOControl' [dcc32 Error] uIdStackWindows.pas(300): E2065 Unsatisfied forward or external declaration: 'TIdStackWindows.SupportsIPv6' [dcc32 Fatal Error] uIdStackWindows.pas(301): E2226 Compilation terminated; too many errors Thanks
  9. How to Convert Sample C:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Desktop\MegaDemo Standalone Server to Windows Service. Thanks
  10. http://ext4all.com/post/extjs-4-multiple-file-upload.html
  11. // "global" variables (which are, in fact, "public properties") in MainModule (you just have to add your MainForm in uses clause). Test "global" variables ( "public properties") in MainModule ( add MainForm unit ) can not use . //------------------------------------------------- in MainModule try q_syslog1.Insert; q_syslog1.FieldByName('n_user').Value := MainForm.sUserName; // TComponent dose not contain a member names 'sUserName'. q_syslog1.FieldByName('n_user').Value := sUserName; // Undeclared identifier 'sUserName'. q_syslog1.FieldByName('f_ssid').Value := aSsid; q_syslog1.FieldByName('d_enter').Value:= now; q_syslog1.FieldByName('d_upda').Value := DTOS2(now); q_syslog1.FieldByName('t_upda').Value := Time2S2(now); q_syslog1.FieldByName('c_stat').Value := aState; q_syslog1.FieldByName('f_ip').Value := sIp; q_syslog1.FieldByName('f_brwt').Value := sBrowseTYpe; q_syslog1.FieldByName('f_brwv').Value := sBrowseVer; q_syslog1.FieldByName('f_plat').Value := sOs; // q_syslog1.FieldByName('f_eclass').AsString:=E.ClassName; q_syslog1.FieldByName('f_log').AsString:= aMsg; // ClientDataSet1.Post; q_syslog1.Post; except // ClientDataSet1.Cancel; q_syslog1.Cancel; end; //------------------------------------------------ thanks ZigZig.
  12. thanks logisticasoft. my test //-------------------------- unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, uniGUITypes, uniGUIAbstractClasses, uniGUIFrame, uniGUIRegClasses, uniguiclasses, uniGUIForm, uniGUIBaseClasses, uniButton ; type TMainForm = class(TUniForm) private { Private declarations } public { Public declarations } //1. global variable in Session is stand-alone , can not use in MainModule. sUserid, sUserName : string; sSsid : string; end; function MainForm: TMainForm; //2. global variable is Session set/get variable , get last Session variable var // sUserid, sUserName , sCompanyid, sMpath, sRpath : string; sIp, sBrowseTYpe , sBrowseVer, sOS, sLong, sLati, sCstate : string; sSsd, sSsd_date, sSsd_time : string; iTimeOut : Integer; implementation {$R *.dfm}
  13. How to define MainForm global variable and support in other form , MainModule, Thanks.
  14. session watch . ver 0.99.95.1296 delphi xe8 win7 pro Thanks. browser login ------------------------------------ after many sec, auto refresh. ------------------------------------- -------------------------------------------- Session List2.zip
  15. how to monitor then same system session background send data list . like db sql monitor. Thanks.
  16. use brower url login many page, locate url parameter and show, when update first page url (01) form data and save, -> data show last page url (10) data. //---------------------------------------------------- 01. http://localhost:88/?stu_id=C221538004 02. http://localhost:88/?stu_id=H225094320 ...... 10. http://localhost:88/?stu_id=N226169615 Thanks.
  17. can not sure then question happen to . a project use url show data , when update data , system session background auto update, generate the session postion data error. brower firfox, chrome unigui 1287, 1292 componet list db postgres 9.4 unidac 6.2.10 , 6.2.9 ----------------------------------------------------------------------------- //mainform UniEdit1.Text :=UniApplication.Parameters.Values['stu_id']; UniEdit2.Text :=UniApplication.Parameters.Values['stu_pwd']; sUserid := uppercase( UniEdit1.Text ); bRet := q_epo010.Locate('n_stu',VarArrayOf([sUserid]),[]); if bRet then OpenForm('Tfrm_epo010a1'); --------------------------------------------------------------------------- //frm_epo010a1 save if (q_main.State in [dsEdit])then begin q_main.Post; end; test url //-------------------------------------------------- http://localhost:88/?stu_id=C22153800 http://localhost:88/?stu_id=H22509432 http://localhost:88/?stu_id=K12282104 http://localhost:88/?stu_id=K12307438 http://localhost:88/?stu_id=K22272621 http://localhost:88/?stu_id=K22306275 http://localhost:88/?stu_id=L12512204 http://localhost:88/?stu_id=L12518306 http://localhost:88/?stu_id=M12279221 http://localhost:88/?stu_id=N22616961 --------------------------------------------------- Thanks.
  18. Custom Draw UniDBGrid rowshttp://forums.unigui.com/index.php?/topic/1128-custom-draw-unidbgrid-rows/?hl=dbgrid+row
×
×
  • Create New...