delphi

Getting the Unit Name wich belongs to any type (TRttiType)

I need to get the name of the unit (namespace) of any TRttiType. so far, I have tried the following. 1) using the PTypeData.UnitName, this solution works, but only when the TTypeKind is tkClass. procedure ListAllUnits; var ctx : TRttiContext; lType: TRttiType; Units: TStrings; begin Units:=TStringList.Create; try ctx :...

Delphi: Pass by reference or pass by value?

In Delphi, if I have a simple class myClass and I pass an instance of it to a function with myFunction( myClass ), which is defined by function myFunction( myObject : myClass ) : Boolean... Will a copy of myObject be made? When I call methods of myObject in myFunction, will the original object be affected and modified too? ...

How Determine if a TRttiMethod is a function

I need determine if a TRttiMethod is a function so far, i wrote this function Function IsFunction(QualifiedName,MethodName:string):Boolean; Var ctx : TRttiContext; lType : TRttiType; lMethod : TRttiMethod; Begin result:=false; ctx := TRttiContext.Create; lType:=ctx.FindType(QualifiedName); if Assigned(lType)...

Using Delphi7 TClientDataSet: is it possible to have it save it's XML contents in an indented format

I am using Delphi7 ClientDataSet to read and write xml files for some of my data. Howerver, when I want to browse this outside the program (double clicking the xml in Windows Explorer) I get the 'An invalid character was found in text content. Error processing resource' - even although the data reads and writes fine from within Delphi. ...

read known file extensions / types from the registry

I want to present the user with a list of known file extensions for him to pick. I know that these are stored in the Registry under HKEY_CLASSES_ROOT usually like this: .txt -> (default)="txtfile" where txtfile then contains the information about associated programs etc. Unfortunately that place in the registry also stores lots of oth...

[Delphi7] onResize event with class object

Here's is my code: type TNav = class(TPanel) private procedure CMMouseEnter(var AMsg: TMessage); message CM_MOUSEENTER; procedure CMMouseLeave(var AMsg: TMessage); message CM_MOUSELEAVE; public end; type TForm1 = class(TForm) ... procedure FormCreate(Sender: TObject); private public end; procedure TForm1.FormCreate(Sender: TOb...

Problem with size of a Toolbar2000 with an embedded Frame

I have Jordan Russel's Toolbar2000 toolbars that I create at runtime with an embedded TFrame and dock on the application main form. This frame has an embedded pane that in turn contains other panels and various controls. So the structure is: TTBDock TTBToolbar TFrame (align=alNone, Autosize=true) TPanel 1 (align=a...

Understanding Java as a Delphi programmer

I have a database I have created in Delphi that’s still in the testing phase I found it easy to give access to my database through Java in the form of a *.dll but this is not just a standard database (its very cutting edge with Nodes). It’s taken me a lot of learning to get to this point. I very much appreciate the help and thanks of thi...

How to use an running application from a dll ?

Hi, Im having problems using data from the host application. I want to send a string through the dll into the host, then combine it with some data from the host app. By just including the form in the uses clauses i can use methods to send data into the host, When the data is recived i try to add a lokal variable, this is when i get a ...

Query (SQL Server 2008 Express) works in SQL Server Management Studio but not in Delphi using ADODB

Hi, I have the following query: WITH cte AS ( SELECT windowId, frameIndx, elemIndx, comment, ROW_NUMBER() OVER (PARTITION BY frameIndx ORDER BY elemIndx DESC) AS rn FROM dbo.translations WHERE windowId = 1 AND frameIndx IN ( SELECT indx FROM...

Help building a Dll for C in Delphi

Hi, ive previously asked another questions about building my dll, but it seams like its heading in the wrong direction :) So I have reformulated and explained more her. So what im trying to build is a dll that will work as an interface between my delphi program and some one else's C program. What this dll must do is recive a String fr...

Threads managing problem!

I wrote a program that uses OLE and it was working fine until I added some components which were important for my program, after that my program have problem when starts to work with OLE and raise this exception: "EOleSysError No more threads can be created in the system" is there any way to requesting more threads or free u...

Delphi SQL insert into statement error

qryreg.SQL.Add('Insert into RegistreerTB'); qryreg.SQL.add('Name , Surname, E-mail, Password)'); qryreg.SQL.Add('Values ('+quotedstr(edtname.Text)+','+quotedstr(edtsname.Text)+','+quotedstr(edtemail.Text)+','+quotedstr(edtpassuse.Text)+')'); qryreg.ExecSQL ; qryreg.SQL.Text := 'Select * from RegistreerTB'; qryreg.Open ; This is the cod...

Delphi IDE out of Memory Error caused by GExperts window open

I noticed that there are a lot of IDE memory problems and this is a place where real answers to these issues are found. So.. I thought I would make a section available for answers to (at least) this question is, since I found no other to fix this problem on the net. My problem was that I left my work space for a few hours and when I ret...

Questions on Delphi function parameters

Hi, I'm a C programmer came across this Delphi function and have a few questions. procedure Init(const key; size: Integer; filler: Byte = $FF); overload variable key doesn't have a type specified, what is the type of it in this case? What does the "$FF" means for the variable filler? ...

How to change the date format in combo box?

i'm using TwwDbLookupComboDlg component in delphi 7. I want to change the date format in the combobox (as shown below) from '1/1/2009' to 'Jan 2009', any idea? ...

Can I, from a modal form, activate an existing nonmodal window?

Can I, from a modal form, activate an existing nonmodal window? I use Delphi. In our application the users can edit reports in a nonmodal window. This is usually done by selecting "Edit reports" from the main window. But there is also a possibility to open a report from a modal print dialog. This leads to the following problem: A user o...

Getting error id: 0 from Windows method: FindWindow.

Hi, im trying to send a Windows message to my Delphi application, but im having problems with the FindWindow method: im getting error id of 0 from the GetLastError method. Im running Vista and from what ive read this error is common in XP or earlier versions, but should work fine in Vista or Win 7 (maybe i misunderstood ?). This is ...

Newly compiled application requires UAC/elevation?

hi! I have a system, I set it up as a normal with UAC, and in my delphi environment I compile my project named ka.exe, I create a installshield project for it. setup and everything completes ok! but whenever I start my program, it requires elevation and I don't have any clue why. just to be sure installshield is not playing mindgames ...

Problem in compacting Access 2007 Database, After Compacting Access 2007 Database gets converted to Access 2002-2003 format.

I am using a Delphi procedure to Compact Access Database Code sniphet of procedure is: procedure CompactDatabase(pFullDatabasePathName : string; pLoginName : string = ''; pPassword : string = ''; pSystemDb : string = ''); var JE : TJetEngine; sdbTemp : String; sdbTempConn : String; sdbSrcConn : Stri...