delphi

How to find a dangling interface that causes an AV in Delphi

I've a complex application to which I've just introduced some changes, adding a couple of new classes with interfaces and deleting some others. Functionally it all works but I get an access violation just after the Destroy procedure of a class: "Access violation at address 0040B984 in module 'xxxx.exe'. Read of address 80808088". I kno...

Code Insight (IntelliSense)

I am trying to add a description to functions I developed - I want this description to display in code insight when another developer is using my units or when a user uses API/COM to connet and uses our software. At the moment all they see is e.g. Function name and return type but they have no idea what the function does exactly. in C# ...

How to use Unmanaged Exports in Delphi

I'm making a project in C# and I want to use Unmanaged Exports and later to use it in Delphi. So can anyone explain me, how does Unmanaged Exports works, then how to use/import in Delphi. I'm using Visual Studio 2010 Express, on Windows 7 64 bit ...

Reading the output file of ShellExecute() in Delphi 2010?

I use the ShellExecute command to run an exe file which gets an input text file and returns an output text file. I've written it like this: ShellExecute(mainFormHandle, 'open', 'Test.exe', 'input.txt output.txt', nil, sw_shownormal); //Read the output file... S_List.LoadFromFile('output.txt'); Writeln(S_List[0]) I provide the inp...

Disable system beep on TSpinEdit when pressing Enter

I have a default button on a form that has a TSpinEdit control on it. When the TSpinEdit control has the focus and the user presses the Enter key, instead of the default button getting clicked, the user just hears a system beep because the Enter key is invalid for a TSpinEdit. Normally, to avoid the beep, I would use the OnKeyPress even...

What does "free" do in Delphi?

I found the following code snippet here: with TClipper.Create do try AddPolygon(subject, ptSubject); AddPolygon(clip, ptClip); Execute(ctIntersection, solution); finally free; end Just curious, what does the free statement/function (between finally and end) do here? Google did not help. ...

handling CMYK jpeg files in Delphi 7

hi here! I am trying to access files that are stored as Jpeg files, is there an easy way to display these image files without performance loss ? ...

Make a control transparent

Is there any way to make a control transparent like button, edit, panel or etc...? I mean something like capacity or alpha blend that we have in form property. ...

Delphi, using vbscript for connecting ADO, new Be

Connecting to ADO is hard from installation in Delphi, so I decided to use VBscript, which I have never used before. VBscript has little support in Delphi, so how do I run a Windows script editor to get support and carry it over to Delphi? I do not understand the statements in VB script very well yet My Delphi TTable is connecting to ...

Does a begin-end block affect the performance of a conditional statement?

I am working with Delphi. Does it make any difference in performance if we write if condition in different ways? For example: if (condition) then someVar := someVal else someVar := someOtherVal; Or we can write: if (condition) then begin someVar := someVal; end else begin someVar := someOtherVal; end; I prefer the s...

Set Of String??!!

You are familiar with this block: Var mySet: Set Of Char; C: Char; begin mySet := ['a', 'b', 'c']; If C In mySet Then ShowMessage('Exists'); end; Is there any way to declare Set Of STRING? or is there similar code that i can use instead? The important part of this block is If C In mySet Then ShowMessage('Exists'); I wanna use...

get process handle by PID

I want to get the handle of a process by the process name. I have PID but when I use openProcess to get the handle always it will return 0 or 180, the function that I use to get the PID working properly Handle := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ,False,PID); What should I do? ...

how to get the information that did when thread is paused

Hi all how can i get actions ,i did when my thread is paused after resumed (Sorry for my bad english ) ok i will explain with code function mythreadf(p:Pointer):DWORD stdcall; var i:Integer; begin for i:=0 to 1000000 do begin if myevent.WaitFor(INFINITE)=wrsignaled then begin if Form1.RadioButton1.Chec...

BDE to ADO conversion in DELPHI 2010

I am working on converting BDE to ADO for my company. I have run into an expression I can not figure out how to convert to ADO Here is the BDE expression with all the ADO changes except for one....the part that is causing me issues is the with Tquery.Create(nil) do at the beginning. Any ideas? with Tquery.Create(nil) do beg...

Delphi TClientDataSet sorting (insert) issue

Hello, as far is I know sorting in a ClientDataSet works over the indexDefs. I can add an indexDef, set the field(s) I want to sort, and over the ixDescending property I can define the direction to sort. I have a ClientDataSet connected to a dataSource which is the source for a DBGrid. When I now insert a new record in the ClientDataSe...

Windows Search 4 Query - Delphi Example

The following web page describes querying Windows Search programmatically: http://msdn.microsoft.com/en-us/library/aa965362.aspx Does anyone have examples using Delphi/Pascal? Examples I have in mind are fairly simple: Search for certain file types. Search for specific text within files. Limit these above searches to a certain path....

RAD Studio 2009 Persistent Selection Issue: Bug or Feature?

Sometimes, when coding in RAD Studio 2009 (Delphi), suddently the behaviour of the code editor changes. After such an event, a selection is no longer cleared on character input. This often happens after a session of very intense coding (many characters per second!), so I might accidently hit a keyboard (shortcut) combination. Is this th...

Using MbUnit with Delphi Prism

I have created below simple testcase in Delphi Prism. When I run the testcase using Gallio Icarus, it returns a This test is not supported by any available test framework. I can think of only two reasons why this might be happening I am missing something (really) obvious. A setting, a missing initialization somewhere, ... It is not po...

How to connect delphi to .net objects

I have full understanding of com or connecting to *.dll's with LoadLibrary and GetProcess etc. How does one connect a class structure or a object in .net into delphi code so the compiler and the editer can connect/relate to .net? Like Delphi uses (cdecl) or (stdcall) to connect to methods that are structured in a different way. Do we...

Can I detect if a window is partly hidden?

Is it possible to detect if a window for a program outside mine is 1) completely visible, 2) partly hidden, or 3) completely hidden? I want to be able to tell my application not to do anything if a window (based on a retrieved handle) isn't visible. I don't care if the window has focus or not,what the z order is, or anything else, I'm ...