delphi

How to pass a cstring from Delphi

I'm writing a tcp client in Delphi for a server that has a series of messages defined as c structs. Below is an example conversion of one of the messages: struct { int32 Reserved; cstring Name; int32 flags; } msg1 = record Reserved : integer; Name : cstring???; flags : integer; end Googling the type tell...

Delphi Load and Edit Pdf Documents

Hi Does anybody know of a product that allows loading and editing of PDF files into Delphi? We need to break apart a pdf document with multiple images (one per page) into single pdf's. Regards, Pieter ...

Convert C# double to Delphi Real48

Hi, I've found the following question Convert Delphi Real48 to C# double but I want to go the other way, C# to Delphi. Does anyone know how this can be done? I've tried reverse engineering the code but without much luck. Update: I'm after C# code that will take a double and convert it into a Real48 (byte[] of size 6). Thanks ...

Exception calling remote SOAP call from thread

This is an extension / next step of this question I asked a few minutes ago. I've a Delphi application with a main form and a thread. Every X seconds the thread makes a web services request for a remote object. It then posts back to the main form which handles updating the UI with the new information. I was previously using a TTimer...

How can I use TMask when the mask contains "["?

I have been experimenting with TMask in Delphi 2010 and it seems to work as expected except in one situation: when the mask name contains [ or ] the mask always seem to return false. For example: var MaskObj : TMask; begin MaskObj:= TMask.Create('c:\[test]\*'); try Result:= MaskObj.Matches('c:\[test]\text'); finally Free...

EFCreateError with JvCsvDataSet

I have been using JvCSVDataSet with Delphi 5 and it works fine. I just moved over to Delphi 2007 and now with the same program I get EFCreateError, cannot create file "" I got the error description from MadExcept 3.0. Here are the code,I get the error in the line 'CADDCOUNT', but if I rem out that line then I don't get the error before ...

How to use TJvBalloonWindow as the hint window for Virtual treeview?

I have a 'hint window leftovers' problem with Virtual Treeview in an Office add-in, and now I want to customize the hint window to solve the problem. I want to use TJvBallonHint from the JVCL package, which is also used in other parts of my program. I inherited TVirtualStringTree and have overridden the GetHintWindowClass method like t...

Delphi LoadLibrary Failing to find DLL other directory - any good options?

Two Delphi programs need to load foo.dll, which contains some code that injects a client-auth certificate into a SOAP request. foo.dll resides in c:\fooapp\foo.dll and is normally loaded by c:\fooapp\foo.exe. That works fine. The other program needs the same functionality, but it resides in c:\program files\unwantedstepchild\sadapp.ex...

Inherited TShape.Paint does not work after overriding Shape property

I'm to code a TExpandedShape class inherited from TShape. TExpandedShape must act like TShape and be able to draw extra shapes: Polygon and Star. Here is my code unit ExpandedShape; interface uses SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, Windows; type TExpandedShapeT...

BDS 2006 webservice compatible with ws-i basic profile 1.0?

Are webservices written in BDS 2006 compatible with ws-i basic profile 1.0? Delphi seems to always add use="encoded" to soap:body which is against this part of the specification: http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html#refinement16448072. ...

Generate dynamic html

Hi all, to export some data i want to be able to generate an html output. I have some constant content to output, like html headers and footers. My question is how to deal with that ? Do I have to embed some template (in a resource file) and parse it to make it dynamic ? Do I store my static content in some constant (is there a 255 c...

Delphi Performance: Case Versus If

I guess there might be some overlapping with previous SO questions, but I could not find a Delphi-specific question on this topic. Suppose that you want to check if an unsigned 32-bit integer variable "MyAction" is equal to any of the constants ACTION1, ACTION2, ..., ACTIONn, where n is - say 1000. I guess that, besides being more elega...

Parse params from an sql query using delphi

How i can parse and extract the parameters from an SQL Query using delphi? example : from this query SELECT * FROM MyTable WHERE Field1=:Param1 AND Field2=:Param2 AND (Field3=:Param3 OR Field4=:Param4) i want to obtain Param1 Param2 Param3 Param4 Thanks in advance. ...

How to use Delphi's AsCurrency to show currency without currency symbol?

I'm trying to display a currency value in a grid, but I do not want the currency symbol to be shown: if fPreferences.WorksheetFormat = 'Numeric' then begin CurrencyString := ''; Value := FieldByName('UnitList').AsCurrency; end else Value := CurrToStrF(FieldByName('UnitList').AsCurrency, ffCurrency, 2, langFormat); The problem is...

How to get TextWidth of string (without Canvas)?

Hi, I would like to get text width of a string before an application starts. Everything works fine until Application.MainForm canvas present. The problem is, when I try dynamically create TOrdinarium in the OnCreate event of the app. main form, "Canvas does not allow drawing" error occurs. (Application.MainForm is nil....). I tried sev...

DataSetProvider - DataSet to ClientDataSet

EDIT: It seems as if the DataSetProvider doesn't have the functionality I need for this project, so I'll be implementing a custom class for loading the data into the ClientDataSet. I am trying to take data from a TMSQuery which is connected to my DB and populate a ClientDataSet with some of that data using a DataSetProvider. My problem...

How test a Delphi app with Application Verifier 4.0?

I download the Application Verifier 4.0 to test my App for check if could have problems on Vista/7. I run from Delphi 2010 debugger, and stop in CPU view. Obviously, I don't understand anything about assembler!. So, I try running directly from the windows explorer, and the App die. (In fact, I don't understand well what exactly will d...

I have the Process ID and need to close the associate process programatically with Delphi 5

Can anyone help me with a coding example to close the associated process when I have the Process ID. I will be using Delphi 5 to perform this operation programatically on a Windows 2003 server. ...

Delphi memory management design strategies : Object or Interface ?

Regarding Delphi memory management, what are your design strategies ? What are the use cases where you prefer to create and release Objects manually ? What are the uses cases where Interfaces, InterfacedObjects, and their reference counting mechanism will be preferred ? Do you have identified some traps or difficulties with reference...

Delphi5 Virtual TreeView wanted

Hi Does anyone happen to have a copy of the Virtual TreeView that is Delphi5 compatible? Or does anyone know where it can be downloaded from? Thanks in advance to any responses. ...