delphi-xe2

How to open port in Win7 Firewall using Delphi

删除回忆录丶 提交于 2019-12-21 13:17:09
问题 i want to open a port in Windows 7 Firewall for port forwarding via Delphi but as been said in other threads windows 7 has Multiple Profiles in Firewall (Public, Private) and the next code only adds the exception to one of them. Code: procedure addPortToFirewall(EntryName:string;PortNumber:Cardinal); Const NET_FW_PROFILE_DOMAIN = 0; NET_FW_PROFILE_STANDARD = 1; NET_FW_IP_VERSION_ANY = 2; NET_FW_IP_PROTOCOL_UDP = 17; NET_FW_IP_PROTOCOL_TCP = 6; NET_FW_SCOPE_ALL = 0; NET_FW_SCOPE_LOCAL_SUBNET =

How can I compile 32- and 64-bit DCUs into separate directories?

萝らか妹 提交于 2019-12-21 10:48:22
问题 I'm trying to maintain one repository, most everything in my code base is source, but we've got the QuickPDF library which is a bunch of precompiled DCU's. I'd like to put them in version control somehow but I don't want to have yet another option set for win64 that I'm going to forget about before I convert the rest of my trillion LOC codebase to win64. What I was thinking was just having (and quickPDF is just an example, there's nothing special about this library other than its unfortunate

Adding custom header to TIdHttp request, header value has commas

a 夏天 提交于 2019-12-21 09:28:07
问题 I'm using Delphi XE2 and Indy 10.5.8.0. I have an instance of TIdHttp and I need to add a custom header to the request. The header value has commas in it so it's getting parsed automatically into multiple headers. I don't want it to do that. I need the header value for my custom header to still be one string and not split based on a comma delimiter. I have tried setting IdHttp1.Request.CustomHeaders.Delimiter := ';' with no success. Is there a way to make sure the header doesn't get split up?

Casting object to interface type with no TInterfacedObject as base class

爷,独闯天下 提交于 2019-12-21 09:07:17
问题 I need a class implementing interface with no reference counting. I did the following: IMyInterface = interface(IInterface) ['{B84904DF-9E8A-46E0-98E4-498BF03C2819}'] procedure InterfaceMethod; end; TMyClass = class(TObject, IMyInterface) protected function _AddRef: Integer;stdcall; function _Release: Integer;stdcall; function QueryInterface(const IID: TGUID; out Obj): HResult;stdcall; public procedure InterfaceMethod; end; procedure TMyClass.InterfaceMethod; begin ShowMessage('The Method');

Details of what features FireMonkey (FMX) inside the NEW Delphi Rad Studio XE2 contains?

一个人想着一个人 提交于 2019-12-21 07:37:27
问题 I've heard that Delphi's NEW Rad Studio XE2 has something called FireMonkey that will allow the same code to build Windows 32, Windows 64 and MacOS applications. If this is true, this is huge. Where can I get the technical documentation that talks about FireMonkey? EDIT: I'm interested in the MacOS. Several people have asked me when I'm releasing a Mac version of my software and I keep telling them I'm not. I asked this question back in March (4 months ago) and no one said anything about

Complete Class at Cursor Not Working

纵饮孤独 提交于 2019-12-21 07:09:00
问题 I've been widely making use of the Complete Class at Cursor function in Delphi, in 2010 and in XE2. Recently, after installing Update 4 for XE2, the Complete Class at Cursor stopped working. After doing some research, I found that uninstalling "AQTime" would fix the issue. So I did that (had to re-install Delphi just to remove it) and sure enough it started working again. Except, today, it suddenly stopped again. AQTime is not installed, and I haven't done anything in the IDE at all which (as

Why is 64 bit Delphi app calculating different results than 32 bit build?

落爺英雄遲暮 提交于 2019-12-21 07:05:16
问题 We recently started the process of creating 64 bit builds of our applications. During comparison testing we found that the 64 bit build is calculating differently. I have a code sample that demonstrates the difference between the two builds. var currPercent, currGross, currCalcValue : Currency; begin currGross := 1182.42; currPercent := 1.45; currCalcValue := (currGross * (currPercent * StrToCurr('.01'))); ShowMessage(CurrToStr(currCalcValue)); end; If you step through this in the 32 bit

How to convert rows of a database query to a XML file?

时光怂恿深爱的人放手 提交于 2019-12-21 05:41:16
问题 I am developing a Delphi application that needs to pick up the rows from a period of work and convert them to a single XML file in order to upload to a 3rd party web-service. Is there any component or library available to do that? If not, what is the best approach of code to build that DB2XML conversor? I noticed that most XML questions are about how to convert it to another type of data. Note: the database will be MySQL or Firebird. 回答1: You can use the TDataSetProvider component to fill a

Delphi open modal form from DLL

泪湿孤枕 提交于 2019-12-21 05:22:12
问题 I need to add some plugin functionality to application, and ability to dynamically load and open plugins. In my application (in main form), I have following code: procedure TfrmMain.PluginClick(Sender: TObject); Var DllFileName : String; DllHandle : THandle; VitoRunPlugin : procedure (AppHandle, FormHandle : HWND); begin DllFileName := (Sender AS TComponent).Name + '.dll'; DllHandle := LoadLibrary(PWideChar (DllFileName)); if DllHandle <> 0 then Begin @VitoRunPlugin := GetProcAddress

MessageLoop within Thread

余生长醉 提交于 2019-12-20 20:03:29
问题 How can I implement a message loop within a thread using OTL? Application.ProcessMessages; is what i used so far but it isn't very safe to use it. Thanks 回答1: This is how I pull messages off a thread's queue: while GetMessage(Msg, 0, 0, 0) and not Terminated do begin Try TranslateMessage(Msg); DispatchMessage(Msg); Except Application.HandleException(Self); End; end; Using Application.ProcessMessages will pull messages of the queue of the calling thread. But it's not appropriate to use in a