Posts

Seems I'm some kind of bug magnet lately for obscure issues. :(

Seems I'm some kind of bug magnet lately for obscure issues. :( I tested the same test app I posted about 2.5h ago on my old Samsung Galaxy Note 2.   When run there it generates the following error when it tries to hit a web service: error: 1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac. The server in question is an IIS box acting as reverse proxy to a Delphi web service e.g. at present Delphi is not handling the SSL, it is just a plain service, and the SSL is handled by the IIS box.  The web service being accessed is basically Delphi implemented SOAP invokable interfaces via SOAP client module imported with the Delphi WSDL importer.   Some quick googling seems to suggest this error happens in multiple environments/languages/servers and is related to OpenSSL version(s).   So it's not entirely clear if it's due to server, client or either/both, but note the following: 1) The same phone can access the web service just fine via the phone's browse...

Finally doing some FMX/Androidy stuff (on XE5) and being a noob about what should be obvious it seems:

Finally doing some FMX/Androidy stuff (on XE5) and being a noob about what should be obvious it seems:   What's the right way to hook some custom object reference/data to an FMX.Listview.TListViewItem that was created with e.g. "newItem := AListView.Items.Add;"? What I've tried: Had a look at the "Objects" property, but that seems to be more to do with specialized pre-defined stuff (e.g. Glyphs, TextButtons, "Accessory" objects) and the "Data" property, which is what I'd have thought would be the way to go.  But "Data" is rebuffing my simplistic attempts, and the documentation is not being much help: http://goo.gl/EjkBFZ    Tried directly assigning e.g. newItem.Data['Obj'] := someObj;  This compiles but then it doesn't seem like that results in the reference going anywhere where one can get it back from the item, such as in the TListViewItemClick event handler.   Tried using the From() method with someObj as par...

More wtf compiler - I hope Allen Bauer can explain why that happens:

More wtf compiler - I hope Allen Bauer can explain why that happens: Edit : if the static is removed it properly inlines. Originally found that issue on a record type where class functions must me marked static. Sounds like a compiler bug to me. Edit2 : It gets even crazier. Now that I know the static was responsible for not properly inlining I returned to my original type where this failed, changed it from record to class but it still failed! After going back and forth commenting out code and in the end having the excact same code as in the sample below it still failed! Move Run2 below Run in the implementation and inline fails. WTF?! Edit3 : Ok, I guess this part from the doc is telling that: "Within a unit, the body for an inline function should be defined before calls to the function are made. Otherwise, the body of the function, which is not known to the compiler when it reaches the call site, cannot be expanded inline." So the question about static preventing the inlin...

Inspired by the Generic Operators of Jon Skeets MiscUtil (http://www.yoda.arachsys.com/csharp/miscutil/usage/genericoperators.html) I thought that would be possible in Delphi as well. So I hacked together the Add method - this could be useful for some other projects involving generics in the future.

Inspired by the Generic Operators of Jon Skeets MiscUtil ( http://www.yoda.arachsys.com/csharp/miscutil/usage/genericoperators.html ) I thought that would be possible in Delphi as well. So I hacked together the Add method - this could be useful for some other projects involving generics in the future. http://pastebin.com/n4PnU7B4

What is preferred practice in filling Affected Version field while reporting issue in quality Portal?

What is preferred practice in filling Affected Version field while reporting issue in quality Portal? I usually put only Delphi versions I have tested and can confirm the issue, but what if it looks like all versions are affected. Should I add them all even if I cannot guarantee with absolute certainty that is true? For instance I reported following issue: Misbehavior in hovering over Minimize, Maximize and Close button on Windows 10 https://quality.embarcadero.com/browse/RSP-11587   I have confirmed the issue exists in Delphi 4, 5, 7, XE4 and XE6. Logical conclusion is that all versions in between are also affected. Should I edit Affected Version to include them all, or leave it as-is? BTW, can someone confirm that issue is still present in XE8? https://quality.embarcadero.com/browse/RSP-11587

Blog post "Object Pascal Handbook Now in Print" at http://blog.marcocantu.com/blog/2015-august-object-pascal-handbook-print.html

Blog post "Object Pascal Handbook Now in Print" at http://blog.marcocantu.com/blog/2015-august-object-pascal-handbook-print.html http://blog.marcocantu.com/blog/2015-august-object-pascal-handbook-print.html

Hi all

Hi all, I Have two records i want to compare their references (something similar to .NET referenceequals), my approach seems to fail, ( I get access violations) my function below tries to convert my record to an object so that I can use TObject 'equals' helper to compare their object Instances. class function TIntX.MakeTIntXRecordAnObject(Const anInstance: TIntX): TObject; begin   Move(anInstance, result, SizeOf(anInstance)); end; hovering over 'result' in the debugger after executing the move command indicates that 'result' is empty. also tried casting " result := TObject(anInstance);" but it did not compile with error saying invalid typecast. please how do I do this, to be compatible with both 32bit and 64bits. Thanks.
Hi all, has anyone seen or heard from Simon Stuart recently?  Have been trying to make contact with him for a few weeks now about a little project, & have had no response via the usual channels (IM, email, etc).  TIA.

Hey guys

Hey guys, I see you writing a lot about inline functions in Delphi but I confess I do not know when use it, and when it can really produce gains. I came from .NET world where that practice is not common (not that it be a demerit), but can be addressed through MethodImplOptions.AggressiveInlining attribute.  Thanks :D

I've been working on an XE8 FireMonkey project for weeks now using my stock Sony Experia Z3C running Android 5.

I've been working on an XE8 FireMonkey project for weeks now using my stock Sony Experia Z3C running Android 5.0.1, and noticed yesterday that there was a system update to 5.1.1 available for my phone which I happily installed. Unfortunately that was the end of my ability to compile to the phone, as XE8 does not recognize my phone any longer, no matter what I try. Has anyone else experienced this or can you offer some advice? I've confirmed that USB debugging and Stay awake in the Developer options is enabled.
I've been working on an XE8 FireMonkey project for weeks now using my stock Sony Experia Z3C running Android 5.0.1, and noticed yesterday that there was a system update to 5.1.1 available for my phone which I happily installed. Unfortunately that was the end of my ability to compile to the phone, as XE8 does not recognize my phone any longer, no matter what I try. Has anyone else experienced this or can you offer some advice? I've confirmed that USB debugging and Stay awake in the Developer options is enabled.

Dear Delphi compiler - are you kidding?!

Dear Delphi compiler - are you kidding?! Yes, following code it compiled with optimizations on and the method is inlined. Project48.dpr.28: FastDefaults.TComparer .Default.Compare(1, 2); 004CDF65 C745F801000000   mov [ebp-$08],$00000001 004CDF6C C745F402000000   mov [ebp-$0c],$00000002 004CDF73 8D55F4           lea edx,[ebp-$0c] 004CDF76 8B12             mov edx,[edx] 004CDF78 8D45F8           lea eax,[ebp-$08] 004CDF7B 8B00             mov eax,[eax] 004CDF7D 3BD0             cmp edx,eax Johan Bontes I found out the cause: The Compare method has this code: Result:= integer(PInteger(@Left)^> PInteger(@Right)^)-   integer(PInteger(@Left)^ If I just call this function then it inlines the code better: function CompareInt(const left, right): Integer; inline; begin   Result := Integer(left) - Integer(right); end; and generates this asm: Project48.dpr.28: FastDefaults.TComparer .Default.Compare(1, 2); 004CDF65 C745F801000000   mov [ebp-$08],$00000001 004CDF6C C745F402000000   mov [ebp-$0c]...

Marco's Object Pascal Handbook is now on Amazon.

Marco's Object Pascal Handbook is now on Amazon. http://www.amazon.com/Object-Pascal-Handbook-Marco-Cantu/dp/1514349949 http://www.amazon.com/Object-Pascal-Handbook-Marco-Cantu/dp/1514349949

are there any TypeInfo helper somewhere ?

are there any TypeInfo helper  somewhere ? the TypeInfo unit is somewhat complex to handle, but I don't like how the Rtti context handles things... I'm looking for something like this : type   TTypeInfoHelper = record helper for TTypeInfo     function DataPtr(Offset: Integer): Pointer; inline;     function DataByte(Offset: Integer): Byte; inline;     function DataLong(Offset: Integer): Integer; inline;     function RecordFieldsOfs : Integer;     function RecordFieldCount: Integer;     function RecordFieldType(Index: Integer): PRecordTypeField;   end;   TRecordTypeFieldHelper = record helper for TRecordTypeField     function InstanceSize: Integer;   end; function TTypeInfoHelper.DataPtr(Offset: Integer): Pointer; var   Value: PByte; begin   Value := PByte(TypeData);   Inc(Value, Offset);   Result := Value; end; function TTypeInfoHelper.DataByte(Offset: Integer): Byte; begin   Result := PByte(DataPtr(Offset))^; end; function TTypeInfoHelper.DataLong(Offset: Integer): Integer; beg...
Any wrapper for Apache QPID?
I got a problem, How can we resize bitmap smoothly in Delphi??

Hello all

Image
Hello all, I have a question about the usage of the DataSnap filters. According to documentation: "Each filter can perform transformations over the byte stream such as encryption and/or compression; the byte stream can be intercepted by more than one filter and such the output of one becomes the input of the next filter." So...If (for example) we use two filters: one for the compression and a second one for the encryption: 1. Which of them must be added to the Filters collection as a first filter? 2. The byte stream is intercepted from zero to the end of collection or... from the end of the filters collection down to zero? I think that the compression filter must be used as a first filter over the data, but... the datasnap wizard fill the filters collection in the next order: 1. PC 1;(encryption) 2. RSA;(encryption) 3. Zlib Compression;(compression) I want to add some filters programmatically ("LZO" and "Rijndael"), but I'm confused about the right ord...

Hey guys

Hey guys, A strange thing is occurring as my package library, I am targeting only Android and iOS, but every time I reopen the project in RAD Studio XE8.1 it adds Windows 32-bit as a target, but I don't want it and I don't know how to stop it from doing that. :D

Hello guys

Hello guys, Is the performance of the Inc() function over I : I + 1 addition really significant for next-gen compilers? Thanks :D

I have some new team members that are looking at some of my old code and interpreting object ownership differently than I am. I'm trying to figure out if there is something I can change in my code that makes it easier for new maintainers of the code to follow my intent. Or maybe I am not following a standard out there and need to adjust my coding style.

I have some new team members that are looking at some of my old code and interpreting object ownership differently than I am.  I'm trying to figure out if there is something I can change in my code that makes it easier for new maintainers of the code to follow my intent.  Or maybe I am not following a standard out there and need to adjust my coding style. If I have a business object that needs to share data or other objects I normally pass those objects in on the constructor.  The objects that are passed in I always free at the same level they are created.  In other words I don't expect my business objects to take lifetime control of anything they are passed in their constructor.   So for example if I have a form that creates a dataset and then passes that to two business objects. procedure TForm1.Create() begin   FData := TDataSet.Create;   FBusinessObject1 := TBusinessObject1.Create(FData);   FBusinessObject2 := TBueinssObject2.Create(FData); end; TForm1.Destroy() begin   FBu...

Hello, does anyone know what this error is?

Hello, does anyone know what this error is? It occurs when build for android. I recently installed Windows 10. I use XE8. Thank you. [Exec Error] The command "PATH C:\Program Files\Java\jdk1.7.0_71\bin;C:\Users\Public\Documents\Embarcadero\InterBase\redist\InterBaseXE7\IDE_spoof;C:\Program Files (x86)\Embarcadero\Studio\16.0\bin;C:\Users\Metal\Documents\Embarcadero\Studio\16.0\Bpl;C:\Program Files (x86)\Embarcadero\Studio\16.0\bin64;C:\Users\Metal\Documents\Embarcadero\Studio\16.0\Bpl\Win64;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Users\Public\Documents\Embarcadero\Studio\16.0\Bpl & "dx.bat" --dex --output="C:\Users\Metal\Documents\Embarcadero\Studio\Projects\Android\Debug\classes.dex" "c:\program files (x86)\embarcadero\studio\16.0\lib\Android\Debug\android-support-v4.dex.jar" "c:\program files (x86)\embarcadero\studio\16...

I found "Fun with Delphi XE6 App tethering and barcodes" at Fixed by Code and, using that example, my Android app can scan and get the UPC number.

I found "Fun with Delphi XE6 App tethering and barcodes" at Fixed by Code and, using that example, my Android app can scan and get the UPC number. OK, so far so good, but how can the app get data for that code?

Is it time for a quality offensive for Delphi?

Image
Is it time for a quality offensive for Delphi?

Hey guys

Image
Hey guys, I am surfing on a problem, I am not being able to use my units from a runtime package targeting Android. In the Firemonkey application I go to Options -> Runtime packages and I add the .dcp file relative to the package but it doesn't work :( I want to use the units written in the package but I don't know no more how to do it once my first try was unsuccessful. Thanks in advance :D

Just watched Stefan Glienke 's TestInsight Development Skill Sprint and TestInsight for XE8 has been released :)

Just watched Stefan Glienke 's TestInsight Development Skill Sprint and TestInsight for XE8 has been released :) http://files.dsharp.org/TestInsight/1.1.0.0/TestInsightXE8Setup.exe

I've updated the legacy IDE Fix Pack 4.4 for Delphi 2007 to support Windows 10 (and 8.1).

I've updated the legacy IDE Fix Pack 4.4 for Delphi 2007 to support Windows 10 (and 8.1). http://andy.jgknet.de/blog/2015/08/ide-fix-pack-4-4-for-delphi-2007-windows-10-edition/

Started to write TForge wiki-documentation - https://bitbucket.org/sergworks/tforge/wiki/Home. Most important so far are installation instructions - seems like many folks don't know how to configure and install runtime packages. Bitbucket's Markdown wiki does not look ideal but easy to write and read.

Started to write TForge wiki-documentation - https://bitbucket.org/sergworks/tforge/wiki/Home . Most important so far are installation instructions - seems like many folks don't know how to configure and install runtime packages. Bitbucket's Markdown wiki does not look ideal but easy to write and read.

Fellow Delphi developers

Image
Fellow Delphi developers, This is with great pleasure that we announce the immediate availability of HelpNDoc 4.8, an easy to use yet powerful help authoring tool producing CHM help files, HTML or mobile WebSites, DocX and PDF manuals as well as ePub and Kindle eBooks from a single source. HelpNDoc is Free for personal use and evaluation purposes and is available at: http://www.helpndoc.com HelpNDoc 4.8 provides many new features and enhancements including a new keyboard shortcut to insert hyperlinks and library items at an amazing speed, the possibility to override variables for each build and much more. You can learn more about this update at: http://www.helpndoc.com/news/2015-08-04-amazingly-fast-insertion-hyperlinks-and-library-items-helpndoc-48 Download HelpNDoc now and use it for free for personal and evaluation purposes: http://www.helpndoc.com/download Follow our step-by-step video guides to learn how to use HelpNDoc: http://youtu.be/u1XVAR985g8?list=PLe52dEok5gAlrGpJ9IxdFEfVrC...

Windows 10 - A new spyware experience.

Windows 10 - A new spyware experience. https://i.imgur.com/iHge6RJ.jpg https://i.imgur.com/iHge6RJ.jpg

So, my coworker is getting an Access Violation when typing into the IDE Insight... and we can't seem to fix it. A single letter will do, and once typed the Access Violation is triggered as long as the letter is there (holding ESC for a bit usually works to get out of this).

So, my coworker is getting an Access Violation when typing into the IDE Insight... and we can't seem to fix it. A single letter will do, and once typed the Access Violation is triggered as long as the letter is there (holding ESC for a bit usually works to get out of this). Running XE6.1 on a new Win 8.1 x64 install. We've tried reinstalling Delphi, no dice. We've tried with and without the IDE fix pack. Any ideas what it might be? Some installed package that's screwed up somehow? Here's the stack trace without the fix pack: [2111BB82]{designide200.bpl} DesignEditors.TPropertyEditor.GetPropType (Line 751, "DesignEditors.pas" + 0) + $6 [204C44E8]{coreide200.bpl} Node.TNode.TAttributeList.GetValue (Line 274, "Node.pas" + 2) + $10 [223A5D7F]{delphide200.bpl} DelphiProject.TDelphiCodeIWin32Project._AddRef (Line 391, "DelphiProject.pas" + 1) + $1 [5005EE68]{rtl200.bpl  } System.TObject.GetInterface (Line 15953, "System.pas" + 8) + ...