delphi-7

Antivirus False positive in my executable

Hi, I just ran into an annoying problem. Suddenly Avira AntiVir startet to flag one executable from my software as being a virus. As the default action from almost any user is to click OK and Avira suggests to put the "virus" in quarantaine, most of my users are deleting this executable. Well, let´s not be arrogant and check if I...

Delphi, olevariants and arrays of strings

i have an ole Object created with (simple verion) obj := CreateOleObject('foo.bar'); obj.OnResult := DoOnResult; procedure TMyDM.DoOnResult(Res: olevariant); which all works, the res variable has a function String[] GetAns() which im calling like this var ans: array of string; begin ans := Res.GetAns; end; which again works.. ex...

Why does my program crash when I destroy a button in its own OnClick handler?

I tried a script from a web site I run http://www.delphi-central.com/runtime.aspx and succeed. private { Private declarations } procedure CustomButtonClick(Sender: TObject); procedure TForm1.AddNewButtonClick(Sender: TObject); var NewButton : TButton; begin NewButton := TButton.create(self); with NewButton do begin...

What are Delphi 7 and Delphi 2009 differences which deals with characters, strings, unicode and the like?

I had a class that only worked in Delphi 7 and after several attempts of converting it into Delphi 2009 we finally agreed to change our project into Delphi 7. The project more or less done, but I want to give the 2009 thing another shot. Aside from Sizeof(Char) equals 1 in Delphi 7 and 2 in Delphi 2009, what are other changes that I n...

work with WordApplication in delphi7

hi how can i disable "print" & "print preview" in Microsoft Word with WordApplication (delphi7)? ...

Delphi Application Error with Ole in a DLL

I have a Com Object, setup/create/working from a DataModule. creating/running/freeing the Datamodule from an Application works with out an issue. but putting the datamodule into a DLL works fine the first time, runing the com object etc.. but after a few calls with out restarting the application, this error appears. There is a fare ...

From TCheckListBox to TcxCheckListBox with an exception?

I use this code with TCheckListbox (lbServices) and it works fine. But with TcxCheckListBox from Devexpress it raise exception. procedure TMaintenanceForm.AfterConstruction; var i: Integer; ActionObj: TAction; begin inherited; for i := 0 to ServiceActionList.ActionCount-1 do begin ActionObj := ServiceActionList.Actions[i] ...

how to handle unicode data in delphi7

hi all in my application ,i am sending data from my application to database i am getting some odd characters in my database like this i am sending my data like this var w:widestring; u:utf8string; begin w:=data //data is function to get some info(string) u:=utf8encode(w); sendfn(u); end; i am using utf8_decode(my ge...

delphi TCollection count not increasing after Add

i have the types TNotifyReply = class(TCollectionItem) TNotifyReplylist = class(TOwnedCollection) NotifyReplylist := TNotifyReplylist.Create(self, TNotifyReply); After calling this function (Any number of times), Count it still zero function TNotifyReplylist.addItem: TNotifyReply; begin Result := inherited Add as TNotifyReply; ...

Voice Recording/Saving in Delphi

Is there a component or code that allows the following: Record a spoken word (or words) and save it/them to a file that can be played back. The file must be able to be played back on XP, Vista and Windows 7. The file can be either stand alone or saved to a datasource. [Using Delphi 7 for creating apps on XP and using Absolut...

Call dll function

Hi all, I have to acces a c written dll function, prototyped as: #include "extcode.h" #pragma pack(push) #pragma pack(1) #ifdef __cplusplus extern "C" { #endif void __stdcall PSA_Send_BO(char hostname[], char BO_NumberIn[], char BO_NumberOut[], int16_t *Status, char Error_text[], int32_t *Error_code, int32_t *length_BO_Numb...

Delphi 7: how to fill a Tlistview

hello, I've a Tlistview with 3 columns, I need from Tcollection object as this follow FListeDispoProduit := TListeDispoProduit.Create(TProduit); with (FListeDispoProduit) do begin with TProduit(Add) do begin Name := 'Produit 01'; CIP := 'A001'; StockQty := 3; end; But when I try to put this object in...

delphi 7 Items property

I come from Java background, where we have data structures with interfaces that if its collection it support certain behaviour, and a set has another. while programming in Delphi I thed to hit a brick wall when it comes in asking the reflection about the behaviour of items, its very strange. for example this code does not compile ...

Some help with TThread (Terminate, FreeOnTerminate and other adventures in the realm of threading)

Hello all, I'm trying the achieve the following (using Delphi7): After logging in to my program, the user gains control, but in the background a separate thread downloads a file from the Internet to check if the current license key is blacklisted. If it is, the user receives a prompt and the program terminates. So I've created a separa...

showing a xml file contents in a dbctrlgrid

hi anybody i have a win application project that should be done in delphi2010. in a form something like the image below,should be produced: www.up.iranblog.com/Files2/1e867ce0de784c469496.jpg first the image of product and under that tha name and the price. the information should be read from a xml file,but i dont know how to display the...

Copying Excel formulas with Delphi 7

Hi My team leader wants me to check if this is possible. Our app has a grid (we use TAdvStringGrid from tmssoftware) that displays some values. Our users then copy and paste to Excel. (2010) Now they want the values to update automatically when they play with Excel. In other words, I need to copy formulas similar to having a Excel shee...

Send Parameter To CMD

How can i send parameters to CMD? for example send a path and start it from that path? How can i execute CMD commands? Thanks ...

How Can I Add An Item To Folders Menu Of Right Click?

I need to add an item to folders right click menu when clicked send folder address to my app. how can i do it? it'll be a great help if you describe how to make popup menu for that item and how can i use images for items? something like WinRAR.... and what about file types? same ways? thank you. ...

Delphi IDE - Access violation in module 'rtl70.bpl'

Hi. I have and old AV that hunts me. It appears randomly (often but not always) when I switch between projects (close current project and double click a different DPR file to load it) or when I close Delphi (7). So it appears daily but not that offten and I can live with it. However, in the last few days it started to be really annoying...

Delphi Loadlibrary returns 0 (LastErrorcde=3221225616) What does this mean ?

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 DLLHandl...