delphi,delphi-7Related issues-Collection of common programming errors


  • RobertFrank
    delphi
    I need to capture all non-unit initialization exceptions in a Delphi 7 program so I can write the exception to a file, and perhaps show the user a message.Reading up on this, I thought that a global exception handler would be cumbersome and that all I would need is to capture all exceptions at the DPR level. However, I can’t get the code below to ever get to the ShowMessage in the dpr. Why does the Raise Exception below actually result in an exception displayed on the screen rather than bounci

  • Jordan Web
    android delphi clipboard zxing delphi-xe5
    I am building an application for Android using Delphi XE5 that makes use of the Zxing barcode application and it uses the clipboard to retrieve the result. All of the code (Most of it anyway) is from a tutorial that I have found on the web. When I followed the tutorial, it worked to a charm but when applying the SAME code within an application that I was already working on – it did not work. Whenever accessing the clipboard ( in the ‘OnTimer’ event), the application always hangs and stops workin

  • TLama
    delphi svn delphi-xe2 collabnet
    We’ve finally managed to do the internal housework that should theoretically allow us to start using SVN as our Version Control system.I’ve setup the latest version (3.3) of Collabnet Subversion Edge on a server and as far as I can tell it’s happily pointed where we want it to be. Getting the Active Directory authentication is different issue)I’ve created a new Repository (Timesheets) in the Admin Console with the default “Trunk” “Branch” and Tag” folder.So I go into Delphi, connect to the repos

  • Johan
    web-services delphi delphi-7
    I am trying to consume a TxServer web service, but I’m getting the error response Unmarshalling Error: unexpected element (uri: “http://txserver.sut.softekpr.com/1″, local:”transaction”). Expected elements are<{}transaction>`. I found out the XML that Delphi generates does not work with the service, but if I add xmlns=”” to the transaction tag, it works. Can anyone help me to add xmlns=”” to the transaction tag? I’d like to have: <transaction xmlns=””>. BTW I tried changing: InvRegistr

  • TLama
    delphi delphi-xe2 rtti delphi-xe3
    I have run into trouble trying to access the pointer to a record type in my record data using Delphi’s RTTI.Please check the sample code that i have been working on.// Dummy HeadertypDummyHeader = ^tysDummyHeader;tysDummyHeader = recordMessageCode : Integer;MessageLength : Integer;end;// Dummy record having header and trailertysDummyRecord = recordHeader : tysDummyHeader;BotAmount : Double;SoldAmount : Double;SoldQty : Int64;BotQty : Int64;Tailer : typDummyHeader; // pointer to Dummy Headerend;T

  • RM.
    delphi pointers interface av
    I am getting an unexpected Access Violation error in the following code:program Project65;{$APPTYPE CONSOLE}{$R *.res}usesSysUtils;typeITest = interfaceend;TTest = class(TInterfacedObject, ITest)end;varp: ^ITest;beginGetMem(p, SizeOf(ITest)); p^ := TTest.Create; // AV heretryfinallyp^ := nil;FreeMem(p);end; end.I know that interfaces should be used differently. However I am working on a legacy codebase which uses this approach. And I was very surprised to see that it is not sufficient to reserve

  • Altar
    delphi delphi-xe del
    I want to load a PNG with transparent background in a TImageList and use it in a TMainMenu (via TAction). However, in Delphi the background is just black. The is a way to fix that? Is PNG support only half implemented in Delphi? This guy says it worked for him but with a button instead of a main menu.My image is 8 bit per color plus 8 bit for transparency channel (I have tried also with 1 bit for transparency but still doesn’t work). The image looks just fine in any other program. I have Delphi

  • lkessler
    delphi multithreading
    I am using a FindFile routine to search through all files in a directory. The original code was freely available from Latium Software. It runs the FindFile is a separate Thread.It has always worked fine, and still continues to work fine. But since I upgraded from Delphi 4 to Delphi 2009, it now gives a Warning:W1055: Published caused RTTI ($M+) to be added to type ‘%s’ (Delphi)The error occurs at the “published” line of this thread declaration:TThread1 = class(TThread)privateOwnerForm: TFindFile

  • mjn
    delphi interface memory-leaks delphi-2009
    This Delphi code will show a memory leak for an instance of TMyImplementation:program LeakTest;usesClasses;typeMyInterface = interfaceend;TMyImplementation = class(TComponent, MyInterface)end;TMyContainer = class(TObject)privateFInt: MyInterface;publicproperty Impl: MyInterface read FInt write FInt;end;varC: TMyContainer; beginReportMemoryLeaksOnShutdown := True;C := TMyContainer.Create;C.Impl := TMyImplementation.Create(nil);C.Free; end.If TComponent is replaced by TInterfacedObject and the con

  • Pablo Venturino
    java eclipse web-services delphi
    I have a web server built in Delphi, and I’m trying to consume its web services on Java (I’m using Eclipse IDE) by creating a Web Service Client through the Eclipse wizard. The Web Services Explorer recognice the WSDL file, but when trying to create the client, the wizard says there’s an “unexpected attribute” and does not create any file.This is my wsdl file (the one that my Delphi Web Server publishes).<?xml version=”1.0″ encoding=”UTF-8″?> <definitions xmlns=”http://schemas.xmlsoap.o

  • Johan
    web-services delphi delphi-7
    I am trying to consume a TxServer web service, but I’m getting the error response Unmarshalling Error: unexpected element (uri: “http://txserver.sut.softekpr.com/1″, local:”transaction”). Expected elements are<{}transaction>`. I found out the XML that Delphi generates does not work with the service, but if I add xmlns=”” to the transaction tag, it works. Can anyone help me to add xmlns=”” to the transaction tag? I’d like to have: <transaction xmlns=””>. BTW I tried changing: InvRegistr

  • AthenaAtDelphi
    delphi delphi-7
    My Delphi-7 application displays : Screen.DesktopWidth Screen.DesktopHeight Screen.Monitors[0].Width Screen.Monitors[0].Height and , if there’s a second monitor selected , also : Screen.Monitors[1].Width Screen.Monitors[1].Height With the application running on my WinXP-Pro PC , I go to Control Panel / Display / Settings , and change the settings for the second monitor (either add or remove it) .I then click on a Refresh button to display the new values of the 4 (or 6) parameters , a

  • user426722
    delphi dll winapi delphi-7 dllimport
    Hey, I need to use a 3rd party dll in our main app. When I staticly link to the provided DLL it works ok and I can the DLLs exported functions. But we don’t want our main app dependend on this dll on startup so I tried to dynamicly load the DLL when I need it :DLLHandle := LoadLibrary(‘3rdparty.dll’); ret := GetLastError(); if DLLHandle = 0 then beginerr := SysErrorMessage(ret);Writeln(err); end //…but did doesnt work : The LoadLibrary function returns 0 and the LastErrorcode is 3221225616. Be

  • Danil Gholtsman
    delphi delphi-7 paint undo-redo
    I wrote such module to store there last changes of picture in my paint application ” in Delphiunit HistoryQueue;interfaceusesGraphics;type myHistory = classconstructor Create(Size:Integer);publicprocedure Push(Bmp:TBitmap);function Pop():TBitmap;procedure Clean();procedure Offset();function isEmpty():boolean;function isFull():boolean;function getLast():TBitmap;protectedhistoryQueueArray: array of TBitmap;historyIndex, hSize:Integer;end;implementationprocedure myHistory.Push(Bmp:TBitmap); var tbm

  • ThiefMaster
    delphi delphi-7
    I wrote a D7 application to test the behaviour of Application.OnActivate . This is the relevant part :procedure TMainForm.FormCreate (Sender: TObject); begin Memo1.Lines.Add (IntToStr (Memo1.Lines.Count + 1) + ‘ – MainForm.FormCreate – Begin’);Application.OnActivate := AppActivate;Memo1.Lines.Add (IntToStr (Memo1.Lines.Count + 1) + ‘ – MainForm.FormCreate – End’); end;procedure TMainForm.AppActivate (Sender: TObject); begin Memo1.Lines.Add (IntToStr (Memo1.Lines.Count + 1) + ‘ – MainForm.AppA

  • thelight
    performance delphi memory delphi-7 delphi-xe
    Is there a real performance gain when I turn {$IMPORTEDDATA} off ?The manual only says this: “The {$G-} directive disables creation of imported data references. Using {$G-} increases memory-access efficiency, but prevents a packaged unit where it occurs from referencing variables in other packages.”Update:Here is more info I could find:”The Debugging section has the new option Use imported data references (mapped to $G), which controls the creation of imported data references (increasing memory

  • David Heffernan
    delphi delphi-7 rtti
    I have a added components on a form object dynamically Edit1 := TEdit.Create(form3);I have got the object form3 of Tform class. Now what i want to do is I want to create a component template of form3 so that I can just drag and drop that component template on any of my other from and all the components present in it will be automatically available for me to use. Can any one help me with how to about doing component template?

  • Benjamin Weiss
    delphi delphi-7 virtualtreeview tvirtualstringtree object-pascal
    I have gridlines and toUseExplorerTheme enabled in virtualtreeview (DesignTime).I would like to remove the gridlines in runtime but it seems like I’m losing the toUseExplorerTheme property. Is this a bug or did I miss something? I tried to add it back to the set/options but no luck. I have also the XP Manifest.Here’s a little bit of code:VirtualStringTree1.TreeOptions.PaintOptions := VirtualStringTree1.TreeOptions.PaintOptions – [toShowVertGridlines]; // I lose the ExplorerTheme :/Thank you for

  • Warren
    delphi delphi-7 virtualtreeview
    Virtual treeview by Mike Lischke seems so popular on the web and as third party component. I just downloaded version 4.8.7 on my machine. I have Delphi 2010 and Delphi 7.0 in 2 partitions.Aftter clicking installer of virtual treeview, a log file prompts, saying it has been installed successfully. I check Delphi 2010, yes, it is on component palette showing 3 controls. But when I start Delphi 7.0, IDE prompts ‘Can not load VirtualtreesD7.bpl…’. I ignore it, and find that Virtual treeview design

  • menjaraz
    delphi drawing delphi-7
    I need to develop an application in Delphi where i have a TDrawGrid control and an image is displayed in the cells of the grid depending upon the kind of layout i select. i draw a line on the canvas of a the cell. the functionality i need to provide is drawing a line, drawing multiple lines on a imgae iside the cell, select any one line and move it, expand it, delete it.Is there any way to make the lines as controls at runtime so that they all respond to mouse events.

Web site is in building