

TurboMagic
Members-
Content Count
255 -
Joined
-
Last visited
-
Days Won
9
Everything posted by TurboMagic
-
C++ Builder V10.4.1: feature 'C++ Audits' is missing & 'Codeguard' is broken
TurboMagic replied to Michaell's topic in General Help
If you want complier dependent enablement of Audits you can file a feature request. Question for me would be what in audits is not CLang compatible... But I'm no C++ developer.- 2 replies
-
- c++ audits
- codeguard
-
(and 1 more)
Tagged with:
-
Can somebody help me to translate a short Delphi console app to C++ Builder?
TurboMagic replied to TurboMagic's topic in General Help
Thanks! I'll try to find the required time in the next few days. -
Can somebody help me to translate a short Delphi console app to C++ Builder?
TurboMagic replied to TurboMagic's topic in General Help
Sorry, David, but I do not speak "C" much and as the DEC library I'm working on seems to be mostly C++ Builder compatible I didn't want to ruin that compatibility just to have some speed gains on Delphi side. The simple solution would have been to remove the uncommenting and don't care about C++ Builder. -
Can somebody help me to translate a short Delphi console app to C++ Builder?
TurboMagic replied to TurboMagic's topic in General Help
Ok, thanks for this rough translation Remy! Now I simply need to get some DECFormat.hpp and DECHash.hpp. Is there a way to get them generated or do I need to craft/create them manually? -
Hello, I just released a new little utility on GitHub: https://github.com/MHumm/ClassTree It can be used to generate class tree representations for documentation purposes. I hope you like it and don't mind that it's a first version which might still be a bit raw. It fullfiled at least my purposes. Cheers TurboMagic
-
If you like you can contribute this as option via pull request... 😉
-
Yes, it needs the classes to be compiled in, which was ok for my purpose and didn't require to download another library (AST). It is self contained that way but requires source code distribution.
-
My variant generates the hierarchy via RTTI (I don't know how DelphiAST works) and it only considers classes and it can render the tree into textual form (if you use a font containing the needed glyphs). See the GitHub project page, I added two screenshots now.
-
Thanks! I fixed the link. I also had thought I had removed the DEC units...! Grr! I wrote this tool because I needed it for generating some tree for DEC's documentation. If you like to have a search facility you may add this and either create a pull request or contact me otherwise to submit your improvement... 😉
-
Hello, good news is, that I just released a new version of DEC (Delphi Encryption Compendium): https://github.com/MHumm/DelphiEncry...eases/tag/V6.2 What's new? Fixed some regressions, among them some which hindered compilation with older Delphi versions (support for older compilers might be reduced in future versions!) Fixed bugs in the SCOP and SHARK cipher algorithms The unit test for the hash classes got improved by adding original test vectors to those algorithms which didn't already use original test vectors and where we could find those (for most we could) The SHA3 hash algorithm has been added for 224, 256, 384 and 512 bit including support for message lengths not being a multiple of whole bytes. Our implementation uses Eric Grange's optimizes permutation kernel ASM implementation on WIn32 and WIn64 (with his friendly permission of course!) A new demo got added: Hash Benchmark FMX Now have fun with this. The GetIt provided Lite version should follow within the next few days. TurboMagic
-
This is the info that I just released a bugfix version 6.2.1 here: https://github.com/MHumm/DelphiEncryptionCompendium/releases/tag/V6.2.1 What was fixed? fixes bugs preventing use of the demos on older versions, demos have been tested with XE8 Win32 and newer. fixes a bug introduced by Git in a deployproj file of a demo making it non-loadable completely. GetIt submission has already been sent...
-
Just to let you know that I just turned in the submission of the Lite version for GetIt publication. So hopefully it should appear there soon...
-
I'm writing a DLL which shall be called by LabView (among other environments). Calling a simple function which gets 2 numbers, adds them and returns the result works. That one uses calling convention cdecl, as specified by the "client". But strings are a problem. For getting this tested I developed the following simple function, which shall be called by a LabView test application but this always crashes inside the DLL. Currently it crashes here: "Exception beim Stringrückliefern", if I make a var parameter out of CalcRes it immediately crashes here: "Exception in Berechnung". What might cause this? The caller shall pass a string which a number of chars allocated for and the number of chars he allocated the string for + the #0 terminator in CalcResSize. If the result fits in that, it is returned in the string. CalcResSize will represent the number of bytes needed for the string including the #0 after the call so if the caller didn't pass a long enough string he can call the function again using a longer string. Here's the code: uses System.SysUtils, System.AnsiStrings; function Add(Number1, Number2: UInt8; CalcRes: PAnsiChar; var CalcResSize: UInt8): UInt16; cdecl; var Res : UInt16; ResStr : AnsiString; begin try Res := Number1 + Number2; ResStr := AnsiString(Res.ToString); except On E:Exception do begin OutputDebugString(PWideChar('Exception in Berechnung: ' + E.Message)); Result := 2; Exit; end; end; try if Assigned(CalcRes) and ((Length(ResStr) {* SizeOf(Char)} + 1) <= CalcResSize) then begin System.AnsiStrings.StrPLCopy(CalcRes, ResStr, CalcResSize); Result := 0; end else Result := 1; except On E:Exception do begin OutputDebugString(PWideChar('Exception beim Stringrückliefern: ' + E.Message + ' / ' + madExcept.GetCrashStackTrace)); Result := 2; Exit; end; end; try CalcResSize := (Length(ResStr) {* SizeOf(Char)} + 1); except On E:Exception do begin OutputDebugString(PWideChar('Exception in CalcResSize Berechnung: ' + E.Message + ' / ' + madExcept.GetCrashStackTrace)); Result := 2; Exit; end; end; end; Cheers TurboMagic
-
It works now, last failure was to not declare the last function parameter as pointer in the header file they use as this is a var param on my side.
-
Thanks for the answer. I changed it to use Move now like this: Move(ResStr[1], CalcRes[0], Length(ResStr)); In my Delphi test application it works flawlessly, but the LabView application calling the DLL still crashes it. Access violation at address 184E140E ... Read of address 00000003 I will try to log the address of the PChar passed in now and if possible it's contents at that time, but I don't know how to read raw RAM for getting a bit more loginfo...
-
I'm using D10.4.2 and current ICS from GetIt. I'd like to do the following thing but struggle and the demos I have found so far show only one part of the thing each but not how to combine both. I want to send something to an UDP device with unknown address, so I need to send as broadcast. Port is know. Any device listening on that port will send something defined back to me which I want to receive. Sending part already works but OverbyteIcsUdpSend1 example only shows how to send and OverbyteIcsUdpLstn only shows how to listen. Calling Listen anywhere in my code raises an exception ... an Exception of class ESocketException with message 'Address not available (#10049 in listen: Bind)' occurred. FWuTSocket := TWSocket.Create(nil); FWuTSocket.SocketFamily := sfIPv4; FWuTSocket.Addr := '255.255.255.255'; FWuTSocket.MultiCast := FALSE; FWuTSocket.MultiCastAddrStr := ''; FWuTSocket.Proto := 'udp'; FWuTSocket.Port := 1234; FWuTSocket.LocalAddr := '0.0.0.0'; FWuTSocket.LocalPort := '0'; FWuTSocket.LineMode := false; FWuTSocket.OnSessionConnected := OnWuTSearchSessionConnected; FWuTSocket.OnDataAvailable := OnWuTSearchDataAvailable; FWuTSocket.OnSessionClosed := OnWuTSearchSessionClosed; FWuTSocket.Connect; Where to put listen? Or do I need a 2nd socket? If yes, how to set that up so it actually receives the answer(s) of the device(s)? Set the other one in the OnWuTSearchSessionConnected event up and use FWuTSocket.LocalPort as local port? Since I do not have the right device at hand right now I modified OverbyteIcsUdpLstn example to send something back. When that one receives a message it does this: procedure TMainForm.WSocketDataAvailable(Sender: TObject; Error: Word); var Buffer : array [0..1023] of AnsiChar; Len : Integer; Src : TSockAddrIn6; SrcLen : Integer; begin if FSenderAddr.sin6_family = AF_INET then begin SrcLen := SizeOf(TSockAddrIn); Len := WSocket.ReceiveFrom(@Buffer, SizeOf(Buffer), PSockAddr(@Src)^, SrcLen); if Len >= 0 then begin if (PSockAddr(@FSenderAddr).sin_addr.S_addr = INADDR_ANY) or (PSockAddr(@FSenderAddr).sin_addr.S_addr = PSockAddr(@Src).Sin_addr.S_addr) then begin Buffer[Len] := #0; DataAvailableLabel.Caption := IntToStr(atoi(DataAvailableLabel.caption) + 1) + ' ' + String(WSocket_inet_ntoa(PSockAddr(@Src).sin_addr)) + ':' + IntToStr(WSocket_ntohs(PSockAddr(@Src).sin_port)) + '--> ' + String(Buffer); end; WSocket.Close; WSocket.SocketFamily := sfIPv4; WSocket.Addr := String(WSocket_inet_ntoa(PSockAddr(@Src).sin_addr)); WSocket.Port := IntToStr(WSocket_ntohs(PSockAddr(@Src).sin_port)); WSocket.OnSessionConnected := WSocketSessionConnectedAfterReceive; WSocket.Connect; And in the OnSessionConnected event is sends the contents of a packed record like this: WSocket.Send(@FWuT, SizeOf(FWuT)); It is sure that it reads the sending code, but on the other end (that first application which sends a message to the modified OverbyteIcsUdpLstn example) nothing is ever received.
-
I'm using the Embarcadero FR 6 version in D10.4.2 and want to add a watermark. Which way looks properly? I already tried to place a image on top. It contained the text in semi transparent. Image format was PNG. It looked ok in designer but at runtime in preview an PDF output everything else was put in front of it! Even when I had put these other items into the background in designer! The other solution found was adding a frxMemo in EndDoc event. It sourt of works but doesn't cut it either. I could neither find any way to put it the background as all (but then most likely the TCharts would be placed on top in such a fashion that they'd cover my watermark) nor did I see any way to make the text semi transparent. I read about using an OverlayBand, but no description of how to properly use that. Drop in on the page in designer and add a memo with my text to it? Where does it render when? How to make it covering the other things but in a semi transparent way?
-
Setting UsePNGAlpha and transparency in the PDF settings do the trick for PDF output, but for preview and print output this (this = using a PNG image with partial transparent contents) still fails. The watermark image is put into the background and then overlapped with everything else.
-
Thanks in the first place. 1. I do think that image transparent was set to false as I used a PNG. It looked good in designer but not in preview or PDF. I need to check where I can set transparency to true in PDF exportfilter. In my case it had simply put the image behind everything else in preview and PDF. 2. About the OverlayBand: I see references to that and find it in designer, but I don't know how it works. I didn't manage to get it working and I didn't find any documentation for this. Can you give me more information about what to do with this?
-
UDP sending and receiving
TurboMagic replied to TurboMagic's topic in ICS - Internet Component Suite
I just found a little bit of time now and made a new attempt. I record what's happening using Wireshark now and that clearly shows that my device receives my message and it sends something back to the local port my socket got assigned by Windows. But my application never receives anything. I used the UDPSend example as starting point. I initially had tried out this 2 sockets solution but since it didn't work I changed it. I added a new socket and dont use the other one at the moment. Here's the relevant code part: procedure TMainForm.SendButtonClick(Sender: TObject); begin WSocketReceive.Proto := 'udp'; WSocketReceive.SocketFamily := sfIPv4; WSocketReceive.Port := '0'; WSocketReceive.Addr := '0.0.0.0'; WSocketReceive.Listen; MemoReceive.Lines.Add('Local Port: ' + WSocket.LocalPort); end; procedure TMainForm.WSocketReceiveDataAvailable(Sender: TObject; ErrCode: Word); begin // This is never called!!! MemoReceive.Lines.Add(TimeToStr(Now) + ' ' + WSocketReceive.ReceiveStr); end; procedure TMainForm.WSocketReceiveSessionConnected(Sender: TObject; ErrCode: Word); var Src : TSockAddr; Str : RawByteString; begin Src.sin_family := SOCK_DGRAM; Src.sin_port := 8513; // I don't know how to write this one less cumbersome: Src.sin_addr.S_un_b.s_b1 := #255; Src.sin_addr.S_un_b.s_b1 := #255; Src.sin_addr.S_un_b.s_b1 := #255; Src.sin_addr.S_un_b.s_b1 := #255; // This gets sent: WSocketReceive.SendTo(Src, SizeOf(Src), BytesOf(Str), Length(Str)); end; procedure TMainForm.WSocketSessionAvailable(Sender: TObject; ErrCode: Word); begin // This is never called MemoReceive.Lines.Add('Port: ' + WSocketReceive.Port); end; As you can see I added a memo for output. But the only thing ever shown in it is the 'Local port' message posted directly after Listen. What am I'm doing wrong? -
UDP sending and receiving
TurboMagic replied to TurboMagic's topic in ICS - Internet Component Suite
This is not relevant to my still not working UDP problem. I just tried to find that demo quicker by opening that project group and thought I report the errors popping up loading that group so they can be fixed eventually. -
UDP sending and receiving
TurboMagic replied to TurboMagic's topic in ICS - Internet Component Suite
Something else: when trying to open the Delphi\AllDemos project group (current ICS version from GetIt) I get some failures. One is: Failure reading SslSmtpTestForm -> Class TIcsRestEMail not found. The same class is not found for POP3ExcercizerForm and HttpRestForm. For IcsIsapiWebModule failures for properties do not exist are shown for the following properties: ClientHeight, ClientWidth, Color, Font.Charset, Font.Color, Font.Height, Font.Style, PixelsPerInch, TextHeight. Are they known to you? -
UDP sending and receiving
TurboMagic replied to TurboMagic's topic in ICS - Internet Component Suite
If I should use a 2nd socket for listening, how would I set that up? Do a connect with the sending one first, so it can send as broadcast and in the OnSessionConnected create the 2nd socket so that it can listen on the port the sending one used? The party receiving and replying to my broadcast needs to send the answer to the port from which the broadcast message was sent, otherwise it wouldn't know where to send it to (and I don't have influence on how the other device does this anyway). -
UDP sending and receiving
TurboMagic replied to TurboMagic's topic in ICS - Internet Component Suite
Hm ok, but it looks like I don't yet understand 100% what I need to do to make it work. This is my code for setting up the socket: FWuTSocket.SocketFamily := sfIPv4; FWuTSocket.Addr := '255.255.255.255'; //ICS_ANY_HOST_V4; //'255.255.255.255'; FWuTSocket.MultiCast := FALSE; FWuTSocket.MultiCastAddrStr := ''; FWuTSocket.Proto := 'udp'; FWuTSocket.Port := '0'; //cWuTUDPPort; FWuTSocket.LocalAddr := '0.0.0.0'; FWuTSocket.LocalPort := '0'; FWuTSocket.LineMode := false; FWuTSocket.OnSessionConnected := OnWuTSearchSessionConnected; FWuTSocket.OnDataAvailable := OnWuTSearchDataAvailable; FWuTSocket.OnSessionClosed := OnWuTSearchSessionClosed; // FWuTSocket.Connect; FWuTSocket.Listen; I thought I need to use listen instead of connect so I can receive data on that socket as well. But when I change Addr to the above 255.255.255.255 I get an "address not available" #10049 in listen: Bind error from Winsock... Now how to set up the socket properly to send via broadcast but listen for the answers as well? -
UDP sending and receiving
TurboMagic replied to TurboMagic's topic in ICS - Internet Component Suite
Another small question: I had seen that TWSocket offers a LastError property as well. But when replacing WSocket_WSAGetLastError with it the error code is 0. What is this meant for?