delphi-xe2

Delphi Xe2 VCL style and webbrowser

試著忘記壹切 提交于 2019-12-10 19:54:08
问题 Win7 x64, Delphi Xe2 update2 Prompt: The new project, compile as x32, are applied visual (vcl) styles in the project options, by default one is chosen On the form the button1 and WebBrowser1 In the button we write WebBrowser1.Navigate ('http://google.com'); We start, we press the button - in a browser we see a site google.com, all ок We compile as x64, it is started ок, by button pressing we receive an error "float division on zerro". Questions: At all so (error)? And as with it to struggle?

When can ((Pointer)(P)+1)^ work?

一曲冷凌霜 提交于 2019-12-10 19:48:38
问题 I'am working on delphiXE2 and i was working on PInteger. if i did this in my delphi code var P: PInteger; testInt: Integer; Scores: array[0..4] of Integer=(33,44,56,78,78); begin P := @Scores; testInt := (P+1)^; WriteLn(testInt); ReadLn; end; I got this error. [DCC Error] Project1.dpr(23): E2015 Operator not applicable to this operand type PS: testInt := (P+1)^; is the 23rd line However when I try this var PCh: PChar; testchar: char; str: array[0..4] of char=('a','b','c','d','e'); begin PCh :

copy content from list1 to list2 with specific criteria

℡╲_俬逩灬. 提交于 2019-12-10 19:09:24
问题 if i have two generics list so defined: type pMyList = record a, b: integer; c: string; end; TMyList = TList<pMyList>; var list1, list2: TMyList; there is some function copy content from a list (es: list1) to other list (es: list2) only if some field respect condition? For example, i want copy in list2 from list1 all record where a is same value for example 1. Result is that in list2 i have all record of list1 where a = 1, excluding all other record where a is a value different from 1.

How do I make third party component's DCU files, not to get generated in my application directory?

主宰稳场 提交于 2019-12-10 19:08:19
问题 In my Delphi, whenever I rebuild my application, all 3rd party component's DCU files are getting generated in my application's directory, where the executable resides. How do I change this behaviour? So that third party component's DCU files won't get generated in my application directory. 回答1: The .dcu files that the compiler generates are all created in the same directory. So there's no way to put generated .dcu files files into different directories and separate those from third party

Changing XML node attribute value gives “Namespace error”

不问归期 提交于 2019-12-10 18:50:26
问题 I use TXMLDocument to create XML documents. Sometimes I need to change attribute values. I get a "Namespace error" if I use the "ADOM XML v4" DOM vendor (Delphi XE2). Example code: procedure TForm1.Button1Click(Sender: TObject); var XML: TXMLDocument; XMLNode, XMLSubNode: IXMLNode; begin XML := TXMLDocument.Create(nil); //XML.DOMVendor := GetDOMVendor('MSXML'); // Works using MSXML XML.DOMVendor := GetDOMVendor('ADOM XML v4'); XML.Active := True; XMLNode := XML.AddChild('test'); XMLNode

Is possible to declare string type with restricted length that doesn't start from 0/1?

浪子不回头ぞ 提交于 2019-12-10 18:14:51
问题 In Delphi it is possible to declare subranges for integer values. For example: type myInt = 2..150 Which restricts values of myInt type to values from 2 to 150. But what if I want to restrict the length of a string? If I write: type myString = string [150] I declare mystring to be 150 bytes long and restrict the length to be from 0, 1, 2, etc. up to 150. But how do I restrict the length to between 2 and 150, for example? Of course, I can check the length of a string and raise an exception,

Delphi platform error on Hewlett Packard customized OEM Windows

陌路散爱 提交于 2019-12-10 17:49:42
问题 I keep getting the same error setting up my computer so it will run Delphi, I've already set up a user override on the PLATFORM environment variable, to convert it to win32 but it's still giving the same error; [Error Error] Invalid PLATFORM variable "HPD". PLATFORM must be one of the following: "Win32", "Win64", "Android", "iOSSimulator", "iOSDevice", or "OSX32". If PLATFORM is defined by your system's environment, it must be overridden in the RAD Studio IDE or passed explicitly on the

REST Datasnap override URI mapping

社会主义新天地 提交于 2019-12-10 17:46:11
问题 I wrote a small REST server with the REST datasnap in delphi XE2. There is a default mapping between HTTP methods (POST, PUT etc.) and the functions defined in delphi, this is done by a delphi component. This wiki entry describes the URI mapping but also notes that the default mapping can be override by the programmer. The mapping pattern can be overridden. The user can override the mapping for each type based on class name and method name parameters. But I didn't find any explanation how to

What operator do I overload when assigning an “Enhanced Record” to a normal “Data Type” variable?

 ̄綄美尐妖づ 提交于 2019-12-10 17:12:34
问题 I need to know, first and foremost, if what I'm trying to do is even possible. If it is possible, I then need to know how. It's far easier to demonstrate the problem rather than explain it so here goes: I have an "Enhanced Record" (the purpose - though not important to this question - is to produce a "Smart String" type, to replace the normal String type): TLKString = record Value: String; // Some methods here to operate on and build String values // Allows me to assign String values directly

Why are some character constants 1 byte wide, and others 2 bytes wide?

社会主义新天地 提交于 2019-12-10 16:12:19
问题 I thought I was beginning to understand Unicode, but this beats me: const c1 = #1; --> SizeOf() = 2 c2 = #33; --> SizeOf() = 2 c3 = #127; --> SizeOf() = 2 c4 = #128; --> SizeOf() = 1 c5 = #160; --> SizeOf() = 1 c6 = #161; --> SizeOf() = 1 c7 = #255; --> SizeOf() = 1 Can anyone explain? Delphi XE2, Default Windows-1252 codepage Thanks Jan 回答1: That is documented - see $HIGHCHARUNICODE directive 来源: https://stackoverflow.com/questions/12297755/why-are-some-character-constants-1-byte-wide-and