delphi

How can programmatically check which version of the WMI is installed

How can programmatically check wich version of the WMI (Windows Management Instrumentation) is installed using delphi or C# ? thanks in advance. ...

guidelines for develop a windows service wich communicates with an Oracle server via ADO

I want to develop windows service in Delphi that communicates with an Oracle server via ADO. Wich guidelines should I follow? i really knew ADO, but i dont have experience with the windows services. Thanks in advance. ...

About enumerations in Delphi and c++ in 64-bit environments

I recently had to work around the different default sizes used for enumerations in Delphi and c++ since i have to use a c++ dll from a delphi application. One function call returns an array of structs (or records in delphi), the first element of which is an enum. To make this work, I use packed records (or aligned(1)-structs). However,...

Is it possible or reasonable to implement the double-checked locking in Delphi?

As I known, there are two common kinds of practices to ensure the thread safety of lazy-initialization: Double-checked locking (Marks the variable as volatile to avoid the memory ordering) InterlockedCompareExchangePointer It seems VCL uses the second practice. Is there any reason? class function TEncoding.GetUTF8: TEncoding; var ...

The Reason of Service Termination

I use a service application I created in Delphi. My problem is that it is sometimes terminated by the operating system and I don't know why this happens. When I go the the system events, I can find a piece of information like this one: Event ID: 7034, The [...] service terminated unexpectedly. It has done this [...] time(s). I know yo...

Can threads safely read variables set by VCL events?

Is it safe for a thread to READ a variable set by a Delphi VCL event? When a user clicks on a VCL TCheckbox, the main thread sets a boolean to the checkbox's Checked state. CheckboxState := CheckBox1.Checked; At any time, a thread reads that variable if CheckBoxState then ... It doesn't matter if the thread "misses" a change to th...

List local printers

I am using this routine to list the local printers installed on on a machine: var p: pointer; hpi: _PRINTER_INFO_2A; hGlobal: cardinal; dwNeeded, dwReturned: DWORD; bFlag: boolean; i: dword; begin p := nil; EnumPrinters(PRINTER_ENUM_LOCAL, nil, 2, p, 0, dwNeeded, dwReturned); if (dwNeeded = 0) then exit; GetMem(p,dwN...

Can Delphi dragging be "promoted" to docking?

I have a TPageControl whose pages are all various forms that are attached using ManualDock(). The user should be able to rearrange the tabs by dragging them, which works already. It should however also be possible to undock the docked forms. For now I have the following code: procedure TMainForm.PageControlMouseDown(Sender: TObject; Bu...

How to make TWebBrowser ignore accelerator chars of others controls?

I have a TWebBrowser placed on a form with the designMode enabled. Bellow the browser I have a close button with the Caption set to 'Clos&e'. When I am editing the contents of a document inside the WebBrowser and I press the key E the button close is called. It appears that it is treating TWebBrowser like other controls that don't handle...

Delphi debug a wrong unit

This is an odd behaviour by my D2006 as it happens sometimes only. I have a project I want to debug. The file I want to debug is named 'Main.pas'. I have another unrelated project with the same Unit name and sometimes the Debug prompt me the wrong Main file instead of the Main unit from the current project. This have happened to me with ...

MultiCast Messages to multiple clients on the same machine

Im trying to write a server/service that broadcasts a message on the lan ever second or so, Kind of like a service discovery. The message needs to be received by multiple client programs that could be on the same machine or different machines. But there could be more than one program on each machine running at the same time...

Need Web Service tutorials

I'm Looking for Web Service develop(by delphi) tutorials, including the development of services and clients. Thanks! ...

create a wav file from multiple wav files in delphi

i' ve a problem in doing my final project... i'm having trouble with how to save multiple wav files into 1 wav file.. let's take an example: i have 3 wav files which are the syllables of the word "hospital" : "hos.wav", "pi.wav", and "tal.wav" (sorry if i'm wrong in determining the syllables of the words).. each of those syllable wav fi...

How to make this OO?

Hello, Sorry for the poor title,I'm new to OOP so I don't know what is the term for what I need to do. I have, say, 10 different Objects that inherit one Object.They have different amount and type of class members,but all of them have one property in common - Visible. type TSObject=class(TObject); protected Visible:boolean; en...

Change Pixel Format

Can anyone advise how to change a bitmap from 32-bit BGR to 32-bit BGRA using TWICImage? ...

There is another way to load MSHTML documents without use Application.ProcessMessages?

There is another way to load MSHTML documents without use Application.ProcessMessages? To load a document into a IHTMLDocument I need to do this: while Doc.readyState <> 'complete' do Application.ProcessMessages; I want not to process all the message queue during the loading, because I would be changing my application flow, in ...

[delphi] same class used in two separate libraries not compatible?

Came by a curious case today, that got me thinking about how the object model in delphi really works. The case: We have imported a SOAP service that expose a couple of methods, taking objects as parameters. Delphi generates classes/interfaces that we use to communicate with the soap service, and the objects used as parameters all inher...

Delphi: How to diagnose sluggish UI?

i have a form, which you can pretend is laid out like Windows Explorer: panel on the left splitter client panel +------------+#+-----------------------+ | |#| | | |#| | | |#| | | |#| | | Left |#| ...

What is The Loop Variable After a For Loop in Delphi?

In Delphi, consider var i: integer; begin for i := 0 to N do begin { Code } end; One might think that i = N after the for loop, but does the Delphi compiler guarantee this? Can one make the assumption that the loop variable is equal to its last value inside the loop, after a Delphi if loop? Update After trying a few si...

how to update a selected record in a dataset and update another datatable in another Adoconnection?

I have 2 adoconnections and 2 datatables in each connection (Local Table1_master Table1_Detail) (Network Table1_master Table1_Detail). I show them in a DBgrid and now I would like to update the (Local Table1_master Table1_Detail) from the tables in (Network Table1_master Table1_Detail). How can I update the selected records? I have tr...