delphi

getmem memory leak, delphi

Hi all I am trying to run a old midi component in Delphi, and it works for the most part of it, but if I try loading 2 files in a row, it crashes. some research led me to install EurekaLog, which point to memory leaks in the code.yay! I'm not very good with memory pointers stuff, but this code down is highlighted by Eureka here got me...

programmatically check computer management - shared folders - open files for a file

We have a client server software that needs to be updated. I need to check if the file is currently being accessed. Is this possible if so how Delphi code if possible. The only place I can see if the file is open is under the shared folders open files. I have tried this code but just shows that the file is not opened. function TfrmMain...

Limit on clientdataset columns and size

Hi, Is there a limit on the number of columns a client dataset can have and also is the limit on the size of the columns? We have an app that loads the client dataset from an xml file (it is not a file on disk but an xml block in memory which is loaded) and we found that if we set the width on one of the columns to over a 1000, then w...

Does DeferWindowPos work well with the VCL?

I'm considering to increase my usage of DeferWindowPos. Up to now I used it in some simple circumstances and didn't notice any problems. Do you know of any pitfalls, where e.g. the FLeft/FTop/... fields aren't updated correctly or similar things? ...

Program freezes 30 sec while accessing a disconnected drive

Hi. I have this piece of code that drives me mad. FUNCTION DiskInDrive(CONST DriveNumber: Byte): BOOLEAN; VAR ErrorMode : Word; BEGIN RESULT:= FALSE; ErrorMode := SetErrorMode(SEM_FAILCRITICALERRORS); TRY if DiskSize(DriveNumber) <> -1 { %%%% THIS IS VERY SLOW IF THE DISK IS NOT IN DRIVE !!!!!! } THEN RESULT:= TRUE; ...

how to use different oracle character sets in one application

Hi Guys, i'm developing a 32bit Client-Application with Delphi. From this application I need to connect to databases on two different servers. First databse character set ist WE8MSWIN1252, the other server decodes with WE8PC850. Setting the client NLS_LANG parameter to the correct value solves correct sql-query results. Unfortunately t...

Are there any optimisations for retrieving of return value in Delphi?

I'm trying to find an elegant way to access the fields of some objects in some other part of my program through the use of a record that stores a byte and accesses fields of another record through the use of functions with the same name as the record's fields. TAilmentP = Record // actually a number but acts like a pointer private Ord...

Why isn't operator overloading available for classes in Delphi?

I've always wondered about this for a bit, but why is operator overloading not available for classes in Delphi? I remember reading an answer once while on the run, and it said it would come in conflict with something, but I can't remember much. As far as I can tell, only the implicit operator may cause a bit of problems since classes ar...

Confusion of thread synchronization problem.

It makes me confused when I read the article by Zarko Gajic today: "Multithreaded Delphi Database Queries" Article URL: http://delphi.about.com/od/kbthread/a/query_threading.htm Sourecode: http://delphi.about.com/library/weekly/code/adothreading.zip With the code of "TCalcThread.Execute" procedure, Why the following code do not need ...

Delphi ini file vista/xp/win7 Question

Update: I've added the following code: function TSettingsForm.AppDataPath: string; //CSIDL_APPDATA Individual user Data //CSIDL_COMMON_APPDATA Common to Computer Data // works so long as people have at least IE 4. (and Win95 or better) var r: Bool; path: array[0..Max_Path] of Char; begin r := ShGetSpecialFolderPath(0, pa...

Virtual StringTree: Text returned by the OnGetHint event handler is not shown in the hint window

Hi, I wrote a handler for the OnGetHint event of the Virtual StringTree control, and I'm sure that the hint text is returned, but the hint window is blank, see the screenshot below, what might caused this problem? thank you in advance. The settings of the control: AnimationDuration := 0; ClipboardFormats.Clear; ClipboardFormats.Add('...

Combining Delphi & remobjects via SSL

Hi. I'm in the development of a server client solution. The server is written in delphi and the client written in c#, and we're using RemObjects 5 (xml webservice thingy) to perform the communication. Now, I've got a working soluting using HTTP, but of course we would like to use HTTPS using. I've looked at OpenSSL earlier, but it se...

How to search and replace a tag value in xml file using delphi?

How to search and replace a tag value in XML file using Delphi? I know what the XML tag is, but the value is random and simply needs to be reset to a default value, so in reality I cannot/should not search for the value but only the tag. I also know the location of the file/files. I'm new to Delphi, can someone provide me a simply exam...

Multiple Expanding Nodes in Virtual TreeView possible?

I am using a TVirtualStringTree (part of the Virtual TreeView Component) in my Delphi project and I would like to create a view where 2 columns can have children that are expandable/collapsable with [+] sign. In the picture below as sample I would like to have a [+] sign in the Server Column but also in the Image column. The idea is tha...

Piping data to a file with the windows ‘ShellExecute’ function

Hi I am using the ‘ShellExecute’ function in windows vista Is there any way to pipe the output to a file? i.e. MySqlDump.exe '-u user1 -ppassword dbName > TheOutputFile.Sql Here my code theProgram := 'MySqlDump.exe'; itsParameters := '-u user1 -ppassword dbName'; rslt := ShellExecute(0, 'open', ...

[Delphi] LDAP query with FILTER

Suppose i have a following LDAP query: Base DN: OU=Groups,DC=office,DC=domain,DC=org Filter: (member:1.2.840.113556.1.4.1941:=CN=adam smith,OU=Users,DC=office,DC=domain,DC=org) How can I execute it under Delphi(2007)? Examples using ADO seem to have SQL'ish syntax and I do not now how to convert it? ...

Delphi 2009 using MSBuild in RAD Studio Command Prompt F1026 File not found

I have been stuggling to get the MSBuild to successfully build my .dproj file for the last few days on a build machine. First, I needed the EnvOptions.proj file from the developer's machine, which got me clear of the missing system.pas file, but now I am getting a compile error for a missing .dcu C:\Program Files\CodeGear\RAD Studio...

Why can't Delphi records have inheritance?

Something I've wondered for a long time: why aren't Delphi records able to have inheritance (and thus all other important OOP features)? This would essentially make records the stack-allocated version of classes, just like C++ classes, and would render "objects" (note: not instances) obsolete. I don't see anything problematic with it. T...

Embeding SSRS report viewer in Delphi

Perhaps this question is naive, as I am just starting with ssrs. This is a large Delphi (2009) application that currently uses Crystal (activex) for reports. We are wanting to move to ssrs but would still like to control the report parameters from within our app as we've done with crystal. I've seen the Report Viewer Control for a VS env...

Delphi 2007 generating incorrect SOAP messages

I am writing an application in Delphi 2007 which consumes a web service. I used the WSDL importer to generate the necessary code to communicate with the service, but I'm getting "unexpected subelement (elementname)" errors when trying to use the service. Using Fiddler 2, I've found that the problem is that an xmlns is being added to an...