delphi

How do I copy an array of integers between two Delphi Prism applications using WM_COPYDATA?

I'm trying to use WM_COPYDATA to copy data between two Delphi Prism applications on the same computer. In the sender application I have the code: type [StructLayout(LayoutKind.Sequential)] CopyDataStruct = public record var dwData: IntPtr; var cbData: System.Int32; var [MarshalAs(UnmanagedType.ByValArray, SizeConst := ...

Delphi Self-Pointer usage

I need to get pointer to my class instance inside this instance. I can't use "Self" directly, I need store pointer for future usage. I tried next code: type TTest = class(TObject) public class function getClassPointer: Pointer; function getSelfPointer: Pointer; end; class function TTest.getClassPointer: Poin...

FileAge is not working with "c:\pagefile.sys"

Does anybody know why FileAge is not working with "c:\pagefile.sys"? It returns -1. Update: Found it: It is a Delphi bug fixed in Delphi 2010 (QC Entry 73539), but the PDF I have found does not explain how they fix it. Does anyone know how they fix it so I can fix my Delphi 7? UPDATE: Elegant fix provided by Radu Barbu! Delphi...

Using parameters with ADO Query (mysql/MyConnector)

Today I downloaded and installed MyConnector so I can use Mysql with ADO, everything installed, OK!, I can make connection with ODBC and do a connection from my delphi environment. when I build my Query at runetime, I get an error saying : --------------------------- Debugger Exception Notification --------------------------- Project P...

How to delete 2 items with same name at once from dataset?

i have a list in Twwgrid as below: i wan to delete the same stock at once with the right-click pop-up menu as shown above (eg. delete both OREO_CHOC_CREAM either is CTN or UNIT). But now i only can delete 1 by 1 with the code below, any idea to solve this problem? procedure Tfrm1.mniDeleteClick(Sender: TObject); begin inherited; ...

Delphi7: PageControl MouseMove while drag and dropping on it

Hi I have the following problem. There's a pagecontrol on my form and I want to activate a certain tabsheet and then drag and drop (from explorer) to a scrollbox on the tabsheet. (each tabsheet has a scrollbox) I have code to activate a tab when you mousemove over the pagecontrol. (see code below) The problem is that when I drag a file...

How to undelete a module fro a JEDI Version System project

I deleted by mistake a file (pas+dfm) from JEDI. How can I undelete? I don't want to lose the module history. I am using JEDI CLient 2.4.5.0. ...

Preferable way to write Delphi database apps with transactions & data-aware components

Hi, What is the preferable way to write Delphi database applications using transactions and also data-aware components? I have to write a client app that access InnoDB tables, and do some master-detail kind of things inside transactions. After doing some research on transactions (from general point-of-view), then I humbly make a conclu...

Delphi TIDHttp Get bug

Hi guys, I just discovered a bug in tidhttp component. The scenario is this, im creating a small to fetch the pages of website using tidhttp get. I tried it in ebay all is ok, now after ebay i tried amazon thats where i encountered a problem. What happenned on my side is i searched for item "lenovo laptop" in amazon and copied the url o...

Delphi - How can i replace \xA0( or non ascii) chars in a string to ' '?

I have an excel file with numerous non-ascii characters which i would like to replace with the space character. This text is to be entered into a MySQL database, and it will not import with these characters in the strings. I get a "HY000 Incorrect string value" when trying to post the row. ...

Maintaining N simultaneous HTTP downloads

I have an application that queries a web service by a date range. The web service returns a list of GUID's. I then take each GUID and download a WAV file that it corresponds too. Right now I do it one by one and works fine. What I would like to do is download up to N number of WAV files simultaneously. For some reason I just can not g...

Display value on the bar chart

Hi... I want to know how to display value(in percent) on the bar series Thanks.. ...

The specified string is not in the form required for an e-mail address when adding BCC to .net mail

Hi All, I have added a bcc field to my email that I am sending out and getting the error in the subject line. Everything works fine when I comment out the BCC line so I am not sure what is wrong. Here is the code I am using (it is in Delphi .NET but the principal is the same as C# and VB): procedure TEmail.SendEmail(From, SendTo, CC, S...

Delphi How to use TGridPanel

Hello, I want to use Delphi's 2009 TGridPanel, but I don't understand how to use it correctly. For example, I want to have a GridPanel with 4 columns which should have each 25% percent of the GripPanels width. So I put a GripPanel on the form and add 4 ColumnItems. I give the column items SizeStyle ssPercent, and now I try to give eac...

How to calling DLL procedure with parameters?

Hi, I have problems sending using a Dll procedure with parameters, im not allowed to add parameters to the call of the dll method in my test project. Im trying to call this dll method: procedure Transfer(sMessage: PChar); stdcall; begin MainForm.ShowThis(sMessage); end; exports Transfer; TestProj using this: procedure TForm1.B...

Devexpress Layout look and feel does not work on Windows 2003 server?

I am developing a Delphi 2010 application using the TMS Toolbar and the Devexpress layout control and grid. I used the styling options the make the program look like office. This works fine on windows 7 and windows XP. However the program has to run on Citrix (windows 2003 server). On the server the styling options of the TMS component...

Sharing a common memory area in Delphi between PCs

I have a Delphi 2006 app that gathers data and displays it as a summary of many channels, one channel per row on a TDrawGrid. I have the same app running on various other PCs on the network, but these other PC's are slaves - they don't gather data but merely provide a remote display of the summary. At present, the slaves just show a mi...

How do you use NOLOCK with TADOQuery and TADOTable?

I have the SQL text "SELECT * FROM TABLE1 WITH (NOLOCK)". Two questions: How do I make my TADOQuery use the NOLOCK hint without having to include that in the SQL text? I have literally thousands of TADOQuery's with their SQL dynamically built, and it would be difficult to add WITH (NOLOCK) to all of them, not to mention I use with wit...

How to get the status header for a website programmatically

Hi All, I am writing a win32 service in Delphi (should be able to translate any other code if you don't know delphi) that needs to fetch the status of a website. I know how to do this in .NET but am not sure with normal windows based programming. So, I need to query a website and return the Status Code 200, 301 ect. My plan is then to p...

Repositioning images on FormResize proportionally

Hello all! I have a Delphi form with TImages on it. Actually, it's a "fake" desktop with "icons" (the TImages). When the user resizes the form (scales it or maximizes it, for example) the icons on the form should align proportionally. Right now, I'm doing something like this with the images: ImageX.Left:=Round(ImageX.Left * (Width / ...