delphi-2010

How to change a generic type value?

Hello, In my application, I've created the TList type list, intended to store Integers or Doubles: TKList<T> = class private FItems: TList<T>; function GetItem(Index: Integer): T; procedure SetItem(Index: Integer; const Value: T); function GetMaxValue(): T; function GetMinValue(): T; public constructor Creat...

What can cause SysFreeString to hit an Int 3 breakpoint?

I've got some code that worked fine under Delphi 2007 but breaks under D2010. It involves passing in a string, converting it to a PWideChar (specifically, a WideString pointer, not a UnicodeString pointer), doing some processing, and then calling SysFreeString on it. It works fine until a blank string is passed in, then SysFreeString b...

what do I need to use XSLT 2.0 with Delphi

what do I need to use XSLT 2.0 with Delphi(win32)? At the moment I use MSXML6 for all my xml transformation. But MSXML6 has no support for XSLT 2.0. The solution (by ErvinS) Using the AltovaXML library. After installation you have to import the AltovXML typelibrary. Then you can use a source like this: procedure TfrmMainAltovaXmlDemo.b...

Delphi 2010 Blockread seems to get different data than previous version

Hi All I had my old MP3 Id3 tag reader recompiled under D2010 and it seems it won't find the tags anymore. code is farily simple, but it doesn't work. The debugger shows a lots of zero and then chineese signs in the results! var dat:file of char; id3:array [0..TAGLEN] of Char; //is 0..127 for ID3 v1 begin vValid:=True; ...

are delphi 2010 programs capable of tackling vista/win7 UAC by default

if you compile a program in D2010 a manifest .res file is automatically generated. is it included in your program by default? or you have to include it yourself?if yes what level of privilage is given to you? my program modifies a registery key would it be able to do so with out any modifications to .res file?if no what modifications i n...

delphi 2010 and dbexpress firebird driver

I am getting to know the dbexpress firebird driver from Chau Chee-Yang (http://sites.google.com/site/dbxfirebird/) I find it hard to install because there is very little information, I succeded making a connection, but several questions arise: When using the data explorer and I want to connect to the database sends me the following erro...

Why does UnitCount differ between PackageInfoTable and TPackageTypeInfo?

If you put a breakpoint in System._StartExe and examine the InitTable that gets passed in, you'll notice that InitTable.UnitCount is greater than InitTable.TypeInfo.UnitCount. Unfortunately, neither of these records are documented very well. Does anyone know what these two numbers represent and why they're different? I assume InitTabl...

Function written in Delphi2010 COM object not visible in C# .net

Hi, I wrote a function in Delphi 2010 COM object. This function will return string using PChar. I tried to use the COM object in C# .net. So, i added the reference to the COM DLL in my C#. NET application. I found out that the function is not visible in the References explorer list, whereas the other functions which i wrote earlier a...

Delphi TPath.GetTempPath result is cropped

Hi all! I am using Delphi 2010 and my program wants to get the system's temp path. I am using TPath.GetTempPath and everything is working fine... at least for me and my coworkers. But on some customer machines this method returns a cropped path which is (of course) not existing. I found out that the problem seems to be the result from u...

Free Delphi compiler

Is there a free official Delphi 2010 compiler available for download? I have visited embarcadero's website but only see versions that cost $1500+. ...

Delphi 2010 RTTI - how can I get list of indexed properties?

With Cont := TRttiContext.Create; for Prop in Cont.GetType(TStrings).GetDeclaredProperties do Memo1.Lines.Add(Prop.ToString); Cont.Free; I get list of all properties of TStrings except indexed properties (Strings, Values, ...). As I can see in Get[Declared]Properties are never indexed properties. How can I get indexed proper...

Delphi: Convert a TByte into its corresponding Hex-Value in AnsiString

Hello everybody, I'm trying to output the value of a TByte as its corresponding hexadezimal representation in an AnsiString. Example: TByte is 0x4F AnsiString: "4F" (two characters, a 4 and an F) I know of the StringOf function, but that converts to the "mapped" character. Is there any decent function build in or does somebody has a ...

What does delphi compiler error E2134 mean?

In some code I am fixing up, which makes heavy use of generics and interfaced types, I am getting error E2134, Type '<void>' has no type info. I believe it is because I am in the middle of a refactor where some deeply nested set of units that all use generics are out of sync, but the error is not happening in a place where I can mak...

Delphi 2010 RTTI - RttiContext.FindType

Hi With RttiContext.FindType('Classes.TStringList') I get RttiType of TStringList with no problem. But with RttiContext.FindType('MyUnit.TMyClass') I always get nil (of course MyUnit is in uses clause). Why, what is wrong? Example: unit MyUnit; interface uses Classes; type TMyClass = class(TStringList) end; implementation...

PostMessage returns "invalid window handle" in thread

Background: I am using OmniThreadLibrary to load batch mode ADO stored procedures in the background. I am doing some slightly dodgy stuff by swapping the connection after opening the SP but that seems to be quite reliable. I'm using PostMessage to send messages back to the calling form and that works in my test applications. Primoz' comm...

Gecko 2 ActiveX Control VCL component in Delphi?

Hey there, How can I import the Gecko 2 (used in Firefox 2) Active control into the component palette so I can add it to my form at design-time? Basically, I want something like a TWebBrowser component, but not using Internet Explorer. Nor do I want the outdated Mozilla Control ( http://www.iol.ie/~locka/mozilla/mozilla.htm ) or the Ge...

Does Delphi 2010 have a LoadTextFromFile function?

While porting some code from Delphi 7 to Delphi 2010 I was rewriting my LoadTextFromFile() function. function LoadTextFromFile(const aFullFileName: string): string; var lBuffer: TBytes; lEncoding: TEncoding; lFileStream: TFileStream; lSize: Integer; begin if not FileExists(aFullFileName) then begin raise Ex...

Model OnCreate Event for Delphi Frame

I am developing a Delphi frame and need to load a list of business objects into a grid control at the beginning. Delphi frames have no OnCreate event, so what is the best way to replicate this? Should I override the constructor like is suggested on About? Should I just make a public loadData() procedure and have the parent container c...

Uninstalling IBObjects on delphi 2010

Hello everyone, I installed ibobjects in delphi 2010 to give the components a try, now I want to uninstall them, I run the uninstaller but when I complie my existing proyects I get the following error: [DCC Fatal Error] accedoCFD_2011.dpr(15): F1026 File not found: 'IB_Access.dcu' And when I try to run my proyects outside the delphi id...

Delphi: StringGrid, position and Context Menu

I'm having a problem with using a TStringGrid and Popup menu I want to know the Row / Column of the cell that was last active when select an item from my Popup menu. However when I click on the popup menu, the StringGrid.Row is returned as -1. I've tried using MouseToCell as part of OnClick, but even after setting SG.Row it still retu...