-
Content Count
1406 -
Joined
-
Last visited
-
Days Won
22
Everything posted by programmerdelphi2k
-
all software that somehow made use of Paradox tables, like: Corel Office, Word Perfect, Quatro Pro, etc... So, you could initially try using your system on another computer and then install your DBase III Plus to see the result! If so, then your case is confirmed! Solution: There should only be one BDE installed on your computer! Normally, the latest version of the BDE (the installation) should work for your DBase III Plus too! If they use different directories for the BDE DLLs, then, it could be a separate problem!!! did you try to put the dll's in the same folder as your executable
-
Invalid pointer operation when try to replace object in list
programmerdelphi2k replied to RaelB's topic in VCL
then, the obj1 not more exists not? it was removed not? (implicitly) -
Using SetLength(Self) inside a record helper for TBytes
programmerdelphi2k replied to MarkShark's topic in RTL and Delphi Object Pascal
unit Unit2; interface uses System.SysUtils, System.Classes; type TMyHelpToTBytes = record helper for TBytes private function MyGetLen: integer; public property MyLen: integer read MyGetLen; function MyGetBytes(const AStream: TStream; const AStart: integer = 0; ACount: integer = 32): TBytes; function MyBytesAsString: string; end; implementation { TMyHelpToTBytes } function TMyHelpToTBytes.MyGetLen: integer; begin result := Length(Self); end; function TMyHelpToTBytes.MyGetBytes(const AStream: TStream; const AStart: integer = 0; ACount: integer = 32): TBytes; begin result := []; // if (AStream = nil) or {(AStart < 0 ) or} (ACount < 1) then exit; // // maybe some protection here to avoid "AV"...? if ((AStart + ACount) > AStream.Size) then ACount := AStream.Size - AStart; // if ACount > 0 then begin Setlength(result, ACount); // AStream.Position := AStart; AStream.Read(result, ACount); end; end; function TMyHelpToTBytes.MyBytesAsString: string; begin result := ''; // for var B in Self do result := result + ',(' + B.ToString + ')'; // result := result.Remove(0, 1); end; end. uses Unit2; procedure TForm1.Button1Click(Sender: TObject); var MyBytes : TBytes; MyStream: TMemoryStream; begin Memo1.Text := 'MyBytes Len = ' + MyBytes.MyLen.ToString + ', time: ' + TimeToStr(now); // MyStream := TMemoryStream.Create; try MyStream.LoadFromFile('..\..\Unit1.pas'); // MyBytes := MyBytes.MyGetBytes(MyStream, random(100), random(1000)); // Memo1.Lines.Add('MyBytes Len = ' + MyBytes.MyLen.ToString); Memo1.Lines.Add(MyBytes.MyBytesAsString); // MyBytes := MyBytes.MyGetBytes(MyStream, random(100), random(500)); // Memo1.Lines.Add('MyBytes Len = ' + MyBytes.MyLen.ToString); Memo1.Lines.Add(MyBytes.MyBytesAsString); // MyBytes := MyBytes.MyGetBytes(MyStream, random(100), random(1500)); // Memo1.Lines.Add('MyBytes Len = ' + MyBytes.MyLen.ToString); Memo1.Lines.Add(MyBytes.MyBytesAsString); finally MyStream.Free; end; end; initialization ReportMemoryLeaksOnShutdown := true; end. -
Need a "Delphi programming guideline"
programmerdelphi2k replied to TheOnlyOne's topic in General Help
We must remember that, when using ready-made classes/object, we are actually leaving out coding because someone has already done it for us, so it is no exaggeration to say that 80 lines of code can replace 8000. Of course, at first glance, it's an exaggeration! But it's no exaggeration if the previous programmer created a "frankenstein" in his code... thus, 8000 dead body parts, when checked in "loco", could turn into just a few actual organs! So, it shouldn't be any exaggeration! But just a statement of what was not seen before, due to lack of knowledge, or negligence! After all, if you don't code, someone else will have to do it for you! Even if it's "ChatGPT" or "Bard"... 😛 -
Invalid pointer operation when try to replace object in list
programmerdelphi2k replied to RaelB's topic in VCL
by doing it this way, you're saying something like this: ob1 now you're obj2... so wouldn't it be more correct for you to "remove obj1" and "add obj2"? see procedure "Remove()" and "Add()" from the list. if the list is not the "owner" of the object then you will need to release it from memory to avoid memory leak -
normally, I delete all!!! ME...
-
should be a new IA from google "pulling a prank" if you use "eloqua com" (without-DOT ) you will se the " Oracle Eloqua Login https://login.eloqua.com ) and the "black page" as result!
-
Error in module rtl200.bpl
programmerdelphi2k replied to Zazhir's topic in RTL and Delphi Object Pascal
hi @dummzeuch actually I use "pure" RAD Studio 11.2 with only Patch 1 default installation! Not even the most common suites on the market! I use RAD only for my hobbyist projects as Melander emphasized in a recent post. But he's right, I'm a hobbyist and I like Delphi. Regarding the use of plugins and the like, NOTHING, NO third party components or suites! Nothing nothing nothing! just pure IDE installation with personalities: Delphi/CBuilder (not used for me = I don't know C language - sorry) So the real cause is very strange... but it doesn't happen all the time, but at certain times... I know when it will happen... when the Code-Editor shows the "red lines" (pseudo-errors) in the code... then, I think LSP can be related to the fact. But, of course, it can be just one of the causes, as it happens to other people too, whether in small or large projects. -
From Delphi+PostgresDAC (PostgresSQL) To Delphi+FireDAC (PostgresSQL)
programmerdelphi2k replied to Squamis's topic in Databases
if wouldnt help, please refrain from posting messages without any contribution. 😂 -
root "C:\" is not protected for just Admin access on Servers?
-
not for that
-
Error in module rtl200.bpl
programmerdelphi2k replied to Zazhir's topic in RTL and Delphi Object Pascal
for ones, the weather appears more "black" that should be. why? should be the global position on the Earth 😂 -
Error in module rtl200.bpl
programmerdelphi2k replied to Zazhir's topic in RTL and Delphi Object Pascal
This could even be... however, it happens to me even when just opening and closing a new project, without even compiling or running it... isn't that weird? 😞 -
sorry Melander, as you know my knowledge is not near your, but it's the life!!! Luck for us "have someone like you" for fix our error! go ahead... in my test, the "Ironman - result.png" have background transparent
-
Error in module rtl200.bpl
programmerdelphi2k replied to Zazhir's topic in RTL and Delphi Object Pascal
I have this too! sometimes... but I dont know what do it... RAD 11.2 ( sometimes I see that LSP stop, then, maybe be this ) -
How to enter unicode symbols into the Delphi IDE
programmerdelphi2k replied to Dave Novo's topic in Delphi IDE and APIs
have you tried changing the file encode to UTF8 instead of ANSII, before insert the char? Despite being something quite peculiar and perhaps something to create future problems with the use of exotic characters, especially when this can bring inconvenience between platforms and editions of the IDE, since the RAD from time to time crashes due to a malfunction in the Editor of Code. -
{$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var LPictureSource: TPicture; // load a PNG LPictureTarget: TPicture; // to resize like a Bitmap LPNGresulted : TPngImage; // to save PNG resulted LBtmPointerTmp: TBitmap; begin LBtmPointerTmp := TBitmap.Create(1, 1); LPictureSource := TPicture.Create; LPictureTarget := TPicture.Create; LPNGresulted := TPngImage.Create; try LPictureSource.Assign(Image2.Picture); // LPictureSource.LoadFromFile('..\..\IronMan.png'); LPictureSource.Graphic.Transparent := True; // Memo1.Text := 'IronMan.png = ' + LPictureSource.Width.ToString + 'x' + LPictureSource.Height.ToString; // LPictureTarget.Bitmap.Assign(LBtmPointerTmp); // Create(1, 1); // just for create intervalues values to canvas, etc... LPictureTarget.Graphic.Transparent := True; // // new size LPictureTarget.Bitmap.SetSize( Trunc(LPictureSource.Width * 0.4), Trunc(LPictureSource.Height * 0.4) ); // // draw on new canvas resized LPictureTarget.Bitmap.Canvas.StretchDraw(LPictureTarget.Bitmap.Canvas.ClipRect, LPictureSource.Graphic); // Memo1.Lines.Add(LPictureTarget.Width.ToString + 'x' + LPictureTarget.Height.ToString); // LPNGresulted.Assign(LPictureTarget.Bitmap); // Memo1.Lines.Add('PNG = ' + LPNGresulted.Width.ToString + 'x' + LPNGresulted.Height.ToString); // LPNGresulted.SaveToFile('resulted.png'); // just for test load file... // Image1.Picture.LoadFromFile('resulted.png'); Image1.Proportional := True; finally LPNGresulted.Free; LPictureTarget.Free; LPictureSource.Free; LBtmPointerTmp.Free; end; end; initialization ReportMemoryLeaksOnShutdown := True; finalization end.
-
a little fix to avoid a "memory leaks"... with a new obj TBitmap as usual
-
https://www.pngegg.com/en/png-zhwea <-- IronMan PNG images!!! Here my TImage2 components is using a "Iron men PNG" in design-time, then I just assign it to my "var LPictureSource" look the code... the rest is the same as above
-
form2.Aa.Picture = "AA" have a "transparence" activated or have a transparence?
-
you're wellcome!
-
thanks for all "like", , :)))
-
not necessary! just if you want and be sure about this!