-
Content Count
395 -
Joined
-
Last visited
-
Days Won
5
Everything posted by Cristian Peța
-
DataSet.Filtered := False; DataSet.Filtered := True; Is working for me when using OnFilterRecord event.
-
Customers asked me a long time ago for a feature to be able to introduce the length in inch in "12 3/16" format in a TEdit like control. I've made a component for this but with the new TNumberBox in Delphi 10.4.2 I wonder if this is usual and if there are some components for this in Delphi world?
-
Intraweb/MS SQL/FireDAC app Azure deployment problem...
Cristian Peța replied to zsleo's topic in Databases
I use UniDAC and in such a case I would use DBMonitor to see what queries are send to the server. I don't know if FireDAC has something like this but from what I know, if I'm not mistaken, you can see failed queries also in Azure. -
This "image/text/plain" is strange for me. You can try this. This will enable share for image and text. If you need only text delete the "image/* " This setType() will filter the applications that supports that type.
-
Several F2084 Internal Error on Delphi 10.4.2
Cristian Peța replied to Davide Angeli's topic in Delphi IDE and APIs
Then not the memory limit is the problem. I think I had something similar but long time ago I starter to avoid compile and use build almost every time. It is better to wait 10-15 seconds (in my case) than to fight with these issues. If I remember well this started for me about ten years ago when iOS was first introduced as a new platform. -
And what if you omit this line? Intent.setPackage(StringToJString('com.whatsapp'))
-
Several F2084 Internal Error on Delphi 10.4.2
Cristian Peța replied to Davide Angeli's topic in Delphi IDE and APIs
If "Use MSBuild externally to compile" helps then probably you have reached the memory limit. You can see in Task Manager if Delphi is approaching 4 GB limit. I have for example 534 MB after a build of 330k LOC. -
TBitmap to TBytes for ESC/POS Thermal Printer
Cristian Peța replied to at3s's topic in RTL and Delphi Object Pascal
To send text you could use this function. If the previous change fixed the issue I suppose this will also fix it without to change anything else. You could also store binary data in AnsiString but I would not do this. It's better to use TBytes for this. procedure TThermalPrinter.SendString(AValue: AnsiString); var SND: TBytes; begin SetLength(SND, Length(AValue)); CopyMemory(@SND[0], @AValue[1], Length(AValue)); LSockect.SendData(SND); // send data to the printer end; And better this in TThermalPrinter.DoPrintBitmap() vTempStr : AnsiString; -
TBitmap to TBytes for ESC/POS Thermal Printer
Cristian Peța replied to at3s's topic in RTL and Delphi Object Pascal
If this was the fix then this was a lottery. I was thinking you need to get rid of that SendString() everywhere. At least when you send binary data. And Lo(ABitmap.Width) is binary data. If you want to send text and to be readable in source you can use AnsiString and convert to TBytes. Using String to store bytes is as @David Heffernan would say: perverse. -
TBitmap to TBytes for ESC/POS Thermal Printer
Cristian Peța replied to at3s's topic in RTL and Delphi Object Pascal
Here you are sending String converted with TEncoding.ASCII.GetBytes() to TBytes. Why not directly? LSockect.SendData([$1B, 42, 33, Lo(ABitmap.Width), Hi(ABitmap.Width)]); -
Delphi service in a domain controlled environment
Cristian Peța replied to thomh's topic in Network, Cloud and Web
Why to sleep 5 second? And ShellExecute() doesn't create a child processes. -
Delphi service in a domain controlled environment
Cristian Peța replied to thomh's topic in Network, Cloud and Web
It's not the best method but I run a batch file with net stop ServiceName net start ServiceName -
TBitmap to TBytes for ESC/POS Thermal Printer
Cristian Peța replied to at3s's topic in RTL and Delphi Object Pascal
If you don't have the documentation then at least follow what that article says clearly: " This is because low-level programmers, such as those who designed the ESC/POS language, tend to blur the lines between data types: it’s all bytes at the end of the day." You need to write binary data. Simply don't put binary data in String and convert using TEncoding.ASCII.GetBytes(). This won't help you. But if you want to know I used TBytes. -
XML Parsing and Processing
Cristian Peța replied to pyscripter's topic in RTL and Delphi Object Pascal
IMAGE_FILE_LARGE_ADDRESS_AWARE. I use this also but not enough in some cases. And 64 bit is not yet an option because I don't want both 32 and 64 and there are about 10% with 32bit OS in case of my users. https://github.com/neslib/Neslib.Xml -
XML Parsing and Processing
Cristian Peța replied to pyscripter's topic in RTL and Delphi Object Pascal
Fine, if you are not on 32bit and memory is at limit when you save the XML. It will save nicely but truncated. Fast, if you don't have to many attributes in a node. If you have 100 attributes it's starting to slow down perceptible. I had a case with tens of thousands. These are corner cases but showstoppers for me. Better try Neslib.Xml. I have an implementation that is not faster than Neslib.Xml (slightly slower and more memory) but faster in my case if there are many attributes in a node because I use a dictionary for storing the attributes. -
TBitmap to TBytes for ESC/POS Thermal Printer
Cristian Peța replied to at3s's topic in RTL and Delphi Object Pascal
You are using examples from others that doesn't work or doesn't work in your case. Maybe it's time to read the documentation of that printer, understand it and do it right. From what I understood reading a little Nicholas Piasecki's article is that you need to send binary data. Not ASCII. And from your code it's clear that you need (like in Nicholas Piasecki's article) a monochrome, one bit per pixel image. In top-bottom and right-left order. This is binary data. A sort of simplified PCX graphic format (long time ago I wrote a little procedure to save TBitmap to PCX format). Your don't need SendString(AValue: String) function. Use directly LSockect.SendData() instead. And don't use String but TBytes like LSockect.SendData() is expecting. -
With 10.4.1 there was issues with CodeinSight and some %IFDEF's but with 10.4.2 I have not seen yet any issues till now.
-
Something about performance: https://www.cpubenchmark.net/cpu.php?cpu=Intel+Core+i7-8700K+%40+3.70GHz&id=3098
-
deleted
-
How do you know that it crashes exactly at that line of code? Do you have a stack-trace? A message?
-
I have a project using TidHTTPServer on Delphi 10.3.3 using Indy from Delphi installation. SSL libraries 1.0.2u. All is working. I moved this project to Delphi 10.4.2 and while on http is still working, on https doesn't work anymore. In Fiddler I have his error: [Fiddler] The connection to 'localhost' failed. System.Security.SecurityException Failed to negotiate HTTPS connection with server.fiddler.network.https> HTTPS handshake to localhost (for #377) failed. System.IO.IOException Authentication failed because the remote party has closed the transport stream. And in the browser: ERR_TIMED_OUT Here is the code: var ServerSSLIOHandler: TIdServerIOHandlerSSLOpenSSL; begin ..... RootDir := ExtractFilePath(ParamStr(0)); ServerSSLIOHandler := TIdServerIOHandlerSSLOpenSSL.Create(nil); ServerSSLIOhandler.SSLOptions.RootCertFile := RootDir + 'root.pem'; ServerSSLIOhandler.SSLOptions.CertFile := RootDir + 'cert.pem'; ServerSSLIOhandler.SSLOptions.KeyFile := RootDir + 'key.pem'; ServerSSLIOhandler.SSLOptions.Method := sslvSSLv23; ServerSSLIOhandler.SSLOptions.Mode := sslmServer; ServerSSLIOhandler.OnGetPassword := nil; ServerSSLIOhandler.OnVerifyPeer := OnVerifyPeer; FIdHTTPServer := TIdHTTPServer.Create(nil); FIdHTTPServer.IOHandler := ServerSSLIOHandler; FIdHTTPServer.DefaultPort := 8000; FIdHTTPServer.OnCommandGet := FIdHTTPServerCommandGet; FIdHTTPServer.OnCreatePostStream := FIdHTTPServerCreatePostStream;
-
@zMotoR if you are giving to the user the ability to modify scripts and you are afraid that someone will write an exit(), this looks like a nice method that can be easily applied automatically in the background without the user knowledge.
-
Inch representation format in TEdit like controls
Cristian Peța replied to Cristian Peța's topic in General Help
Now I see there is an TMaskEdit.EditText property. But it looks odd if you have a mask like this "0000 00\/00;0;_" and want to write only "1 1/2" -
Inch representation format in TEdit like controls
Cristian Peța replied to Cristian Peța's topic in General Help
But if you read the Text property you have "12316". How to transform this into a value? And what if the user want to type "12 15/16" or "123 1/4"? And I have my control that do the job but was wondering if there are some other edit controls for this. Maybe it's not so common. -
Hiding a public property in a descendant class
Cristian Peța posted a topic in RTL and Delphi Object Pascal
TMyEdit = class(TCustomEdit) private property Text; end; I try to hide the Text property of TCustomEdit in a descendant class but it doesn't work. Code insight (LSP) in other unit does not see it but the compiler does not complain if I use it. Can I do something to hide the Text property?