-
Content Count
1180 -
Joined
-
Last visited
-
Days Won
16
Everything posted by FPiette
-
A class that returns different types of components
FPiette replied to Stano's topic in Algorithms, Data Structures and Class Design
Sorry, it doesn't explain anything. What are those lines supposed to do? What is MyClass? What is method DBSource supposed to do? What is the argument? -
A class that returns different types of components
FPiette replied to Stano's topic in Algorithms, Data Structures and Class Design
You may understand what you want, but at least I don't! If you want a good answer, you have to formulate a good question. If you want to use your own terms, you must describe each one using concept of Delphi/Object Pascal. And don't forget that not everybody is familiar with non standard component you are using. You'd better express your requirements using only what comes out of Delphi box. -
A class that returns different types of components
FPiette replied to Stano's topic in Algorithms, Data Structures and Class Design
I don't understand your question! A class do not "return different types of component". A class could have a method returning a value which can be an object type or an object instance or another data type. Please rephrase your question... -
slowdown tcp transfer under Windows 10 64bits
FPiette replied to Alain1533's topic in ICS - Internet Component Suite
We'll try to determine if the slow down comes from the computer or from ICS. If you still have the old computer, is it possible to test a simple file copy using Windows explorer from the old computer to a third computer and from the new computer and the same computer. Same file in both cases. Use a big file so that the duration is at least 30 seconds. The goal is to compare the throughput of Windows networking with a common reference (the 3rd computer). Measure several copies, usually the first is slower than the next because the file is not yet in disk cache. Other test: setup a web server or a ftp server on the 3rd computer (You may use ICS demo application). Then measure the throughput to copy the same file as above using ICS at both ends. Again the goal is to compare is HTTP of FTP has changed speed between the old and new computer, everything else staying the same. Using the command line, run "netstat -e" to show Ethernet statistics. You'll see the error and reject count. They should be both zero. By the way, are you using IPv4 or IPv6? -
slowdown tcp transfer under Windows 10 64bits
FPiette replied to Alain1533's topic in ICS - Internet Component Suite
Did you check the speed when compiling your application as 32 and 64 bit? I would also check if connectivity is OK. Maybe the new machine has a bad Ethernet cable or switch or network card and experience a lot of retries. Are "jumbo packets" enabled on the network card? Is there any "security" product checking connections (Firewall, anti-virus,...)? Is the new computer hardware superior to the old one? -
Can't resolve unit named WinDos and Undeclared identifier: 'doserror'
FPiette replied to KPB's topic in General Help
As it's name implies, DosError is the error code returned by an MS-DOS function. With Delphi, used to build Windows application, you have Windows API function GetLastError which is more or less the same function. BUT Delphi mostly use exception to report errors. There is also a global variable "error". To help you much, you should publish the part of your application which generate an error. -
TFileOpenDialog - limit functionality in RemoteApp
FPiette replied to chkaufmann's topic in Windows API
It is much better to handle the problem at the system level. The client connect to the server using credentials (User code and password) that maps to a user on the server. You can change that user permissions so that it can access just what he has to on that server. If there are several users, it is easier to create a group and assigned the permission to the group, denying almost everything else to the user. -
Need help with Delphi 7 / DCPCrypt - TDCP_rijndael.DecryptString - How to make it work?
FPiette replied to steve faleiro's topic in RTL and Delphi Object Pascal
Have you checked that the first stage (Base64 decoding) gives the same result? -
It is better to show at least the full class declaration. No need to insert a screen dump, you can directly insert source code in your message. For now, put private keyword between line 21 and 22 and recompile.
- 4 replies
-
- delphi
- compiler error
-
(and 1 more)
Tagged with:
-
Bits, not bytes. I don't know the rest of the code, but I would suggest to initialize variable I to zero before the move so that the 4th byte is not at an unknown value. Also note that this code is not portable across processor architecture. Intel and AMD processors are "little endian" while ARM processor is "little endian" by default but may be changed. No idea if Android and iOS change the default value. To have predictable value and portable value, it is better to assemble the bytes your self. The code you have may be replaced by: I := Byte(S[1]) + ( Byte(S[2]) shl 8 )+ ( Byte(S[3]) shl 16 ); or event this, if the variable S is really a constant: I := Byte('r') + ( Byte('C') shl 8 )+ ( Byte('f') shl 16 ); This latest expression is constant and once compiled result in only a single CPU instruction.
-
This is way to broad! Use different conversation for each topic. And use a specific subject. Think that those conversation will remains for other to find help. Mixing everything will not help much other peoples, forcing them to read a lot of messages in a given conversation. The best is a lot of SMALL conversations focused on a specific topic. There is no problem if you start 10 conversations for 10 different topics. For the unicode string issue, I would select https://en.delphipraxis.net/forum/5-rtl-and-delphi-object-pascal/
-
32bit RGBA TBitmap to RGB byte stream.
FPiette replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
That has no sense: you ask to change the way to convert from RGBA to RGB, so you can change that part. Sorry but I won't participate any more in this useless conversation about an XY problem. -
32bit RGBA TBitmap to RGB byte stream.
FPiette replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
As you like. There are other existing solutions to convert RGBA to RGB depending on which file format you want to create. An RGB stream copied to a file can't do much. The reader cannot even know the width and height. -
32bit RGBA TBitmap to RGB byte stream.
FPiette replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
Yes, it is saved to file... Saved to which file format? Why are you not telling us the full story? It look to me that it is a XY problem. -
Delphi Community Edition (CE) is currently version 10.3.1. You can compile old Delphi code but you MAY encounter issues because strings (Since Delphi 2009, 10 years ago) are unicode strings (16 bits characters) instead of ansi (8 bits characters). Char, PChar and Strings are related to 16 bits characters. There is no problem with this change as long as strings where used just as string. But if you code use strings as general buffer to contain bytes, then you have to change that. Delphi CE still support 8 bits characters. The types are AnsiChar, AnsiString, AnsiPChar. Have a look at this : https://www.danysoft.com/estaticos/free/delphi-unicode-migration.pdf If you have questions, please open a new conversation with a suitable title because this topic has nothing to do with CE nor installing CE.
-
32bit RGBA TBitmap to RGB byte stream.
FPiette replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
Customer had bigger than 5000x3000 This is not what i call a large bitmap. 15 mega pixel is a normal size for picture. Most today's camera produce much larger images. My Sony A7III which is a mid-range camera produce 6000x4000 pixel while a Sony A7RIV produce 9504x6336 pixel image. I developed radiography software where images can be even really much larger . -
Does the executable stopped working on your own computer or on many Win10 computers? You said a form doesn't show, it is the only flaw? Are the form's position and size saved somewhere for the next run? If yes, maybe you added or removed a screen or changed layout of multiple screens and now the saved position and size are out of view? Does recompiling the application change anything?
-
32bit RGBA TBitmap to RGB byte stream.
FPiette replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
Please define what is a large bitmap for you. -
How to check internet connection with TWSocket ?
FPiette replied to steve faleiro's topic in ICS - Internet Component Suite
But not all servers reply to ping request... -
32bit RGBA TBitmap to RGB byte stream.
FPiette replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
Maybe using pointers to avoid index computation? -
How to check internet connection with TWSocket ?
FPiette replied to steve faleiro's topic in ICS - Internet Component Suite
TWSocket is asynchronous (Means not blocking). Connect is just a request for TWSocket to do the connection. Connect returns long time before the actual connection is established. You really should read the documentation: http://wiki.overbyte.eu/wiki/index.php/Asynchronous_Paradigm You'd better start from an ICS example delivered in the distribution. -
Security - How freaky can you get!
FPiette replied to Clément's topic in Algorithms, Data Structures and Class Design
To avoid reusable hash, one could to use the "challenge" protocol: 1) The client send a request to the server to get a "challenge" (For example a random string). 2) The client send a 2nd request having the password combined with challenge hashed together 3) The server check the hash he received from the client by comparing it with the hash he has computed using the know password, the known challenge and known way to combine them. 4) The server when creating a challenge give it a very short live time and cancel it when the hash is received. With that two steps procedure, the hacker capturing traffic can grab the challenge and the hash. The hash is usable only once and won't help for future connections. The hacker has to do reverse engineering either the client or the server to discover how the challenge and password are combined before computing the hash, an discover which kind of hash has been used. This reverse engineering requires to have access to the computer to get a copy of the software. Should be must more complex than "simply" capturing traffic with a sniffer. -
How to tell what code is locking a file resource within an application
FPiette replied to RaelB's topic in RTL and Delphi Object Pascal
Add the following API: LockFile, LockFileEx. -
How to tell what code is locking a file resource within an application
FPiette replied to RaelB's topic in RTL and Delphi Object Pascal
Using SysInternals ProcessExplorer, you'll see all applications and services running. When selecting one, you can display the handles that are active, among which the files. Using SysInternals ProcessMonitor, you can see in real time all the operation one or more application are doing with file/registry/process/network. You can set a filter to the file you are interested in to limit the size of display. Both tools are free. SysInternals is actually Microsoft... -
Security - How freaky can you get!
FPiette replied to Clément's topic in Algorithms, Data Structures and Class Design
I will use HTTPs with certificate, but tools like fiddler can bypass HTTPS, When Fiddler intercept and decrypt HTTPS, It re-singing traffic with a self-signed certificate and that can be detected at each end of the connection.