Jump to content

vlkc

uniGUI Subscriber
  • Posts

    44
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by vlkc

  1. Hello,

    Does anybody know how to monitor COM? Here is the sample:

    { 
      Some applications need to know when the user inserts or 
      removes a compact disc or DVD from a CD-ROM drive without 
      polling for media changes. Windows provide a way to notify these 
      applications through the WM_DEVICECHANGE message. 
    }
    
     type
       TForm1 = class(TForm)
       private
         procedure WMDeviceChange(var Msg: TMessage); message WM_DEVICECHANGE;
       public
    
       end;
    
     {...}
    
     implementation
    
     {$R *.DFM}
    
     procedure TForm1.WMDeviceChange(var Msg: TMessage);
     const
       DBT_DEVICEARRIVAL = $8000; // system detected a new device 
      DBT_DEVICEREMOVECOMPLETE = $8004;  // device is gone 
    var
       myMsg: string;
     begin
       inherited;
       case Msg.wParam of
         DBT_DEVICEARRIVAL: myMsg  := 'CD inserted!';
         DBT_DEVICEREMOVECOMPLETE: myMsg := 'CD removed!';
       end;
       ShowMessage(myMsg);
     end;

     

    How to realize it in UniGui ServerModule?

     

    { 
      Some applications need to know when the user inserts or 
      removes a compact disc or DVD from a CD-ROM drive without 
      polling for media changes. Windows provide a way to notify these 
      applications through the WM_DEVICECHANGE message. 
    }
    
     type
       TUniServerModule = class(TUniGUIServerModule)
       private
         procedure WMDeviceChange(var Msg: TMessage); message WM_DEVICECHANGE;
       public
    
       end;
    
     {...}
    
     implementation
    
     {$R *.DFM}
    
     procedure TUniServerModule.WMDeviceChange(var Msg: TMessage);
     const
       DBT_DEVICEARRIVAL = $8000; // system detected a new device 
      DBT_DEVICEREMOVECOMPLETE = $8004;  // device is gone 
    var
       myMsg: string;
     begin
       inherited;
       case Msg.wParam of
         DBT_DEVICEARRIVAL: myMsg  := 'CD inserted!';
         DBT_DEVICEREMOVECOMPLETE: myMsg := 'CD removed!';
       end;
       ShowMessage(myMsg);
     end;

    I this way does not work :) Please help.

  2. Hello, the exeption is in UniDBgrid.pas

      if (not Silent) and (DD.RecordCount > 0) then
        if Result <> ARecNo then
          ShowMessageN('TUniCustomDBGrid.MoveToRow(): Unexpected Row number: '+Format('%d, %d',[Result, ARecNo]));
          raise Exception.Create('TUniCustomDBGrid.MoveToRow(): Unexpected Row number: '+Format('%d, %d',[Result, ARecNo]));

    In my case it rises in...

    procedure TF_Muitine.UniDBGrid3AfterLoad(Sender: TUniDBGrid);
    var
      DBGridJSName: string;
      _RecNo: Integer;
    begin
      if UP_Aiksteleje.Visible = True then begin
        Try
          if UniMainModule.Mui_TR.RecordCount > 0 then begin
            DBGridJSName := UniDBGrid3.JSName;
            UniMainModule.Mui_Puspr.First;
            UniMainModule.Parinkta_Puspr:= 0;
            for _RecNo:= 0 to UniMainModule.Mui_Puspr.RecordCount - 1 do begin
              if UniMainModule.Mui_TR.FieldByName('Bendra_ter_Id').AsString = UniMainModule.Mui_Puspr.FieldByName('Bendra_ter_Id').AsString then begin
                UniSession.AddJS('setTimeout(function(){'+DBGridJSName + '.getSelectionModel().select('+ DBGridJSName +'.getStore().data.indexOfKey('+ IntToStr(_RecNo) +'), true)}, 50)');
                Inc(UniMainModule.Parinkta_Puspr);
                Break;
              end
              else begin
                UniSession.AddJS('setTimeout(function(){'+DBGridJSName + '.getSelectionModel().select(-1)}, 50)');
              end;
              UniMainModule.Mui_Puspr.Next;
            end;
            if UniMainModule.Parinkta_Puspr = 0 then
              UniSession.AddJS('setTimeout(function(){'+DBGridJSName + '.getSelectionModel().deselectAll()}, 50)'); <<<<<----- Here
          end;
        Except
    
        End;
      end;
    end;

    I guess after there is nothing to deselect or select.

    Temporary I disabled an exception place, but it's not correct. Can you please fix that?

    DBGrid.png

  3. Sorry, try this one, fixed again. What is very interesting in my tests:

    • if I send enable command from button click from the same form - it works
    • if I send enable command from another from or from client event - it does not work. In order to get work I have to click several times.

    I hope it will help make better adjustment of your product. 

     

    Test.zip

  4. Test is complete, you just have to open it and hit unibutton. After, inthe the new form there are two buttons. Lower on works like expected - dissables and enables unilistbox. Upper one enalbles and disables unilist box only from third push.

  5. Hello, how can I detect is there installed video filter on client side or not? Now I use iframe and html code in it:

    
      Result:= '<OBJECT ID="MediaPlayer" WIDTH="640" HEIGHT="480" CLASSID="CLSID:55D1139D-5E0D-4123-9AED-575D7B039569"' +
               'STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">' +
               '<PARAM NAME="FileName" VALUE="rtsp://...">' +
               '<PARAM name="ShowControls" VALUE="false">' +
               '<param name="ShowStatusBar" value="false">' +
               '<PARAM name="ShowDisplay" VALUE="false">' +
               '<PARAM name="autostart" VALUE="true">' +
               '<EMBED TYPE="application/x-mplayer2" SRC="rtsp://..." NAME="MediaPlayer"' +
               ' WIDTH="640" HEIGHT="480" ShowControls="0" ShowStatusBar="0" ShowDisplay="0" autostart="1"> </EMBED>' +
               '</OBJECT>';
    

    If the filter is installed on client PC, then video stream form camera comes. But if there is no filter installed then how can I check, download it and install?

     

  6. 1 - You need to install uniGUI Runtime on your server

     

     

    hello, why is not enough to setup?

     

    procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);
    begin
      ExtRoot := '.\ext\';
      UniRoot := '.\uni\';
    end;
×
×
  • Create New...