Jump to content

RTollison

Members
  • Content Count

    101
  • Joined

  • Last visited

Posts posted by RTollison


  1. Trying to figure out how to add a shape (rectangle, small) to fast report page. SO user clicks on answers (test page) and then need to put a square/circle/whatever to indicate their answer to the question. questions random the answers (A, B, C, D) so the shape object would not be fixed location.


  2. Not sure it has anything to do with errors or not but i had learn Jenkins which requires Java 17+ for latest version. about a month or so after that i needed to change delphi dll. however, when i start RAD Studio i get like 22 errors on the startup screen all pretty much the same format.

    An error has occurred in the script on this page.

    blah

    blah 

    blah

    URL: https://...blah.../js/jquery/jquery.min.js

     

    Also around this time our IT dept locked up a bunch more stuff. I have JAVA 21.0.2 installed. i searched for these errors but nothing came up. is it my pc/java or is it something else running interference?


  3. thank you for the info/input. the background on this is that way back in 2014 or prior a dll was create using the DCP Crypto libraries. the blowfish cipher was selected for encrypt/decrypt functions and has been in use for all clients. now a .Net dev was asking me to give him a hand in validating that his .net/c# version is working/matching. he has a quick access point in his code to just encrypt/decrypt the indata value. so we added his test to the selftest for verification. well the first 8 matched but we wanted to determine why the last 8 were not matching to his code. i guess trying to shortcut the testing process was a little short sighted on my part. i will just let it encrypt/decrypt the same string he is testing.

     

    Thank you again...


  4. Trying to sync up a .Net implementation of blowfish and was not syncing up so i added to the dcpcrypto for blowfish.selftest

    i added a new key/data items. 

    the key3, indata3 and outdata3 then copied the code for encrypt/decrypt and then verify the in/out matched. but my data2 is getting stopped at 8 bytes and not the full 16 in the var section.

     so the EncryptECB is taking it off but i am not sure why. is encryptecb set to only handle 8 bytes/16wide?

    class function TDCP_blowfish.SelfTest: boolean;
    const
      Key1: array[0..7] of byte= ($00,$00,$00,$00,$00,$00,$00,$00);
      Key2: array[0..7] of byte= ($7C,$A1,$10,$45,$4A,$1A,$6E,$57);
      InData1: array[0..7] of byte= ($00,$00,$00,$00,$00,$00,$00,$00);
      InData2: array[0..7] of byte= ($01,$A1,$D6,$D0,$39,$77,$67,$42);
      OutData1: array[0..7] of byte= ($4E,$F9,$97,$45,$61,$98,$DD,$78);
      OutData2: array[0..7] of byte= ($59,$C6,$82,$45,$EB,$05,$28,$2B);
    
      Key3: array[0..31] of byte= ($ff,$8a,$0b,$85,$ff,$a9,$14,$d1,$b5,$61,$df,$31,$1f,$94,$f5,$aa,$55,$08,$b9,$ad,$49,$0a,$ba,$df,$e3,$57,$00,$37,$13,$fc,$79,$d0);
      InData3: array[0..15] of byte= ($54,$68,$69,$73,$20,$69,$73,$20,$61,$20,$74,$65,$73,$74,$21,$21);
      OutData3: array[0..15] of byte= ($e2,$77,$9b,$17,$b9,$e4,$2b,$ec,$b7,$a3,$7c,$21,$c0,$d6,$18,$93);
    var
      Cipher: TDCP_blowfish;
      Data: array[0..7] of byte;
      Data2: array[0..15] of byte;
    begin
      FillChar(Data, SizeOf(Data), 0);
      Cipher:= TDCP_blowfish.Create(nil);
      Cipher.Init(Key1,Sizeof(Key1)*8,nil);
      Cipher.EncryptECB(InData1,Data);
      Result:= boolean(CompareMem(@Data,@OutData1,Sizeof(Data)));
      Cipher.Reset;
      Cipher.DecryptECB(Data,Data);
      Result:= boolean(CompareMem(@Data,@InData1,Sizeof(Data))) and Result;
      Cipher.Burn;
      Cipher.Init(Key2,Sizeof(Key2)*8,nil);
      Cipher.EncryptECB(InData2,Data);
      Result:= boolean(CompareMem(@Data,@OutData2,Sizeof(Data))) and Result;
      Cipher.Reset;
      Cipher.DecryptECB(Data,Data);
      Result:= boolean(CompareMem(@Data,@InData2,Sizeof(Data))) and Result;
      Cipher.Burn;
      Cipher.Free;
    
      FillChar(Data2, SizeOf(Data2), 0);
      Cipher:= TDCP_blowfish.Create(nil);
      Cipher.Init(Key3,Sizeof(Key3)*8,nil);
      Cipher.EncryptECB(InData3,Data2);
      Result:= boolean(CompareMem(@Data2,@OutData3,Sizeof(Data2))) and Result;
      Cipher.Reset;
      Cipher.DecryptECB(Data2,Data2);
      Result:= boolean(CompareMem(@Data2,@InData3,Sizeof(Data2))) and Result;
      Cipher.Burn;
    
      Cipher.Free;
    end;
    procedure TDCP_blowfish.EncryptECB(const InData; var OutData);
    var
      xL, xR: DWord;
    begin
      if not fInitialized then
        raise EDCP_blockcipher.Create('Cipher not initialized');
      xL:= Pdword(@InData)^;
      xR:= Pdword(longword(@InData)+4)^;
      xL:= ((xL and $FF) shl 24) or ((xL and $FF00) shl 8) or ((xL and $FF0000) shr 8) or ((xL and $FF000000) shr 24);
      xR:= ((xR and $FF) shl 24) or ((xR and $FF00) shl 8) or ((xR and $FF0000) shr 8) or ((xR and $FF000000) shr 24);
      xL:= xL xor PBox[0];
      xR:= xR xor (((SBox[0,(xL shr 24) and $FF] + SBox[1,(xL shr 16) and $FF]) xor
        SBox[2,(xL shr 8) and $FF]) + SBox[3,xL and $FF]) xor PBox[1];
      xL:= xL xor (((SBox[0,(xR shr 24) and $FF] + SBox[1,(xR shr 16) and $FF]) xor
        SBox[2,(xR shr 8) and $FF]) + SBox[3,xR and $FF]) xor PBox[2];
      xR:= xR xor (((SBox[0,(xL shr 24) and $FF] + SBox[1,(xL shr 16) and $FF]) xor
        SBox[2,(xL shr 8) and $FF]) + SBox[3,xL and $FF]) xor PBox[3];
      xL:= xL xor (((SBox[0,(xR shr 24) and $FF] + SBox[1,(xR shr 16) and $FF]) xor
        SBox[2,(xR shr 8) and $FF]) + SBox[3,xR and $FF]) xor PBox[4];
      xR:= xR xor (((SBox[0,(xL shr 24) and $FF] + SBox[1,(xL shr 16) and $FF]) xor
        SBox[2,(xL shr 8) and $FF]) + SBox[3,xL and $FF]) xor PBox[5];
      xL:= xL xor (((SBox[0,(xR shr 24) and $FF] + SBox[1,(xR shr 16) and $FF]) xor
        SBox[2,(xR shr 8) and $FF]) + SBox[3,xR and $FF]) xor PBox[6];
      xR:= xR xor (((SBox[0,(xL shr 24) and $FF] + SBox[1,(xL shr 16) and $FF]) xor
        SBox[2,(xL shr 8) and $FF]) + SBox[3,xL and $FF]) xor PBox[7];
      xL:= xL xor (((SBox[0,(xR shr 24) and $FF] + SBox[1,(xR shr 16) and $FF]) xor
        SBox[2,(xR shr 8) and $FF]) + SBox[3,xR and $FF]) xor PBox[8];
      xR:= xR xor (((SBox[0,(xL shr 24) and $FF] + SBox[1,(xL shr 16) and $FF]) xor
        SBox[2,(xL shr 8) and $FF]) + SBox[3,xL and $FF]) xor PBox[9];
      xL:= xL xor (((SBox[0,(xR shr 24) and $FF] + SBox[1,(xR shr 16) and $FF]) xor
        SBox[2,(xR shr 8) and $FF]) + SBox[3,xR and $FF]) xor PBox[10];
      xR:= xR xor (((SBox[0,(xL shr 24) and $FF] + SBox[1,(xL shr 16) and $FF]) xor
        SBox[2,(xL shr 8) and $FF]) + SBox[3,xL and $FF]) xor PBox[11];
      xL:= xL xor (((SBox[0,(xR shr 24) and $FF] + SBox[1,(xR shr 16) and $FF]) xor
        SBox[2,(xR shr 8) and $FF]) + SBox[3,xR and $FF]) xor PBox[12];
      xR:= xR xor (((SBox[0,(xL shr 24) and $FF] + SBox[1,(xL shr 16) and $FF]) xor
        SBox[2,(xL shr 8) and $FF]) + SBox[3,xL and $FF]) xor PBox[13];
      xL:= xL xor (((SBox[0,(xR shr 24) and $FF] + SBox[1,(xR shr 16) and $FF]) xor
        SBox[2,(xR shr 8) and $FF]) + SBox[3,xR and $FF]) xor PBox[14];
      xR:= xR xor (((SBox[0,(xL shr 24) and $FF] + SBox[1,(xL shr 16) and $FF]) xor
        SBox[2,(xL shr 8) and $FF]) + SBox[3,xL and $FF]) xor PBox[15];
      xL:= xL xor (((SBox[0,(xR shr 24) and $FF] + SBox[1,(xR shr 16) and $FF]) xor
        SBox[2,(xR shr 8) and $FF]) + SBox[3,xR and $FF]) xor PBox[16];
      xR:= xR xor PBox[17];
      xL:= ((xL and $FF) shl 24) or ((xL and $FF00) shl 8) or ((xL and $FF0000) shr 8) or ((xL and $FF000000) shr 24);
      xR:= ((xR and $FF) shl 24) or ((xR and $FF00) shl 8) or ((xR and $FF0000) shr 8) or ((xR and $FF000000) shr 24);
      Pdword(@OutData)^:= xR;
      Pdword(longword(@OutData)+4)^:= xL;
    end;
    

     


  5. reason for the older one is that we committed to that version from the start and now our clients have 2000+ documents (for all clients not just one) and we would be the ones to reformat the dot to a dotx and update dl. so for now we will use old so that our clients will not overwhelm our support teams.


  6.     <DCCReference Include="uMain.pas">
          <CoClasses>Word</CoClasses>
        </DCCReference>

    ...

    lines above in the include for the .dproj for the project

     

    not my original project but handed off to me for some desired updates/features.


  7. interface

    uses ActiveX;

    // *********************************************************************//
    // Declaration of Enumerations defined in Type Library                    
    // *********************************************************************//
    // Constants for enum WdMailSystem
    type
      WdMailSystem = TOleEnum;
    const
      wdNoMailSystem = $00000000;
      wdMAPI = $00000001;
      wdPowerTalk = $00000002;
      wdMAPIandPowerTalk = $00000003;

    // Constants for enum WdTemplateType
    type
      WdTemplateType = TOleEnum;
    const
      wdNormalTemplate = $00000000;
      wdGlobalTemplate = $00000001;
      wdAttachedTemplate = $00000002;

    // Consta

    ......


  8. // *********************************************************************//
    // Declaration of CoClasses defined in Type Library                       
    // (NOTE: Here we map each CoClass to its Default Interface)              
    // *********************************************************************//
      Word = IWord;


    // *********************************************************************//
    // Interface: IWord
    // Flags:     (4416) Dual OleAutomation Dispatchable
    // GUID:      {4261D89B-82E0-4ED7-8F71-BCEF8E6E267E}
    // *********************************************************************//
      IWord = interface(IDispatch)
        ['{4261D89B-82E0-4ED7-8F71-BCEF8E6E267E}']
        function OpenSession(var ASessionID: Integer): Integer; safecall;
        function CloseSession(ASessionID: Integer): Integer; safecall;
        function ReleaseSession(ASessionID: Integer): Integer; safecall;
        function SessionCount: Integer; safecall;
        function OpenFile(ASessionID: Integer; AFilePath: OleVariant; var AFileID: Integer): Integer; safecall;

    ....


  9. original delphi 5 new delphi 10.2

    word ole automation - original was word 2003 new is word 365

    i have been trying different things in the dll and found that 

    if I change all calls of

     

    FSession.Word.Selection.Paste()

     

    to 

     

    FSession.Word.Selection.PasteAndFormat(WdRecoveryType.wdFormatOriginalFormatting);

     

    it formats the same. but my page layout is off because original dot is 1 page and the newly created document is 2 pages.  the last part of the dot is a salutation type text but instead of bottom of the document it goes to the top of the next page. but overall the text/spacing "seems" to be the same. 

     


  10. I have a very old project for interfacing with Word. Originally done when i had Word 97 and 2003 later. Created dot file in 97-03 format and all worked great. now i am adding some extra stuff to the old project BUT with my new activex/dll i get a different format when loading up the old dot files. paragraph spacing, default font. it's like it doesn't care about the dot being in an older format. but when i revert back to the original compiled activex/dll it works. same font, same paragraph spacing. 

    what would i look for as the trigger for old 97-03 format versus new format.

    the dot has times font but when i load it up using new compiled dll i get Calibri (default for new session in WORD) but the older dll will keep it as Times.


  11. i created a simple program just to shcreate while change the variable text

    \\tsclient on the first shcreate command of \\tsclient comes up with c:\users\xxxx\documents then when i execute it a second time with the same execute command i get c:\users\xxxxx\desktop

    its run in a loop is my meaning of second time thru the loop. the third time thru the loop it fails th shcreate.

    i have the shcreate within the folderchanging of a tfileopendialog event.

     


  12. it was being sent in as variable and it is \\tsclient something is special about \\tsclient because i did a net use z: \\tsclient\c\myfolder and ran that shcreate against z: and it worked. 

    i tried variations 'tsclient', 'network\\tsclient'

    i am trying to force the lookup path to be tsclient and let user select from tsclient\? only. the shcreate will work if i only select one of the shares but not the root.

    NOTE: Yes the defaultfolder is \\tsclient but that shcreate is for verifying that the user stays within tsclient

     

    I will keep doing some searching, found an article referencing 'my pc' and other special names so maybe i will eventually find tsclient out there somewhere.


  13.     Dlg := Sender as TFileOpenDialog;
        if Succeeded(SHCreateItemFromParsingName(PWideChar(WideString('\\tsclient')), nil, IShellItem, DefFolder)) then

     

    Is there a way to for that command to work when parsing tsclient. if i set it to 'C:\myfolder' it works but when i rdp  to server (with drives shared and are accessible) when i set the string to '//tsclient'

    it fails. 

    I have searched for shcreateitemfromparsingname and tsclient but can't find anything


     


  14. yes all of our clients are on their own LAN. The original site with issue happened about 3 yrs ago and got "resolved" by adding the proxyserver. all of our clients get the non proxyserver version. but along the way some other outlier sites ,3-5 maybe, would have the same 10061 error and we send over the proxyserver version of dll and they work.

    as for the original workstations we stripped that thing like a banana and still it would not connect. When I said it must be something on their server and that is pretty much where the investigation ended. Then last month i had a support rep ask where was the "special" version of the dll because a client was getting the 10061 error. So before sending over the odd dll i asked client if I could do some testing. the first thing i did was ask clients IT to allow an AV exception for the folder that has our software/dlls in it. No affect. IT then un-installed the AV and still no affect. next the site and I started on the firewall and again they just turned it off with no affect. they then went into all the ie's installed on workstation setting an allow access to our URL, no affect. So we decided to move on for now and I sent the odd dll over and it worked. so clients IT, turned firewall on and installed AV and then tested again and it worked still. when i said "maybe" something on the server is blocking access and asked if I could just look around and was shut off. "We don't allow anyone else direct access to our server!" verbatim. 

    The thing of it is, over two months ago this very client was working without the proxyserver version and i asked what on their system changed we got the standard issue of 'nothing changed except we installed windows updates and your software updates'. we didn't change anything related to this feature and windows update has done anything to any of our other clients (> 1,200). I even asked the IT what software they recently installed on that server they said nothing. I just know something was done on the server since the workstation had nothing on it to block any traffic. 


  15. i think(pretty sure) it is the third issue. all the other users are working fine and no pending connections. Our IT looked at the logs and showed nothing coming thru for this client. It just that the clients IT uninstalled the AV, turned off the Firewall and allowed access via IEs.  They insisted it was something on our end even though i could use clients credentials and it would work. I asked if they had something on their server that might limit access and of course they adamantly swore the was nothing else. I am pretty sure that we had the workstation cleared but when i wanted access to the server it was no unless you have something specific. So I posted here. I was trying to understand why a proxyserver would allow whatever blocking the dll would now work. 

    Since our IT said that nothing was coming from that workstation/site i guessed that the clients server has to be blocking the connection request but some clients IT are pretty touchie about letting a crazy dev on their system opening up connections.

     

    Thank you and i will take time to understand wireshark instead of fiddler.


  16. Delphi 10.2, Indy 10.x

    Just trying to understand why this works. 

    i have a dll that uses https to connect to our server. Works 99% of all our clients but for some outliers i kept getting 10061 connection refused error. after a bunch of trial and error while working with clients IT dept we finally tried running fiddler to help track down the issue. this tracking had me add proxyparams.proxyserver and proxyport to track in fiddler. well it would work without error. after rollbacks and testing we discovered that by leaving the proxyserver 127.0.0.1 in place that it would work and connect to our server and do whatever was needed. now any time we get the 10061 our support sends over the proxyserver version of the dll.

    what is the reason or area that we should look at to find the source of the issue to not have to use the workaround proxyserver.

    we bypassed AV, firewall off and allow access from internet explorer (edge, chrome, firefox,...)


  17. holy crap thank you all again. you really don't know how much i appreciate this. beein fighting a bad sinus/ear infection and am way too tired to be using what little of my brain is functioning. 

    thank you , thank you, thank you.


  18. got that implemented, thanks again.

    now he asked be something else and if i am  correct, he is asking for overlapping numbers with without duplicating them. i can deal with any duplicates with a while statement but here is basically what is asking for. 

    value1 = 1-300

    value2 = 100-550

    value3 = 250-750

    value4 = 500-1000

    not sure what he is looking for but he wanted me to let him enter the ranges instead of the hardcoded ranges (which is what he said he wanted but now wants to expand upon for his own purposes).

    i asked about any of the overlaps if he wanted to force then higher and he said that the overlapping is fine.

    so if we retrieve values like

    value1=225

    value2=200

    value3=299

    value4=500 

    That would be ok. told him that I had no idea how this is helping. why not throw darts at a board.  but he said now he could put his dart board away.

     


  19. currently use a loop and random to get a value between a range.

    first on was simple enough

    value1 := random (250) + 1 (value from 1 thru 250)

    second halfway simple

    value2 := random(500) + 1; set initial random value

    while value2 < 251 do

      value2 := random(500) + 1;

    value3 := random(750) + 1;

    while value3 < 501 do 

      value3 := random(750) + 1;

    value4 := random(1000) + 1;

    while value4 < 751 do

       value4 := random(1000) + 1;

     

    sometimes it is pretty quick, other times is seems to hang for a bit. < 10 seconds

    so that got me to thinking, is there a better way to random values bewteen a range?


  20. here is what i found and tested. works to a degree (no series titles but he seems ok with it) just a mess looking to me.

     

    begin
      DBChart1.View3D:=false;
      DBChart1.Legend.Visible:=false;

      with DBChart1.AddSeries(TFastLineSeries) as TFastLineSeries do
      begin
        XValues.Order:=loNone;
        TreatNulls:=tnDontPaint;
        adodataset1.First;
        while not adodataset1.Eof do
        begin
          AddNullXY(0,0);  //start a new line
          AddXY(0,adodataset1.FieldByName('num_1').AsInteger);
          AddXY(1, adodataset1.FieldByName('num_2').AsInteger);
          AddXY(2, adodataset1.FieldByName('num_3').AsInteger);
          AddXY(3, adodataset1.FieldByName('num_4').AsInteger);
          AddXY(4, adodataset1.FieldByName('num_5').AsInteger);
          AddXY(5, adodataset1.FieldByName('num_6').AsInteger);
          AddXY(6, adodataset1.FieldByName('num_7').AsInteger);
          AddXY(7, adodataset1.FieldByName('num_8').AsInteger);
          AddXY(8, adodataset1.FieldByName('num_9').AsInteger);
          AddXY(9, adodataset1.FieldByName('num_10').AsInteger);
          adodataset1.Next;
        end;
      end;
    end;

×