delphi-5

Assertion failure in DBAccess.pas

谁说胖子不能爱 提交于 2019-12-25 01:59:50
问题 I am interested in upgrading a suite of software from ODAC v5 to v8.2.8. One app in particular is causing problems. This application loads one of a set of secondary applications implemented as dlls. LibHandle := LoadLibrary(PChar(dllname)); if LibHandle <> 0 then begin @showForm := GetProcAddress(LibHandle,'ShowMainDllForm'); if (@showForm <> nil) then begin try ShowForm(Application.Handle, @FGlobalVars, 1); The launcher is fine - it has its own database connection, and I can step through the

Delphi - Changing TComboBox's OnChange

本小妞迷上赌 提交于 2019-12-24 07:48:15
问题 I want to change the TComboBox so that if I type text into it or manually set the Text property it will trigger the OnChange event. As it is now, doing ComboBox.Text := 'blah' doesn't trigger the OnChange event, nor does typing into the box. I tried creating a TComboBox descendant, which I assume is the right approach, but I'm not really sure how to change what triggers the events. 回答1: To the best of my knowledge, typing into a combo box will result in the OnChange event firing. But it is

Delphi - Either BOF or EOF is True, or the current record has been deleted

半腔热情 提交于 2019-12-24 00:33:02
问题 This error showed when I tried to select on an empty table in MS SQL Server 2005: "either BOF or EOF is True, or the current record has been deleted". I have used TADOConnection and TADODataSet in Delphi 5 to connect and retrieve data from the database. Conn := TADOConnection.Create(nil); DataSet := TADODataSet.Create(nil); Conn.ConnectionString := 'Provider=SQLOLEDB.1;Password=sa;' + 'Persist Security Info=True;' + 'User ID=user;Initial Catalog=mydb;' + 'Data Source=MYPC\SQLEXPRESS;' + 'Use

Is there a Delphi 5 component that can handle .png files

巧了我就是萌 提交于 2019-12-23 18:13:53
问题 Is there a Delphi 5 component that can handle .png files? 回答1: You can use TPNGImage. Download from here Also you can check Delphi PNG libraries here 回答2: TMS and DevExpress both can handle png files. 回答3: I believe the GDI+ delphi interface from progdigy can be used with D5. Its not a simple plug-in to enable PNG support, but on the other hand, it can load a wide variety of file types. So its another option if all else fails. 回答4: I have been using the marvelous Hi Image components for year:

Delphi: How to respond to WM_SettingChange/WM_WinIniChange?

我是研究僧i 提交于 2019-12-23 16:17:14
问题 i need to know when my application recieves a WM_SETTINGCHANGE message (formerly known as WM_WININICHANGE). Problem is that the message pump in TApplication sends it down a black hole (default handler) before i can get a chance to see it: procedure TApplication.WndProc(var Message: TMessage); ... begin Message.Result := 0; for I := 0 to FWindowHooks.Count - 1 do if TWindowHook(FWindowHooks[I]^)(Message) then Exit; CheckIniChange(Message); with Message do case Msg of WM_SETTINGCHANGE: begin

Delphi: Should a thread ever be created “not suspended”?

橙三吉。 提交于 2019-12-22 04:28:22
问题 I've been trying to track down a memory leak in Jedi VCL's JvHidControllerClass.pas , which i came across this change in the source history: Older revision: constructor TJvHidDeviceReadThread.CtlCreate(const Dev: TJvHidDevice); begin inherited Create(True); Device := Dev; NumBytesRead := 0; SetLength(Report, Dev.Caps.InputReportByteLength); end; Current revision: constructor TJvHidDeviceReadThread.CtlCreate(const Dev: TJvHidDevice); begin inherited Create(False); Device := Dev; NumBytesRead :

delphi hibernate push and detect

我只是一个虾纸丫 提交于 2019-12-21 22:44:55
问题 using Delphi5. I have an app that starts with windows boot and I would like to Close and Start it on the Hibernate/Wake command. I need to be able to detect if it is coming back from an Hibernate so I can run my app each time. I have a setting in the Registry where the User can choose to run only once per day. I am guessing there is a windows Message or Registry entry that tells the machine that it is going into and coming back from an Hibernate. Thoughts and suggestions? Thanks for looking

Delphi: How to remove subclasses in reverse order?

血红的双手。 提交于 2019-12-21 17:56:28
问题 Mike Lischke's TThemeServices subclasses Application.Handle , so that it can receive broadcast notifications from Windows (i.e. WM_THEMECHANGED ) when theming changes. It subclasses the Application object's window: FWindowHandle := Application.Handle; if FWindowHandle <> 0 then begin // If a window handle is given then subclass the window to get notified about theme changes. {$ifdef COMPILER_6_UP} FObjectInstance := Classes.MakeObjectInstance(WindowProc); {$else} FObjectInstance :=

How to call EnumSystemLocales in Delphi?

放肆的年华 提交于 2019-12-21 09:19:23
问题 i am trying to call EnumSystemLocales in Delphi. For example: { Called for each supported locale. } function LocalesCallback(Name: PChar): BOOL; stdcall; begin OutputDebugString(Name); Result := Bool(1); //True end; procedure TForm1.Button1Click(Sender: TObject); begin EnumSystemLocales(@LocalesCallback, LCID_SUPPORTED); end; The problem is that the callback is only being called once. Note: EnumSystemLocales is returning true, indicating success. The remarks of EnumSystemLocales says that my

Delphi: How do i use $OVERFLOWCHECKS OFF to disable overflow checks?

烈酒焚心 提交于 2019-12-21 05:06:09
问题 i have bit of code that causes an underflow: var t1, t2, delta: DWORD: begin t1 := 0xffffff00; t2 := 0x00000037; delta := (t2 - t1); The subtraction itself does generate an overflow (underflow), but i don't want Delphi to throw an EIntOverflow exception. So i try disabling the generation of overflow checking code by disabling overflow checking: var t1, t2, delta: DWORD: begin t1 := 0xffffff00; t2 := 0x00000037; {$OVERFLOWCHECKS OFF} delta := (t2 - t1); {$OVERFLOWCHECKS ON} Yet even with the