delphi

Correct way to duplicate Delphi object

What are pros and cons of duplication an object instance with constructor or instance function? Example A: type TMyObject = class strict private FField: integer; public constructor Create(srcObj: TMyObject); overload; //alternatively: //constructor CreateFrom(srcObj: TMyObject); property Field: integer read ...

Delphi: writing to the private ancestor's field in descendant class

I need to fix a third-party component. This component's class has private variable which is actively used by its descendants: TThirdPartyComponentBase = class private FSomeVar: Integer; public ... end; TThirdPartyComponent = class (TThirdPartyComponentBase) protected procedure Foo; virtual; end; procedure TThirdPartyComponent.F...

vcl.net to delphi prism

i have some vcl.net apps(delphi 2006 , .net 1.1 ) and i like to port them to delphi.net 2007 . but i like to port it to delphi prism as it has mono support so i can port it on liux and support to latest .net framework(but i know mono supports full .net 1.1),as prism is completely new and vcl is deprecated how to upgrade my app to prism. ...

delphi ocr: what libabry should I use ?

Hello has someone already used a OCR activex/Dll/libary in Delphi ? I cannot find a library for OCR (Free or for an affordable price) regards ...

Delphi 2010 RTTI : How to interegate/explore an enumeration containing custom attribute

I've created an enumeration utilizing a TCustomAttribute descendant class (TEnumAttribute) to give each enumeration additional data (if successful, it will drive a custom component that can interrogate an enumeration and populate itself accordingly). type TShoppingCartType = ( [TEnumAttribute(0, 'All')] sctAll, [TEnumA...

Introducing interfaces into an existing class hierarchy in Delphi

Are there any side effects to changing a class hierarchy's ancestor from TObject to TInterfacedObject so that I can implement interfaces further down the inheritance chain? I've programmed in Delphi for several years but never encountered interfaces. I became accustomed to using them in other languages. Now that I'm involved in a Delphi...

How to kill a thread in delphi?

Dear All, In delphi, a method in TThread is terminate. It seems a subthread can not kill another thread by calling terminate or free. For example A(main form), B (a thread unit), C (another form). B is sending data to main form and C (by calling syncronize), we tried to terminate B within C while B is executing by calling B.terminate. ...

Delphi, IXMLDOMDocument2, Load fails due to invalid character

Using Delphi 2009 and IXMLDOMDocument2 I receive "An invalid character was found in text content" error when loading XML into IXMLDOMDocument2. The character is 1B (in Hex) and is present within a CDATA section. Microsoft's XML viewer (IE) loads the file just fine. The XML looks like... <data><child><![CDATA[-- ]]></child></data> NOTE...

Delphi7 CustomImageList problem

Hello all! I've run into the following problem: My Delphi7 program runs smoothly on most computers running WinXP/Vista/7 BUT on some older Windows XP installs (only a few) I'm getting the following problem: I have a system image list, and I'm adding my own icons to a copy of the system image list. Upon adding my icons I get an "Invali...

Programmatically adding, deleting and committing files into a subversion repository using Delphi

I would like to programmatically check if a file is versioned, and add, delete and commit files into a subversion repository using Delphi. Does anyone have sample code that might help me create the necessary functions and procedures? Thanks, Steve ...

How to call WinAPI function SetDllDirectory() in Delphi?

I would like to prevent loading of malicious DLLs that may be possible through access of the current working directory as described in http://msdn.microsoft.com/en-us/library/ff919712(VS.85).aspx The solution implemented in our C++ apps was to make a WinAPI call to SetDllDirectory(""), which would effectively remove the current working ...

How do I use a macro in the data portion of a resource script?

I have the following macros header file (system.h), #define rt_metadata 8000 #define dir_metadata "db\metadata" and resource file (system.db.metadata.rc) #include "system.h" SY_ALLOWDATE rt_metadata db\metadata\SY.AllowDate.xml How do I replace the db\metadata with dir_metadata in the resource file so that it will become some...

How do I implement Internet accessible system with Delphi?

Hello I am about to start working on a new system which will need to support multiple users and potentially allow the database to be accessed over the Internet. The system will be win32, not web based, the database will just be in an office and accessible anywhere. I am not sure if this is a dangerous approach security wise, am open t...

Help me translate the C++ code to Delphi

im having hardtime in memset and memcpy. can somebody trasnlate this for me, or suggestion on how this thing work? do{ memset(szSpeechBuf, 0x0, sizeof(char)*QSIZE); if((nBufIter+1)*QSIZE > nRawBufLen) { diff = nRawBufLen - (nBufIter)*QSIZE; if(diff < 0) { printf("DetectSpeech() error : timeout!!!"); ...

How to impliment a stringlist property in a custom delphi component?

I am creating my first custom Delphi component. Its basically a custom Tpanel with header and lines text displayed on it. I want to be able to add multiple lines text using a stringlist. When testing the component I cannot get the text lines to display on the panel when adding lines: NewLinesText.add('line1 text') It does however wo...

How should I prepare my 32-bit Delphi programs for an eventual 64-bit compiler?

Possible Duplicate: How to also prepare for 64-bits when migrating to Delphi 2010 and Unicode Since I believe that 64bit Delphi compiler will appear soon, I am curious if anybody knows what kind of programs that are now 32 bit will compile and work without any changes when using 64bit compiler. And if there is a general rule ...

while not terminated do block still can not exit a thread?

Dear Experts: Yesterday experts advised using "while not terminated do begin..." in thread execute function to check thread terminated property and exit the thread gracefully from within. We just tested code, but it still can not terminate thread. But this thread can be terminated practically and immediately by calling TerminateThread f...

Example of Delphi refactoring involving data aware controls and datamodules with direct access to db tables

I am trying to define the best way to refactor the project I am working on. Due to lack of good design almost all project is made up of: 1) forms containing business logic 2) huge datamodules (1 per form + some extra ones) 3) some units that contain common code (libraries) There is no OOP (except for some small areas), code reuse it...

How do I find the DataSnap server in DCOMCNFG?

On Windows 7 I tried to register a new DataSnap server using tregsrvr (using run as administrator), which runs and confirms that the registration succeeded. However I can not find the server in DCOMCNFG to check its settings. There are quite many DCOM entries, which have a GUID as their ID. I know one of them should be the DataSnap serv...

Freeze flash movie

I have a flash movie loaded into my browser.Is there any way that i can pause it and then resume it.I tryed SuspendThread() for all the browser threads but the movie won't freeze ...