[DUG] CPU memory usage

2008-08-18 Thread Vikas...
Hi, I am creating a window service using delphi 5. I need some help is getting the CPU memory usage of the machine so that my service runs when CPU usage is low. Is there any way to find out the CPU usage. Is there soem registry key or soemthing. I am not sure actually. I will really appreciate

Re: [DUG] CPU memory usage

2008-08-18 Thread Phil Scadden
I am creating a window service using delphi 5. I need some help is getting the CPU memory usage of the machine so that my service runs when CPU usage is low. Is there any way to find out the CPU usage. Is there soem registry key or soemthing. I am not sure actually. Strikes me that

Re: [DUG] CPU memory usage

2008-08-18 Thread Robert martin
Hi If you just want to reduce the priority why not run the services processing in a thread created with a low priority, then you don't have to worry about Windows security etc. However I don't know if this would achieve what Vikas wants. Rob Phil Scadden wrote: I am creating a window

Re: [DUG] CPU memory usage

2008-08-18 Thread Karl Reynolds
Use GlobalMemoryStatusEx (http://msdn.microsoft.com/en-us/library/aa366781(VS.85).aspx) Cheers, Carl On Mon, Aug 18, 2008 at 11:39 PM, Vikas... [EMAIL PROTECTED] wrote: Hi, I am creating a window service using delphi 5. I need some help is getting the CPU memory usage of the machine so that

Re: [DUG] CPU memory usage

2008-08-18 Thread John Bird
The best tool for measuring CPU load is the sysinternals Process explorer. Google that to find th free download from technet microsoft. John ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin:

Re: [DUG] Images and MS SQL Server

2008-08-18 Thread Dave O'Brien
That's exactly what I am doing to save the image, how do I retrieve it? Every method I have tried comes up blank. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Leigh Wanstead Sent: Monday, 18 August 2008 4:32 p.m. To: NZ Borland Developers Group -

Re: [DUG] Images and MS SQL Server

2008-08-18 Thread Neven MacEwan
Dave Im getting a little confused, have you or have you not managed to write an image to your DB? You could confirm this with a simple sql query or crystal reports If you have you should be able to open the table in the ide and bind a TDBImage to it Neven That's exactly what I am doing to

Re: [DUG] Images and MS SQL Server

2008-08-18 Thread Leigh Wanstead
I assume this code should help. ADOQueryGetMacro.sql.text := 'SELECT FileCol FROM table WHERE ID = :ID'; ADOQueryGetMacro.Parameters.ParamByName('ID').Value := someID; ADOQueryGetMacro.Open; try if not ADOQueryGetMacro.EOF then begin varStream := TMemoryStream.Create;

Re: [DUG] Images and MS SQL Server

2008-08-18 Thread Dave O'Brien
How is ADOQueryGetMacroFileCol defined? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Leigh Wanstead Sent: Tuesday, 19 August 2008 10:28 a.m. To: NZ Borland Developers Group - Delphi List Subject: Re: [DUG] Images and MS SQL Server I assume this code

Re: [DUG] Images and MS SQL Server

2008-08-18 Thread Dave O'Brien
I have just created a new prog, using TADOConnection, TADOTable, TDataSource, TDBImage, TDBNavigator. The TDBImage is empty. Here is the code I am using to save the image: Image is a TImage, ID is correctly defined as the other fields are correctly saved. datamod.ADOU.SQL.Text := 'Update

Re: [DUG] Images and MS SQL Server

2008-08-18 Thread Leigh Wanstead
That is default by Delphi 7 enterprise. Double click the adoquery component and bring up a dialog box and right click to select add all fields. Have a nice day Regards Leigh www.smootharm.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Dave O'Brien

Re: [DUG] Images and MS SQL Server

2008-08-18 Thread Neven MacEwan
Dave It actually appears to be something to do with the image being a jpeg. If I use a bitmap image, the TDBImage shows the bitmap correctly. Yes i don't think TDBImage supports JPGs by default Have you tried datamod. var ImgField: TBlobField; ADOQ.SQL.Text := 'Select * from StockCats

Re: [DUG] Images and MS SQL Server

2008-08-18 Thread John Bird
Maybe you need to work with BMP - there seem to be behind the scenes limitations with what works with JPGs I wrote a program to resize JPEGS, I found there were some tricks about what you could do, it seems in general its less puzzling in Delphi to work with BMP but you can easily convert back

Re: [DUG] Images and MS SQL Server

2008-08-18 Thread Todd Martin
I don't see why not. You probably just need to add 'jpeg' to your uses clause and TPicture.RegisterFileFormat('jpg', 'JPeg Image', TBitmap); TPicture.RegisterFileFormat('jpeg', 'JPeg Image', TBitmap); in the initialization section. You should be able to load a jpeg from stream after