delphi-2010

Is there a way to trace through only project source in Delphi?

匆匆过客 提交于 2019-12-03 06:05:22
I'm using Delphi 2010 and I'm wondering if there's a way to trace through code which is in the project without tracing through calls to included VCLs. For example - you put in a breakpoint and then use Shift + F7 to trace through line-by-line. Now you run into a call to some lengthy procedure in a VCL - in my case it's often a Measurement Studio or other component that draws the doodads for a bunch of I/O, OPC, or other bits. At any rate, what happens is that the debugger hops out of the active source file, opens the component source, and traces through that line by line. Often this is

Is TDirect2DCanvas slow or am I doing something wrong?

ぃ、小莉子 提交于 2019-12-03 05:45:48
问题 While looking for alternatives to replace GDI, I was trying to test Delphi's 2010 TDirect2DCanvas performance in Windows 7. I tested it by drawing a huge polyline using Direct2D and the result was absurdly slow, even with 500 times less data than the amount I've ran the same test using GDI (and I didn't even use a bitmap as backbuffer in GDI, I just drew to the form canvas directly). So I guess either: a) Direct2D is slower than GDI; b) TDirect2DCanvas is slow; c) I'm doing something wrong

Why do I get access violations when a control's class name is very, very long?

我的梦境 提交于 2019-12-03 05:35:58
I subclassed a control in order so I can add a few fields that I need, but now when I create it at runtime I get an Access Violation . Unfortunately this Access Violation doesn't happen at the place where I'm creating the control, and even those I'm building with all debug options enabled (including "Build with debug DCU's") the stack trace doesn't help me at all! In my attempt to reproduce the error I tried creating a console application, but apparently this error only shows up in a Forms application, and only if my control is actually shown on a form! Here are the steps to reproduce the

CharInSet doesn't work with non English letters?

吃可爱长大的小学妹 提交于 2019-12-03 05:13:48
I have updated an application from Delphi 2007 to Delphi 2010, everything went fine, except one statement that compiled fine but not working which is: If Edit1.Text[1] in ['S','س'] then ShowMessage('Found') else ShowMessage('Not Found') However, I knew that in will not, so I changed to CharInSet If CharinSet(Edit1.Text[1],['S','س']) then ShowMessage('Found') else ShowMessage('Not Found') but it never worked when the string is س , but always work with S , even I cast the edt1.Text 1 with AnsiChar it always not work Arabic letters. Am doing anything wrong, or it's not the way CharInSet works?,

Borderless TForm with drop shadow

风流意气都作罢 提交于 2019-12-03 05:08:49
问题 I have made a TForm derivative that acts like the drop down part of a combo, or a hint window, or a popup menu - a temporary thing. It has no caption - its BorderStyle is set to bsNone. The form is displayed non-modally using Show, having set its position. To make it stand out, it needs a drop shadow around its border. However, a consequence of setting its border to bsNone is that the drop shadow disappears. Various Google sources suggest variations of this: procedure TdlgEditServiceTask

use shell execute to run cmd as Admin

流过昼夜 提交于 2019-12-03 04:49:53
I need to run cmd on a button click as admin. It works. but I need to run it as an admin. How is this done? ShellExecute(Handle, 'open', 'c:\Windows\system32\cmd.exe', nil, nil, SW_SHOWNORMAL) Replace the open verb with the runas as shown below. Anyway, try to avoid path hardcoding: uses ShellAPI; procedure TForm1.Button1Click(Sender: TObject); begin ShellExecute(Handle, 'runas', 'cmd.exe', nil, nil, SW_SHOWNORMAL); end; You can also add to your button the shield icon by setting the ElevationRequired property to True. ShellExecute/Ex() with the "runas" verb is the only official way to start an

How hard is it to migrate a project from Delphi 7 to Delphi XE?

风流意气都作罢 提交于 2019-12-03 04:46:17
问题 Our company have a software that has been in development for over 10 years, so there are some really dated stuff in there. It's still quite functional and everything, but I see the new features on Delphi XE and it makes me want to switch. Problem is that the source code itself is over 300mb of .pas files (1gb total with components, etc). We're using custom components, old jvcl stuff and the latest devexpress. How hard can I expect things to be if I decide to migrate from Delphi 7 to Delphi XE

Delphi 2010 RTTI : Explore Enumerations

大憨熊 提交于 2019-12-03 02:13:23
Considering such an enumeration : type TTypeOfData = ( [XmlName('ABC')] todABC, [XmlName('DEF')] todDEF, [XmlName('GHI')] todGHI ); Where XmlName is a custom attribute used to define the serialization string for members of this enumeration. How can I explore the attributes attached to each member of this enumeration ? Attributes associated with elements in enumerations are not currently stored in Win32 RTTI data in the executable. RTTI is already responsible for a fair increase in the size of executables, so some lines had to be drawn somewhere. Attributes in Delphi Win32 are supported on

How can a 32-bit program read the “real” 64-bit version of the registry?

偶尔善良 提交于 2019-12-03 00:31:29
I'm trying to read HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run with OpenKeyReadOnly , and GetValueNames , but it's returning values from HKLM\SOFTWARE\ Wow6432Node \Microsoft\Windows\CurrentVersion\Run instead. How can I read the 64-bit values instead of from a redirect to the 32-bit key? The program was run as an administrative account. I also tried RegOpenKeyEx and RegEnumValue . I'm using Delphi 2010. you must use the KEY_WOW64_64KEY value when open the Registry with the TRegistry class. from MSDN : KEY_WOW64_64KEY Indicates that an application on 64-bit Windows should operate on the

Converting a stand-alone Delphi-made .tlb file to .ridl

霸气de小男生 提交于 2019-12-03 00:18:25
How does one convert a stand-alone .tlb file created in a pre-2009 version of Delphi to a .ridl file using Delphi 2010? .tlb files that are part of projects get automatically converted, but this particular file is not part of any project. try using the tlibimp.exe utility located in C:\Program Files\Embarcadero\RAD Studio\7.0\bin tlibimp –I thetlbfile.tlb 来源: https://stackoverflow.com/questions/2323729/converting-a-stand-alone-delphi-made-tlb-file-to-ridl