delphi-6

Why I don't need call CoInitialize in a thread created inside a COM Thread?

╄→尐↘猪︶ㄣ 提交于 2019-12-12 13:27:05
问题 In order to learn multithreading, I've created a thread inside a COM Thread ( TRemoteDataModule ). This is my Component Factory: TComponentFactory.Create(ComServer, TServerConn2, Class_ServerConn2, ciMultiInstance, tmApartment); Inside the Thread, I didn't needed to Call CoInitialize to use TADOQuery.Create , .Open ... .Exec I read that I need to initialize the COM library on a thread before you call any of the library functions except CoGetMalloc, to get a pointer to the standard allocator,

Save and restore event handlers

自闭症网瘾萝莉.ら 提交于 2019-12-12 11:32:53
问题 My class contains dataset (TDataSet). Users of my class can assign event handlers for this dataset: ds.FieldByName('ID').OnChange := @ID_OnChange; Then I have to reopen dataset: ds.Close; ds.Open; After this all event handlers are gone: if Assigned(ds.FieldByName('ID').OnChange) //returns false So, I need to save handlers and restore them after reopen. I use TStringList for it: var EventHandlers: TStringList; ... //I do this for every event of every field if Assigned(ds.FieldByName('ID')

How can I get the name of the database a DBExpress TSqlConnection is actually connected to?

徘徊边缘 提交于 2019-12-11 18:38:00
问题 I'm testing a quite old Delphi 6 application and would like to display the database name the TSqlConnection is actually connected to, so I can see quickly if I'm connected to the test or production database. In sqlconnections.ini, the app has a connection named 'Vienna' to a Firebird database defined like this: Database=192.168.1.15:ProductionDB (it's an alias) and I've replaced that for testing purposes with Database=192.168.1.15:TestDB. But I've seen that just accessing the TSqlConnection's

Delphi 6 support for toolbar and menu icons with alpha channel transparency

纵饮孤独 提交于 2019-12-11 11:49:19
问题 We have a legacy application developed in Delphi 6 (yes, I know this is an ancient IDE now), which we are trying to update to look more modern. We have added in a Manifest and now have it using version 6 Windows controls and taking on the Windows Visual Theme (all good). However, when trying to replace the old 4 bit toolbar and menu icons with True Colour with Alpha Channel (32 bit) transparency we have hit a problem. It appears that Delphi 6 only supports transparency based on the bottom

Module %s has open descendants or linked modules. can not reload

穿精又带淫゛_ 提交于 2019-12-11 07:37:14
问题 I am adding a language to my project for Arabic. When i update the resource Dlls, i am getting the following error in one of the base form from which all other forms were inherited. I tried setting the OldCreateOrder to false for all the forms, but still the error persists. I have tried searching on the net for this kind of error, but no luck.... Does any one know about this error?? BTW i am using Delphi 6 Enterprise version. Thanks in advance. 回答1: Finally i have solved the problem. I couldn

how to make a transparent form inside Panel?

不想你离开。 提交于 2019-12-11 05:08:42
问题 I need to create at runtime a partial transparent Form inside a Panel. How might I be able to achieve this? 回答1: If your question is only related to the way to put the form in a TPanel then it's quite easy. You only need to call Windows.SetParent() with the handle of the newly created form. MyNewForm := TMyNewForm.Create(Self); Windows.SetParent(MyNewForm.Handle,MyPanel.Handle); This would also work by using the TForm Property ParentWindow . But it's (quite) possible that the transparency is

Why does TEdit only shows text with length equals or less than 37440 characters?

别等时光非礼了梦想. 提交于 2019-12-10 13:51:48
问题 If you do this: Edit1.Text := StringOfChar('X', 37440); It will show the text, however if you do this: Edit1.Text := StringOfChar('X', 37441); The text will not appear. Does anybody knows why? If this is an error, there is another way of adjusting rather than replacing all existing components to TMemo? Why 37440 Anyway? 回答1: On the face of it you ought to be able to control this using the EM_LIMITTEXT message: The EM_LIMITTEXT message limits only the text the user can enter. It does not

How to force Delphi compiler to display all hints and warnings

萝らか妹 提交于 2019-12-10 02:24:54
问题 Is there a way to force the Delphi compiler to display all hints and warnings all the time? Here is the behavior that I am currently seeing in Delphi 6: Check out fresh copy of my application from source control Open project in Delphi and Compile All hints and warnings for the project are displayed Make a change in one unit Compile Only the hints and warnings for the changed unit are displayed So, I thought maybe I can trick Delphi by deleting all of the dcu files to force it to recompile

Indy 10 - IdSMTP.Connect raising “Could not load SSL library.”

别说谁变了你拦得住时间么 提交于 2019-12-09 08:58:33
问题 Here is my configuration: IdSMTP1.Host := 'smtp.gmail.com'; IdSMTP1.Port := 587; IdSMTP1.UseTLS := utUseExplicitTLS; IdSMTP1.IOHandler := IdSSLIOHandlerSocketOpenSSL1; IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method := sslvTLSv1; I've downloaded the OpenSSL from here, both libeay32.dll and ssleay32.dll are in the same folder of my application. The Indy version is: 10.0.52 The following command is working on my machine: telnet smtp.gmail.com 587 How to properly connect in a TLS enable SMTP

How to encode base64 in Delphi 6? [duplicate]

我怕爱的太早我们不能终老 提交于 2019-12-06 12:11:02
This question already has answers here : Binary to Base64 (Delphi) (2 answers) Closed 6 years ago . I need to encode a pdf document to base64 in Delphi6. Can anyone help me? You can use the EncdDecd unit that is supplied with Delphi. The function you need is EncodeStream . You simply need to create two streams, one for input and one for output. If you are working with files then you should create TFileStream instances. Once you have your two file streams created, all you need is: EncodeStream(InputStream, OutputStream); unit base64; interface uses Classes; function base64encode(f:TStream)