delphi-6

Convert hex str to decimal value in delphi

泄露秘密 提交于 2019-12-01 15:00:49
问题 I've got a problem to convert a string representation of an hex value in integer value with Delphi. for example: $FC75B6A9D025CB16 give me 802829546 when i use the function: Abs(StrToInt64('$FC75B6A9D025CB16')) but if i use the calc program from Windows, the result is: 18191647110290852630 So my question is: who's right? me, or the calc? Does anybody already have this kind of problem? 回答1: In fact 802829546 is clearly wrong here. Calc returns a 64bit unsigned value ( 18191647110290852630d ).

How do I get screen coordinates of the DBGrid cell

拥有回忆 提交于 2019-12-01 06:08:21
I want to show popup button or fancy message (with coloured background, etc) just under right-bottom corner of particular cell of the current row. For now I only figured how to get grid coordinates: x = DBGrid.DataSource.DataSet.RecNo y = DBGrid.Columns[index] There is also TCustomGrid.CellRect, which would do what I want, but it's protected and I don't want to inherit and create another component class. One crazy workaround I can think of is to save TRect-s in onDrawColumnCell event to some array. So, what do you think ? EDIT How do I get screen coordinates of, say, second cell in the current

Handling of Unicode Characters using Delphi 6

倾然丶 夕夏残阳落幕 提交于 2019-11-30 17:06:59
问题 I have a polling application developed in Delphi 6. It reads a file, parse the file according to specification, performs validation and uploads into database ( SQL Server 2008 Express Edition ) We had to provide support for Operating Systems having Double Byte Character Sets (DBCS) e.g. Japanese OS. So, we changed the database fields in SQL Server from varchar to nvarchar. Polling works fine in Operating Systems with DBCS. It also works successfully for non-DBCS Operating systems, if the

What is the difference between compiling and building in Delphi?

 ̄綄美尐妖づ 提交于 2019-11-30 13:11:45
问题 With Delphi-6 there are two options: Build and Compile. I know when I run a program it compiles only the files which have changed and uses the DCUs for those which haven't. When I click build apparently it rebuilds the DCUs. What I have been wondering is, when I make a program for release (changing build settings, conditional variables, etc.) can I just compile, or do I have to do a full build? What happens if I don't do a full build, is there any consiquence? 回答1: When build, when compile?

What is the difference between compiling and building in Delphi?

非 Y 不嫁゛ 提交于 2019-11-30 08:14:36
With Delphi-6 there are two options: Build and Compile. I know when I run a program it compiles only the files which have changed and uses the DCUs for those which haven't. When I click build apparently it rebuilds the DCUs. What I have been wondering is, when I make a program for release (changing build settings, conditional variables, etc.) can I just compile, or do I have to do a full build? What happens if I don't do a full build, is there any consiquence? Marco van de Voort When build, when compile? The compiler only automatically recompiles units when the datetime stamp of the .pas

Convert OleVariant to Object in Delphi

坚强是说给别人听的谎言 提交于 2019-11-29 17:28:59
I'm working on this project where we don't have the source code for large chunks of the project, but we have the .DLL files with some information. There is a bug in the DLL files. I am able to create a subclass of the class with the bug in it and I would like to downcast the object which already exists at a point I have access to it. The issue is that at any point I have access to the object, it's cast as a Variant. I've tried the following (edited to remove context): tempSubclass := Subclass(ParentClass(Integer(oleVariantCast))); but I get the following error: Could not convert variant of

How reliable is the Random function in Delphi

喜夏-厌秋 提交于 2019-11-29 07:44:36
问题 I am writing a program which write statistical tests in Delphi (must be Delphi) and I've heard that the Random functionality is somewhat odd. You have to call randomize to randomize the seed of the random function when the program starts. I'm wondering if the random function (after calling randomize) is random enough for statistical tests or a Mersenne twister is needed? Does anyone have any insight into random's actual implementation which can tell me how important this is? 回答1: Whether

How to get elements by name in Delphi Chromium Embedded?

旧巷老猫 提交于 2019-11-28 13:47:24
To get a particular DOM node embedded in the current web document from a TChromium instance, using its ID, you use ICefDomDocument.getElementById(). But how do you find elements by the NAME attribute? Javascript has the document.getElementsByName() method and TWebBrowser (that wraps IE) has a similar call, but I can't figure out how to do this with TChromium. I need to find some DOM elements that have NAME attributes but no ID attributes. I searched the ceflib unit and did not see anything that would do it. Side question. If anyone has a link to a TChromium "recipes" style site or document I

Convert OleVariant to Object in Delphi

蹲街弑〆低调 提交于 2019-11-28 13:32:34
问题 I'm working on this project where we don't have the source code for large chunks of the project, but we have the .DLL files with some information. There is a bug in the DLL files. I am able to create a subclass of the class with the bug in it and I would like to downcast the object which already exists at a point I have access to it. The issue is that at any point I have access to the object, it's cast as a Variant. I've tried the following (edited to remove context): tempSubclass := Subclass

Delphi - How to prevent Forms/MsgBoxes to move under prior form?

落爺英雄遲暮 提交于 2019-11-27 10:10:32
问题 Many times after the Windows 98 era we have experienced that some dialogs lose their Z-Order and move back to the prior form. For example: Dialog1.ShowModal; Dialog1.OnClickButton() : ShowMessage('anything'); When MessageBox appears, it sometimes doesn't have focus and is moved under Dialog1. The users are confused about it, they say: My application froze!!! But if they use Alt+Tab to move to another app and back, the focus returns to the MessageBox and it will be the foreground window. We