delphi-2007

How to make TWebBrowser Zoom when using ctrl+mousewheel like Internet Explorer does?

不羁岁月 提交于 2019-11-29 03:59:43
According to http://www.rendelmann.info/blog/CommentView,guid,356fbe68-3ed6-4781-90a4-57070a0141da.aspx and http://msdn.microsoft.com/en-us/library/aa770056(v=vs.85).aspx getting the hosted WebBrowser to zoom using the control key and the mouse wheel should just require calling IWebBrowser2.ExecWB(OLECMDID_OPTICAL_ZOOM, ...) with a pvaIn value of 100 , but after calling it, ctrl+mousewheel still doesn't zoom the content Code I'm using with Delphi 2007: const OLECMDID_OPTICAL_ZOOM = 63; var pvaIn, pvaOut: OleVariant; begin pvaIn := 100; pvaOut := NULL; WebBrowser1.ControlInterface.ExecWB

How do I determine if a unit has been compiled into a Delphi program?

雨燕双飞 提交于 2019-11-29 03:06:22
问题 I want to be able to determine if a particular unit has been compiled into a Delphi program, e.g. the unit SomeUnitName is part of some of my programs but not of others. I would like to have a function function IsSomeUnitNameInProgram: boolean; (which is of course not declared in SomeUnitName because in that case it would always be included) that at runtime returns true, if the unit has been compiled into the program, and false, if not. My thoughts so far have gone along the lines of using

Error While Linking Multiple C Object files in Delphi 2007

半世苍凉 提交于 2019-11-29 02:33:06
I am new to delphi. I was trying to add C Object files in my Delphi project and link them directly since Delphi Supports C Object Linking. I got it working when i link a single Object file. But when i try to link multiple object files, i am getting error 'Unsatisfied forward or external declaration'. I have tried this in Delphi 2007 as well as XE.So what am i doing wrong here? Working Code: function a_function():Integer;cdecl; implementation {$Link 'a.obj'} function a_function():Integer;cdecl;external; end. Error Code: function a_function():Integer;cdecl; function b_function();Integer;cdecl;

Displaying splash screen in Delphi when main thread is busy

痴心易碎 提交于 2019-11-29 01:43:12
I'd like to display splash screen while the application is loading. However some 3rd party components block main thread during initilization for several seconds, which causes all forms not to update. Is it possible to have splash screen with own thread so it would update also when main thread is busy? The application is win32 and Delphi version 2007. Edit: I'm trying to avoid "undrawn splash screen" effect, which happens if some other windows (from other applications) are on the top of splash screen, eg alt-tabbing to another application and back. You can run the splash screen in another

How to load an arbitrary image from a BLOB stream into a TImage?

人盡茶涼 提交于 2019-11-29 01:03:18
问题 If I understand it correctly, TImage.LoadFromFile determines the type of picture from the file extension. Is there any way to detect the image type automatically from a TBlobStream with a raw image in it? My current code: procedure LoadImageFromStream(AImage: TImage; ADataSet: TDataSet); var Stream: TStream; begin Stream := ADataSet.CreateBlobStream(Field, bmRead); try AImage.Picture.Graphic.LoadFromStream(Stream); finally Stream.Free; end; end 回答1: See this SO answer for file content

Detect disk activity in Delphi

江枫思渺然 提交于 2019-11-28 23:24:47
问题 I'm using Delphi 2007. I am copying files to a remote drive. When the copying ends, I shutdown/standby the machine. It can happen that some files don't get copied from buffer to disk, and the remote disk gets disconnected, so the backup is not completed. I need to detect disk activity on that disk to properly be able to take the close action on the machine. Is there a way to detect disk activity in this scenario? 回答1: (Please move the additional information from the comment to your question.)

Wiki: Current state of the art of Delphi 3rd party TCP/IP components libraries

眉间皱痕 提交于 2019-11-28 21:12:34
问题 I've not been doing bare metal TCP/IP for about 18 months, so I wonder what the current state of the art is. I'm looking for both positive and negative aspects, with development of both server and client software. I will be doing a project that needs a rock-solid TCP/IP layer, so for me that is an important aspect :) For this to become a community wiki, I'm looking for broader answers than just 'rock solid'. So for instance information about the feature-width is also appreciated. I'll be

Delphi 2007 x Windows 10 - Error on opening project

天大地大妈咪最大 提交于 2019-11-28 20:31:27
Just updated from Windows 8.1 to Windows 10 and now when I try to open any project on Delphi 2007, I get his error : Unable to load project xxxxx The imported project "c:\Windows\Microsft.NET...\Borland.Delphi.Targets" was not found. Confirm that the path declaration is correct, and that file exists on disk Any hints to fix it ? You need to copy some files in your old Windows folder to the new one. After that projects open again. The needed files are these : c:\windows\Microsoft.NET\Framework\v2.0.50727\Borland.Common.Targets c:\windows\Microsoft.NET\Framework\v2.0.50727\Borland.Cpp.Targets c:

Why 2 GB memory limit when running in 64 bit Windows?

瘦欲@ 提交于 2019-11-28 18:14:27
I'm a member in a team that develop a Delphi application. The memory requirements are huge. 500 MB is normal but in some cases it got out of memory exception. The memory allocated in that cases is typically between 1000 - 1700 MB. We of course want 64-bits compiler but that won't happen now (and if it happens we also must convert to unicode, but that is another story...). My question is why is there a 2 GB memory limit per process when running in a 64 bit environment. The pointer is 32 bit so I think 4 GB would be the right limit. I use Delphi 2007. EDIT: So if I set the IMAGE_FILE_LARGE

Delphi: count number of times a string occurs in another string

牧云@^-^@ 提交于 2019-11-28 13:16:33
I'm using Delphi 2007 and wonder if there is a simple way of counting the number of times a string occurs in another string. Any builtin function I can use? Examples: "How" occurs once in the string "How are you?" "do" occurs twice in the string "How do you do?" function Occurrences(const Substring, Text: string): integer; var offset: integer; begin result := 0; offset := PosEx(Substring, Text, 1); while offset <> 0 do begin inc(result); offset := PosEx(Substring, Text, offset + length(Substring)); end; end; One of the most clever ways I've ever seen to do this: { Returns a count of the number