delphi-5

TWebBrowser crashes with embedded Youtube clips

走远了吗. 提交于 2019-11-28 11:30:51
Here is my code: type TForm1 = class(TForm) WebBrowser1: TWebBrowser; Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); end; implementation uses ActiveX; procedure TForm1.Button1Click(Sender: TObject); // method 1 var HtmlFile: string; begin HtmlFile := ExtractFilePath(Application.ExeName) + 'test.html'; WebBrowser1.Navigate(HtmlFile); end; procedure LoadHtml(wb: TWebBrowser; HTMLStr: string); var aStream: TMemoryStream; begin wb.Navigate('about:blank'); // reset the webbrowser while wb.ReadyState < READYSTATE_INTERACTIVE do /

How to minimize a window to the taskbar? (i.e. not iconify)

蓝咒 提交于 2019-11-28 07:48:25
i have a window that i want to minimize (to the taskbar), so i call ShowWindow : ShowWindow(Handle, SW_MINIMIZE); Except that rather than minimizing itself (to the taskbar), the window is iconified : The window is unparented: How do i minimize a window to the taskbar? Update: Following some advice from 2002 , i try setting the WS_EX_APPWINDOW window style and/or ensuring the window has no owner: Unfortunately, that changes the behavior of my (Delphi) application because there is now two taskbar icons for my application, rather than one: This, of course, is an artifact of Delphi (5); and

Tabs and colored lines in Listbox

六眼飞鱼酱① 提交于 2019-11-28 05:50:20
问题 I am using a Tabbed Listbox component that was written by Fredric Rylander back in 1999 and it has been serving me well since then. :) Can't seem to find him anymore. I now have an application that needs both Tabbed Data and alternating colored lines in the Listbox. I can include the Component here for perusal if desired. I tried coloring the lines from here http://delphi.about.com/cs/adptips2002/a/bltip0602_4.htm But then it eats the Tabs, but I do get the alternating colored lines. Can

How to not have a MainForm in Delphi?

狂风中的少年 提交于 2019-11-28 04:47:46
i've been trying to get some modeless forms in my application to appear on the taskbar - taking advantage of the new useful taskbar in Windows 7. There's are many issues with the VCL that need to be undone before a form can exist on the taskbar. But the final issue is that minimizing the form that the VCL has designated the main form causes all windows in the application to vanish. Ten years ago, Peter Below (TeamB) documented these problems , and attempts to work around them. But there are some issues that cannot be solved. The issues run so deep within the VCL itself, that it's effectively

Changing component class at run-time on demand

让人想犯罪 __ 提交于 2019-11-27 19:29:27
My Question is similar to the idea here: Replacing a component class in delphi . But I need to change a specific component(s) class on demand. Here is some pseudo demo code: unit Unit1; TForm1 = class(TForm) ImageList1: TImageList; ImageList2: TImageList; private ImageList3: TImageList; end; procedure TForm1.FormCreate(Sender: TObject); begin ImageList3 := TImageList.Create(Self); // all instances of TImageList run as usual end; procedure TForm1.Button1Click(Sender: TObject); begin Unit2.MakeSuperImageList(ImageList2); Unit2.MakeSuperImageList(ImageList3); // from now on ONLY ImageList2 and

Is there a way to disable font anti aliasing when using TextRect (aka ExtTextOut in GDI32) in Delphi?

霸气de小男生 提交于 2019-11-27 18:58:14
问题 I'm using a custom gauge, based on the example that came with Delphi (5 Enterprise). For those that don't know, it's like a smooth progress bar, but displays the percentage or value in the centre (vertically and horizontally) of the component. To make sure the text is readable both when the gauge is filled and when it's empty, the text is displayed using inverted colours. When font anti-aliasing is used, these inverted colours cause the edge of the font to appear in really crazy colours,

Delphi: How to add a different constructor to a descendant?

China☆狼群 提交于 2019-11-27 18:12:56
问题 Update: The example i originally had was kind of complex. Here's a simple 8 line example that explains everything in one code block. The following does not compile gives a warning: TComputer = class(TObject) public constructor Create(Cup: Integer); virtual; end; TCellPhone = class(TComputer) public constructor Create(Cup: Integer; Teapot: string); virtual; end; Note: This question is part 3 in my ongoing series of questions about the subtlties of constructors in Delphi Original question How

What can my 32-bit app be doing that consumes gigabytes of physical RAM?

感情迁移 提交于 2019-11-27 14:42:07
问题 A co-worker mentioned to me a few months ago that one of our internal Delphi applications seems to be taking up 8 GB of RAM. I told him: That's not possible A 32-bit application only has a 32-bit virtual address space. Even if there was a memory leak, the most memory it could consume is 2 GB. After that allocations would fail (as there would be no empty space in the virtual address space). And in the case of a memory leak, the virtual pages will be swapped out to the pagefile, freeing up

Delphi: Understanding constructors

一笑奈何 提交于 2019-11-27 06:37:51
i'm looking to understand virtual override overload reintroduce when applied to object constructors. Every time i randomly add keywords until the compiler shuts up - and (after 12 years of developing with Delphi) i'd rather know what i'm doing, rather than trying things randomly. Given a hypothetical set of objects: TComputer = class(TObject) public constructor Create(Cup: Integer); virtual; end; TCellPhone = class(TComputer) public constructor Create(Cup: Integer; Teapot: string); virtual; end; TiPhone = class(TCellPhone) public constructor Create(Cup: Integer); override; constructor Create

ADO cannot access SQL Server XML type column using native client (SQLNCLI)

只谈情不闲聊 提交于 2019-11-27 06:14:31
问题 i am using ADO, and one of the "native" drivers (e.g. SQLNCLI , SQLNCLI10 , SQLNCLI11 ) to connect to SQL Server (rather than the legacy SQLOLEDB driver). ADO does not understand the XML SQL Server data type that the native drivers expose: field: ADOField; field := recordset.Fields.Items["SomeXmlColumn"]; Attempting to access field.Value throws an EOleException : Source: Microsoft Cursor Engine ErrorCode: 0x80040E21 (E_ITF_0E21) Message: Multiple-step operation generated errors. Check each