Re: Client Side sorting of mulitple columns

2013-04-26 Thread Sid Gudes
I know QuantumGrid allows this, and I'm sure there are other grid 
components that do as well.


This can be implemented in code as well.  Or the tClientDataset can 
be indexed to the desired order.


It depends on whether the sorting is one-time (in which case IMHO 
using an index is most efficient) or whether you want to give the 
user the ability to sort on the fly by any columns (in which case you 
might want to consider just loading the data into a non-data-bound 
grid as you may get better performance than a data-bound grid; this 
in turn depends on several other factors, such as the size and 
complexity of the dataset).



At 06:14 AM 4/26/2013, SoftTech wrote:

Greetings All,

Using a TClientDataSet, is there any component out there that allows 
sorting of the data in the TClientDataset by multiple 
columns/fields?  For instance, one column will be sorted in 
ascending order and another in Descending order at the same time?


I would be interested in a grid component that would do this, or a 
separate component that would allow for this and of course would 
display the results in a grid.


I may even entertain source code to accomplish this.

Any tips, ideas, code really appreciated.

Thanks,
Mike
__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Re: Need Graphic Component

2013-04-24 Thread Sid Gudes

Hi Andre,

Thanks for the info.

Delphi Twain works really well (demo worked first try), using the 
version that's been updated for XE2 by Ondrej Pokorny at 
http://www.kluug.net/delphitwain.php.  We're already getting scanned 
images, though, so we don't need Twain, but it will likely come in 
handy for a future project.


The Vampyre Imaging Library (from its documentation) does not seem 
able to do automatic deskew and automatic crop.  I poked around a bit 
and found the ImageMagick library (www.imagemagick.org/) which should 
be able to do this, and will investigate it further (it seems to come 
with a Delphi interface).


I went to http://www.winsoft.sk/ocr.htm and downloaded their 
demo.  The OCR did a terrible job.  I think part of the problem is 
there is no way to tell the OCR that it is reading the E13B MICR font 
which only has digits and separators; it read several of the digits 
as letters.  I found software that specifically reads MICR at 
http://www.inliteresearch.com/image-check21/micr-ocr.php, but it's 
not built for Delphi so would need a bit of integration work.


Haven't found anything yet that will automatically burst the 3 check 
images in a single JPG into 3 different JPGs.


Thanks for the info.


At 02:12 AM 4/22/2013, Andre van Zuydam wrote:

Hi Sid

I have some suggestions which may help you, there is a little learning
curve but I found I was able to get some solutions up and running very
quickly.

The first was
Delphi Twain - with some small tweaks it is running under XE2 very well.

The second
Vampyre Imaging Libray
http://imaginglib.sourceforge.net

The examples of very good, this library is not drag and drop components
though and requires a bit of coding to do the manipulations.

As far as the OCR goes I would look at this:

http://cc.embarcadero.com/Item/29034

I have not had opportunity to use this library yet but plan to in a project
I plan to do in the next few months.

If you can download and check these out then perhaps ask questions I would
see if I could assist.

Yours sincerely

Andre van Zuydam





On Mon, Apr 22, 2013 at 12:26 AM, Sid Gudes s...@piasystems.com wrote:

 Hi All,

 I've got an application (Delphi XE2) that I'd like to improve.

 We receive sheets of scanned checks.  Using an external graphics program,
 we rotate and crop the checks, then copy and paste each one into a Delphi
 tImage.  The MICR numbers at the bottom of the check are then manually
 typed into field, and everything is saved to a database.

 What I'd like to be able to do is have the JPG sheets automatically split
 (there are usually 3 checks to a page), rotated, cropped, and have OCR read
 the MICR at the bottom of the checks.  This will save a considerable amount
 of labor.

 Does anyone have experience with a graphics component that will do these
 tasks?  Thanks!



 __**
 Delphi-Talk mailing list - Delphi-Talk@elists.org
 
http://lists.elists.org/cgi-**bin/mailman/listinfo/delphi-**talkhttp://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk





--
http://spiceware.co.za
__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Re: Need Graphic Component

2013-04-24 Thread Sid Gudes

Hi Cameron,

I went to ImageEn and downloaded their OCR demos, but they blew up on 
access violations.  Didn't give me warm fuzzies...


I looked at OmniPage, which has tremendous specifications and should 
do all we need (including built-in OCR support for MICR fonts), but a 
license for their SDK is $4,800.  Although I'm not necessarily 
looking for open source, this is way above my budget!  :-)



At 10:23 AM 4/22/2013, Cameron Cole wrote:

There is a Delphi component called ImageEn that does image manipulation and
has an OCR component call IEVision. We use ImageEn for image manipulation
which works very well. Never used their OCR component though. For OCR we
use Omnipage via their C++ interface. Works very well.


On Sun, Apr 21, 2013 at 6:26 PM, Sid Gudes s...@piasystems.com wrote:

 Hi All,

 I've got an application (Delphi XE2) that I'd like to improve.

 We receive sheets of scanned checks.  Using an external graphics program,
 we rotate and crop the checks, then copy and paste each one into a Delphi
 tImage.  The MICR numbers at the bottom of the check are then manually
 typed into field, and everything is saved to a database.

 What I'd like to be able to do is have the JPG sheets automatically split
 (there are usually 3 checks to a page), rotated, cropped, and have OCR read
 the MICR at the bottom of the checks.  This will save a considerable amount
 of labor.

 Does anyone have experience with a graphics component that will do these
 tasks?  Thanks!



 __**
 Delphi-Talk mailing list - Delphi-Talk@elists.org
 
http://lists.elists.org/cgi-**bin/mailman/listinfo/delphi-**talkhttp://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Re: Need Graphic Component

2013-04-24 Thread Sid Gudes
The Winsoft OCR at http://www.winsoft.sk/ocr.htm is a combination of 
Tesseract and Leptonica.  It didn't work well at all.  I think the 
problem is how to tell the OCR engine that it is reading the E13B 
MICR font, so it does not try to interpret the text as letters or 
punctuation, only as MICR digits and separators.  There doesn't seem 
to be a way to do that with Tesseract.



At 07:50 AM 4/24/2013, Cameron Cole wrote:

You can also try Tesseract OCR. When we tested it, it worked really well.
You will have to import the DLLs and probably work with it a bit but it is
open source and solid.


On Tue, Apr 23, 2013 at 3:43 PM, Sid Gudes s...@piasystems.com wrote:

 Hi Cameron,

 I went to ImageEn and downloaded their OCR demos, but they blew up on
 access violations.  Didn't give me warm fuzzies...

 I looked at OmniPage, which has tremendous specifications and should do
 all we need (including built-in OCR support for MICR fonts), but a license
 for their SDK is $4,800.  Although I'm not necessarily looking for open
 source, this is way above my budget!  :-)



 At 10:23 AM 4/22/2013, Cameron Cole wrote:

 There is a Delphi component called ImageEn that does image manipulation
 and
 has an OCR component call IEVision. We use ImageEn for image manipulation
 which works very well. Never used their OCR component though. For OCR we
 use Omnipage via their C++ interface. Works very well.


 On Sun, Apr 21, 2013 at 6:26 PM, Sid Gudes s...@piasystems.com wrote:

  Hi All,
 
  I've got an application (Delphi XE2) that I'd like to improve.
 
  We receive sheets of scanned checks.  Using an external graphics
 program,
  we rotate and crop the checks, then copy and paste each one into a
 Delphi
  tImage.  The MICR numbers at the bottom of the check are then manually
  typed into field, and everything is saved to a database.
 
  What I'd like to be able to do is have the JPG sheets automatically
 split
  (there are usually 3 checks to a page), rotated, cropped, and have OCR
 read
  the MICR at the bottom of the checks.  This will save a considerable
 amount
  of labor.
 
  Does anyone have experience with a graphics component that will do these
  tasks?  Thanks!
 
 
 
  __

  Delphi-Talk mailing list - Delphi-Talk@elists.org
  
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talkhttp://lists.elists.org/cgi-**bin/mailman/listinfo/delphi-**talk
 
http://lists.elists.org/**cgi-bin/mailman/listinfo/**delphi-talkhttp://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk

 

 
 __**
 Delphi-Talk mailing list - Delphi-Talk@elists.org
 
http://lists.elists.org/cgi-**bin/mailman/listinfo/delphi-**talkhttp://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk



 __**
 Delphi-Talk mailing list - Delphi-Talk@elists.org
 
http://lists.elists.org/cgi-**bin/mailman/listinfo/delphi-**talkhttp://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Need Graphic Component

2013-04-22 Thread Sid Gudes

Hi All,

I've got an application (Delphi XE2) that I'd like to improve.

We receive sheets of scanned checks.  Using an external graphics 
program, we rotate and crop the checks, then copy and paste each one 
into a Delphi tImage.  The MICR numbers at the bottom of the check 
are then manually typed into field, and everything is saved to a database.


What I'd like to be able to do is have the JPG sheets automatically 
split (there are usually 3 checks to a page), rotated, cropped, and 
have OCR read the MICR at the bottom of the checks.  This will save a 
considerable amount of labor.


Does anyone have experience with a graphics component that will do 
these tasks?  Thanks!




__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


RE: Need Graphic Component (Sid Gudes)

2013-04-22 Thread Sid Gudes
For ease of scanning, the checks are scanned three at a time, but 
each individual check image needs to be kept separately, so each scan 
has to be burst apart into multiple images.  Asking the user to 
scan each check individually will run into resistance.


Optimally, I want to be able to meet the requirements 100% using an 
automated process.  If some manual intervention is needed, but is 
less than what we're doing now, we'll still be a ahead.


So I guess I can modify the question to: are there any components 
that people have used and would recommend, even if they don't meet 
the wish list 100%?



At 08:58 AM 4/22/2013, Angus Crossley wrote:

Do you specifically need to keep the image of each individual check after it
has been processed?  Seems to me you could process each jpg for the 
data, and record in the database which jpg it came from.  Might be 
easier than all the graphics manipulation.


Angus

-Original Message-
From: delphi-talk-boun...@elists.org [mailto:delphi-talk-boun...@elists.org]
On Behalf Of delphi-talk-requ...@elists.org
Sent: 22 April 2013 13:00
To: delphi-talk@elists.org
Subject: Delphi-Talk Digest, Vol 108, Issue 1

Send Delphi-Talk mailing list submissions to
delphi-talk@elists.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk
or, via email, send a message with subject or body 'help' to
delphi-talk-requ...@elists.org

You can reach the person managing the list at
delphi-talk-ow...@elists.org

When replying, please edit your Subject line so it is more specific than
Re: Contents of Delphi-Talk digest...


Today's Topics:

   1. Need Graphic Component (Sid Gudes)


--

Message: 1
Date: Sun, 21 Apr 2013 16:26:30 -0600
From: Sid Gudes s...@piasystems.com
Subject: Need Graphic Component
To: Delphi-Talk Discussion List delphi-talk@elists.org
Message-ID: mailman.2.1366632001.25503.delphi-t...@elists.org
Content-Type: text/plain; charset=us-ascii; format=flowed

Hi All,

I've got an application (Delphi XE2) that I'd like to improve.

We receive sheets of scanned checks.  Using an external graphics program, we
rotate and crop the checks, then copy and paste each one into a Delphi
tImage.  The MICR numbers at the bottom of the check are then manually typed
into field, and everything is saved to a database.

What I'd like to be able to do is have the JPG sheets automatically split
(there are usually 3 checks to a page), rotated, cropped, and have OCR read
the MICR at the bottom of the checks.  This will save a considerable amount
of labor.

Does anyone have experience with a graphics component that will do these
tasks?  Thanks!





--

___
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


End of Delphi-Talk Digest, Vol 108, Issue 1
***

__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Re: How do I programmatically center a form?

2013-03-29 Thread Sid Gudes

Should be:

Left := (Screen.width - newFormWidth) div 2;

If newFormWidth is larger than the screen width, that's an exercise 
for the user.


At 07:53 PM 3/28/2013, SoftTech wrote:

Greetings,

Delphi 5.1

I have a need to change the width of a form (larger or smaller) when 
the user clicks a button and programmatically re-center the form.


Any code on how to accomplish this would be appreciated.

Thanks,
Mike
__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Re: Delphi 2007 - app does not terminate during development

2013-01-16 Thread Sid Gudes

Hi Ken,

I haven't tried D2007 under Windows 7 (I'm using XE2 and it works 
fine), but have you tried changing it to run in Windows XP 
compatibility mode and/or tried to run as an administrator?  Just a 
shot in the dark, but HTH.


As far as killing things in Task Manager, I've generally found that 
if a process can't be killed on the Applications tab, it can usually 
be killed on the Processes tab.  Apparently End Process on the 
Processes tab is more ruthless than End Task on the Applications tab.



At 01:34 AM 1/14/2013, Ken Adam wrote:

I have been busy on other non-software projects and haven't used Delphi for
several months (whereas I used to use it all day every day!), so my Windows
7 PC will have changed a bit since it was last used.

Today I tried to compile a simple program and after I ran it, I could not
close Delphi.
Checking Task manager showed that both bds.exe and my application were still
running, but neither could be kill-ed.

Rebooted PC and started again.
Managed to do a few small jobs, then started to write a new program.

I tried to run it (with nothing more than 1 action to open a text file and
add it to a memo), closed the application then closed BDS. When I tried to
open BDS again, I found it was still running in the background (GExperts
complained), and so was the test program. Again, neither can be killed, and
although I can run BDS, I can't overwrite the exe I'm developing, so
development is going to be very slow with a lot of rebooting!

Has anyone seen anything like this before?
Any ideas what might be preventing the app from closing (I presume it is
because the app won't close that BDS can't close).

I've tried a lot of googling, but if the answer is out there, I'm not
thinking of the right keywords to search for!

Thanks for any help you can give.

Regards,
Ken


___
Delphi mailing list
Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


___
Delphi mailing list
Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


RE: What is the best way to add objects to TMemo.Lines

2012-12-16 Thread Sid Gudes

OTTOMH, how about:

if Memo.Lines.Count  22 then
Memo.lines.Delete(0);
Memo.Lines.Add(buf);

IIRC putting the Add at the end should set focus there; if not, 
then perhaps in addition something like this:


Memo.SelStart := Memo.GetTextLen;  // position cursor at end of text
Memo.Scrollby (0, 22);

It's been a while since I did anything sophisticated with tMemo, so 
there may be more that needs to be done, but HTH.



At 03:03 AM 12/14/2012, John Dammeyer wrote:

Hi Everyone,

That does add an interesting question.

How to create a screen similar to hyperterm or any serial terminal where
the text is added to the end and the earliest line of the screen is lost.

Memo.Lines.Add(buf);
if Memo.Lines.Count  22 then
Memo.lines.Delete(0);

As long as the screen is longer than 22 lines the added line is always
visible.  But if the buffer size was to be say 128 so that last 128 lines
are accessible then the new line is added to the end but the Delete(0) in
addition to removing the oldest line also repositions the list starting at
the first.

Having to move a scroll down bar after each entry is tedious.  Especially
if they are lines from a serial port.

Another option is to just remove half the Tmemo buffer.

if COMTraffic.Lines.Count  200 then begin
bufsize := COMTraffic.GetTextlen;
bufsize := bufsize div 2;
COMTraffic.Selstart := 0;
COMTraffic.SelLength := bufsize;
COMTraffic.SelText;
COMTraffic.ClearSelection;
end;


Other suggestions?

John

ELS! The Solution
Automation Artisans Inc.
http://www.autoartisans.com/ELS/
Ph. 1 250 544 4950


 -Original Message-
 From: delphi-boun...@elists.org
 [mailto:delphi-boun...@elists.org] On Behalf Of Arjang Assadi
 Sent: Thursday, December 13, 2012 12:30 PM
 To: Moderated List for the Discussion of Delphi Programming
 excludingDatabase-related topics
 Subject: Re: What is the best way to add objects to TMemo.Lines


 If that is the case why not use TListView instead? TMemo is meant for
 editing text.


 On 13 December 2012 20:04, John Barrat j.bar...@netcom.co.uk wrote:

  No the only things allowed are to re-order (drag and drop)
 and delete - I
  cannot see why that should affect the objects or am I
 missing something?
 
  JohnB
 
  -Original Message-
  From: delphi-boun...@elists.org
 [mailto:delphi-boun...@elists.org] On
  Behalf
  Of Stephen Posey
  Sent: 12 December 2012 15:12
  To: Moderated List for the Discussion of Delphi Programming
 excluding
  Database-related topics
  Subject: Re: What is the best way to add objects to TMemo.Lines
 
  Are you going to allow the text in the Memo to be edited?
 
  If so, what are the implications for the associated objects
 if the number
  of
  lines changes (e.g. someone inserts a line break, types in
 one or more
  lines, or deletes one or more lines)?
 
  Stephen Posey
  stephenlpo...@earthlink.net
 
  -Original Message-
  From: John Barrat j.bar...@netcom.co.uk
  Sent: Dec 11, 2012 11:38 AM
  To: 'Moderated List for the Discussion of Delphi Programming
 excluding   Database-related topics' delphi@elists.org
  Subject: What is the best way to add objects to TMemo.Lines
  
  I seems TMemo.lines only supports the String part of a
 TStrings not the
  Objects.
  
  TMemo.Lines.AddObject compiles fine in fact only the
 string component
  is actually loaded.
  
  
  
  I need to store an object with this TMemo - how do you
 recommend I do
  this?
  
  
  
  JohnB
  
  ___
  Delphi mailing list
  Delphi@elists.org
  http://lists.elists.org/cgi-bin/mailman/listinfo/delphi
 
  ___
  Delphi mailing list
  Delphi@elists.org
  http://lists.elists.org/cgi-bin/mailman/listinfo/delphi
 
  ___
  Delphi mailing list
  Delphi@elists.org
  http://lists.elists.org/cgi-bin/mailman/listinfo/delphi
 
 ___
 Delphi mailing list
 Delphi@elists.org
 http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


___
Delphi mailing list
Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


___
Delphi mailing list
Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Re: Code Sample to delete files in directories and sub-directory based on date

2012-07-24 Thread Sid Gudes

Hi Mike,

Here's a snippet that almost does the trick: it recurses through 
subdirectories of a starting directory and returns all files found in 
a tStringList.  Use DeleteFile (dir + sr.name) to delete a file, use 
FileNameToDateTime(sr.time) to get the date of the file.  HTH.


procedure GetFilesInDirectory (const dir: string; list: tStringList);
var
   sr:   tSearchRec;
   ret:  integer;
begin
   list.add (dir);
   ret := findFirst (dir + '*.*', faAnyFile, sr);
   while ret = 0 do begin
  if (sr.name = '.') or (sr.name = '..') then
 // do nothing, special directories
  else if (sr.attr and faDirectory)  0 then
 GetFilesInDirectory (IncludeTrailingPathDelimiter(dir + 
sr.name), list)

  else if (sr.Attr and (faSysFile or faVolumeID or faSymLink)) = 0 then
 list.add (dir + sr.name);
  ret := findNext (sr);
   end;
   sysUtils.findClose (sr);
end;


At 09:49 AM 7/24/2012, SoftTech wrote:

Greetings All,

Given a starting directory, does anyone have any code snippet that 
would recurse thru a starting directory and all sub-directories and 
delete any file found that is older than a given date.


Any code snippet or tip appreciated.

Thanks,
Mike
__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Re: Getting: A call to an OS function failed. error at runtime startup

2012-06-21 Thread Sid Gudes
I haven't had this happen to any of my programs (compiled with D7 and 
running on Vista and Win 7), although I don't know if any of my users 
are x64.  Here's something I found online:


I don't think this issue has anything to do with Visual Studio 
actually; I believe this must be some Delpi-related issue. As far as 
I know this message only exists in Delphi runtime, i.e. it is not an 
OS- message. The problem is most probably that Delphi runtime calls 
the SetForegroundWindow function when it activates a new form. And 
this function fails because the behavior of this function was changed 
in Vista (and above), especially if UAC is activated, but good old 
Delphi does not expect this function to fail, and throws an 
exception. This is all just my guess of course. 


If this is correct, then one possible solution would be to compile 
with Delphi XE2 and see if it happens with that.


Another thing to try would be for the user to play around with 
compatibility settings and see if having it run in XP mode helps.


Perhaps it would help to surround the suspected area with try ... 
except ... on exception to display the exact exception.message that 
is occurring, might give you some more info to track it down.


FYI, it looks like EOSerror is only raised in one place in both D7 
and XE2, in SysUtils.pas (System.SysUtils.pas for XE2).  This might 
help track it down (e.g. compile a test version of your software 
using a modified SysUtils.pas that displays an informative message 
when EOSerror is raised).



At 10:41 AM 6/19/2012, Chuck Belanger wrote:

Hello:

I use MadExcept to send me error reports from my 60 or so users of a 
program that does have a lot of controls. One particular user on 
loading her Dell laptop (Windows NT New Tablet PC x64 Service Pack 1 
build 7601) is getting this error repeatedly, so much so that the 
program cannot load. I have seen this error rarely and it does not 
stop the loading of the program for other users.


I am using Delphi 2007 to compile the program.

Here is an example error report, at least the top part of one. If 
you want more information from the report, I can supply that. From 
my reading some internet messages, it seems that this is an issue 
about running out of window handles. Yes? Any way around this error? 
Known issues with the Dell OS variation? Other apps on the Dell I 
can shut down? Or, is the user just going to have to get another computer?


Thank you for any information you can provide.

Chuck Belanger

date/time : 2012-06-18, 19:32:22, 135ms
computer name : ISABELSANCHEZ
user name : ISABEL SANCHEZ admin
registered owner  : ISABEL SANCHEZ / Microsoft
operating system  : Windows NT New Tablet PC x64 Service Pack 1 build 7601
system language   : Spanish
system up time: 3 minutes 5 seconds
program up time   : 1 minute 54 seconds
processors: 4x Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz
physical memory   : 2584/4001 MB (free/total)
free disk space   : (C:) 415.54 GB
display mode  : 1920x1080, 32 bit
process id: $1ba4
allocated memory  : 108.73 MB
executable: ProfViewer.exe
exec. date/time   : 2012-06-18 17:19
version   : 2.2.0.249
compiled with : Delphi 2006/07
madExcept version : 3.0h
callstack crc : $708c4126, $b8999865, $91175c23
count : 2
exception number  : 10
exception class   : EOSError
exception message : A call to an OS function failed.

main thread ($1ba8):
0046062c +070 ProfViewer.exe SysUtils   RaiseLastOSError
004605b5 +005 ProfViewer.exe SysUtils   RaiseLastOSError
004d0c10 +130 ProfViewer.exe Controls   TWinControl.CreateWnd
00499e56 +022 ProfViewer.exe StdCtrls   TCustomEdit.CreateWnd
007ec4f9 +005 ProfViewer.exe 
wwdbedit   TwwCustomMaskEdit.CreateWnd
007ec541 +005 ProfViewer.exe 
wwdbedit   TwwDBCustomEdit.CreateWnd
004d0fee +016 ProfViewer.exe 
Controls   TWinControl.CreateHandle
004d4994 +01c ProfViewer.exe 
Controls   TWinControl.HandleNeeded

004d49a1 +005 ProfViewer.exe Controls   TWinControl.GetHandle
004d4b0d +009 ProfViewer.exe 
Controls   TWinControl.GetClientRect
004cc114 +00c ProfViewer.exe 
Controls   TControl.GetClientHeight
007ec3f2 +00a ProfViewer.exe 
wwdbedit   TwwCustomMaskEdit.SetEditRect
007eb652 +022 ProfViewer.exe 
wwdbedit   TwwDBCustomEdit.CMFontChanged


here's another

allocated memory  : 100.19 MB
executable: ProfViewer.exe
exec. date/time   : 2012-06-18 17:19
version   : 2.2.0.249
compiled with : Delphi 2006/07
madExcept version : 3.0h
callstack crc : $5c919ec4, $cef661f7, $82643845
count : 2
exception number  : 12
exception class   : EReadError
exception message : Error reading JvWizard1.ButtonStart.Width: A 
call to an OS function failed.


main thread ($1ba8):
00477fca +0d6 ProfViewer.exe 

Re: How to close modal form when focus moved to another application

2012-04-06 Thread Sid Gudes
OTTOMH, set up a timer that fires say every 500 ms.  In the timer, 
check Application.active, if not active close the modal window.  Untested.  :-)


At 07:48 AM 4/4/2012, John Barrat wrote:
I have an application which needs to close a modal form if focus is 
moved to another application.


Effectively, I want to be able to use moving away and to another 
application to effect a cancel on the modal form.


The problem is that by the time the deactivate event has occurred 
the parent application to which the form is modal is now 
inactive.  Can anyone suggest a way around this?




JohnB

___
Delphi mailing list
Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


___
Delphi mailing list
Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Re: Delphi 5 to Delphi 2010 Conversion

2011-11-03 Thread Sid Gudes

Unicode is probably the biggest change.

However, make sure all your third-party components are 
D2010-compatible.  We've got a D7 project that makes heavy use of a 
third-party component that is not supported past D7, and we are 
currently spending a lot of time converting to another (supported) 
component before we can move to a later version of Delphi.



At 07:58 AM 11/2/2011, SoftTech wrote:

Greetings All,

Are there any white papers available that document what is necessary 
to convert a Delphi 5.1 application to Delphi 2010?


I have a rather large task ahead of me.

Thanks to all who reply.

Mike
__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


RE: Delphi MSXML

2011-01-28 Thread Sid Gudes
We've been using Stefan Heymann's XML parser for a long time, it 
supports D4 and above, is open source, and is very easy to use.  Info 
here: http://www.destructor.de/xmlparser/index.htm.



At 03:31 AM 1/27/2011, Brendan Blake wrote:


Delphi provides a wrapper component designed to read, create and parse XML
documents: TXMLDocument, which I think would make your job much easier.

But you won't have this if you are using Delphi 5 - it was first released in
Delphi 7 I recall.

You can read about using XML with Delphi here, but I think this is based on
later versions of Delphi than yours
http://delphi.about.com/od/windowsshellapi/a/xml_delphi.htm

Maybe someone has worked out how to port TXMLDocument back onto Delphi5
might be quite easy if you have the Delphi 7 source.  Otherwise - upgrade?

Regards,
   Brendan Blake.


-Original Message-
From: delphi-boun...@elists.org [mailto:delphi-boun...@elists.org] On Behalf
Of Steve Bowker
Sent: 26 January 2011 09:44
To: delphi elists
Subject: Delphi  MSXML

Hi,
Has anyone had any experience of using Delphi (5)  MSXML?  I can't seem to
find any decent example code or tutorials on Google.

I've got as far as receiving the XML via a client socket, so have the XML as
one long string.
Here is the sample XML as it would look in text format:
query
  resultsuccess/result
  id01234567890/id
  balance54.50/balance
  tickets320/tickets
  holder_titleMr/holder_title
  holder_firstnameSteve/holder_firstname
  holder_surnameSmith/holder_surname
/query

The 1st element after query will always be result and if 'success'  it
is followed by the returned elements above, else it will return elements
containing failcode  failreason

Here's the (not very elegant) pseudo code of what I want to do with this,
can anyone provide the actual Delphi(5) code to acheive this?

uses
  MSXML2_TLB;

procedure ProcessAllelementsFromXML;
var
  ElementName, ElementValue: string;
  Doc: IXMLDOMDocument;
begin
  Doc := CoDOMDocument.Create;

if Doc.LoadXML(strXML) then
begin
  if Doc.RootNode = 'query' then
  begin
for i := 0 to NumberOfElementsWithinQueryNode do
begin
  ElementName := Doc.ElementName[i];
  ElementValue := Doc.ElementValue[i];
  if ElementName = 'success' then
carry on with loop and populate some text fields from ElementName 
Value
  else
carry on with loop and process each failcode  failreason
end;
  end
  else if Root Node = 'adjust' then
  begin
as above but different element names are processed slightly differently
  end;
end;
end;

Thanks in advance for any help,
Steve
___
Delphi mailing list
Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

___
Delphi mailing list
Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 



___
Delphi mailing list
Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Re: Error reading Binary files using Delphi2006

2010-08-22 Thread Sid Gudes
Haven't used D 2006, so don't know all the gotchas, but perhaps the 
packed or $Align defaults are different, so record definition is 
packed in one version of Delphi but aligned in the other?


At 09:32 AM 8/20/2010, wvido...@metsec.com wrote:

Dear All,

I wrote an application using delphi5 which reads and writes  binary file
using TFilestream.  But then when I ported the application to Delphi
2006 the files written using old application returns junk data in the
new version.

Sample file open procedure:



procedure OpenProjectFile;

var FSave:TFileStream;

begin

 //open an existing project file

  FSave:=TFileStream.Create(Open1.FileName,fmOpenReadWrite);

  FSave.Read(MyData,Sizeof(MyData));

  FSave.Free;

end;



MyData is a record which is the same in both sources.

I am at a loss why this is happening. Can anyone throw some light on
this?

Thanks William


This email is intended for the addressee only.

Please see our email policy at http://www.metsec.com/asp/home/edisclaimer.asp
___
Delphi mailing list
Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 



___
Delphi mailing list
Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Re: Find Dialog

2009-09-14 Thread Sid Gudes

At 05:20 AM 9/14/2009, -K2RFP- wrote:

I'm using a Find Dialog with a Rich Edit component.
The code correctly finds the text but most times it
is out of view. How do I scroll the Rich Edit test
so the found text is in view?


You need to send an EM_SCROLLCARET message, something like this:

  with RichEdit1 do begin
 i := FindText(FindString, 0, Length(Text), []);
 if i = 0 then begin
SelStart := i;
SelLength := Length(FindString);
Perform(EM_SCROLLCARET, 0, 0);
 end;
  end;


_
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 



__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Re: Variant Records

2009-09-01 Thread Sid Gudes
These refer to C bit fields.  There is no equivalent structure in 
Delphi, you would have to use the Delphi AND and SHR operators to get 
the equivalent functionality.  This is probably what you'd need to do 
to read the two bit fields (OTTOMH); writing to Recipient and 
DataDirection are exercises left to the reader. :-)


type
  TbmRequestType = object
  bits: byte;
  function Recipient: integer;
  function DataDirection: integer;
   end;

function TbmRequestType.Recipient: integer;
begin
   result := (bits shr 3) and $1F;
end;

function TbmRequestType.DataDirection: integer;
begin
   result := (bits shr 2) and $01;
end;

This is because the C bit-level declaration lays out the byte named 
Bits as this (where X represents a bit):


   RecipientDataDirection   Unused
 X  X   XX

So total of 8 bits.  (IIRC, the bits are laid out high-order to 
low-order, but maybe I'm remembering that incorrectly, so please double check.)



At 02:46 PM 9/1/2009, James Brown wrote:

I cannot figure out what the equivalent Delphi for this C struct would be:
typedef struct _USB_DEVICE_REQUEST {
   union
   {
   BYTE  bmRequestType;
   struct
   {
   BYTE Recipient:5;
   BYTE DataDirection:1;
  }
   Bits;
};
I know it's a type of free union variant but what the heck is it.

Thanks Jim
__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 



__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Re: Delphi 2007 generated XML files.

2009-08-14 Thread Sid Gudes

At 11:30 PM 8/13/2009, John Dammeyer wrote:

Hi,

What exactly is the point of being able to generate XML files from Delphi.
I'm a bit puzzled as to the usefulness of the generated files.  Wikkipedia
tells about the mark-up language but again, I don't see the point.


It depends on what you're going to be doing with the data.  If the 
purpose of generating the files is to keep some data between runs of 
your program, then using a .ini or .csv file or a proprietary format 
would likely be easier to implement.


If however those files need to be used by another piece of software, 
then XML is a lingua franca that can be read and processed by much 
other software.  XML also has the advantage that you can point your 
browser at an XML file and it will be displayed in a hierarchical 
fashion, making it a bit friendlier than some of the other formats.


Also, if you have an application where raw data needs to be merged 
via XSL transform, then you need to use XML because that's what the XSL needs.


IMHO, the bottom line boils down to these:

1) you need to tailor your file format requirements to the job at hand

2) while creating XML is not hard, to read XML you need to use a 
parser (or you'll drive yourself nuts); there are however some good 
freeware parsers out there


3) if it comes down to a choice between XML and some other format, 
and there is even the slightest possibility that the file might need 
to be used by another system (now or in future), go with XML because 
of the high level of interoperability



John

___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 



___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Re: Servicing hanging messages ?

2009-08-12 Thread Sid Gudes
I haven't played with services very deeply, but if the sending 
service first checks to see if the other service is alive before 
sending the message, and it's not alive, then it can just wait for a 
few seconds and check again.


From what I can find, QueryServiceStatus in the Windows SDK Help 
might be what is appropriate to check whether the other service is 
alive (but see the note under Remarks).  This site might help also, 
see the IsServiceRunning function: 
http://coding.derkeiler.com/Archive/Delphi/borland.public.delphi.non-technical/2006-07/msg00594.html



At 12:13 AM 8/12/2009, J H wrote:

I have two applications running sending messages to each other.

Currently one of them crashes due to some memory violation, which I am
working on.

But as it terminates in a non normal way, it does not tell the other
app, that it is no longer servicing in-coming messages. Thus the other
app. hangs!

Is there a way for, say, a third app. or a separate thread to monitor
and service such hanging messages ?

As it is, I have to start both apps up from scratch. It would be very
unlikely the the window handle for the new edition of App 1 is the same.
And there is still that hanging message.



Ppfont face=Arial, Helvetica, sans-serif size=2 
style=font-size:13.5px___BRhttp://www.sol.dk/ 
- debat mail horoskoper spil og meget mere/font

___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 



___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Re: Non-unicode issue in D7

2009-06-30 Thread Sid Gudes
If the version of Windows (English vs. Thai) was the problem, then 
_all_ tLabels would be affected.  Since only some are being affected, 
that's not it.


Changing font.charset to THAI_CHARSET might help, not sure because 
then why does the other tLabel work with DEFAULT_CHARSET, but it's worth a try.


Concatenation of double-byte characters might cause a problem 
(although even that should work), but of a single-byte character set 
should not be an issue.


Does this occur on your system as well when you set the OS for 
Thai?  If so you can try to use the debugger to look at what's going 
in there...


(Screen shot didn't come through, the list must not allow them.)

At 11:19 PM 6/29/2009, Ross Levis wrote:
Good point, but the font is the same (Arial) and also same 
DEFAULT_CHARSET for both components.


I've attached a portion of a screen shot showing the problem.  The ListView
item below the green one is displayed in the yellow Next Track area above,
but it's just rubbish.

I just found out that another label on another form, showing just the
artist, the characters look correct.  So perhaps it is to do with the
concatenating?
Label.caption := listitem.caption+' - '+listitem.subitems[0];

It is Windows XP, and not sure if it is a Thai Windows or not.  Will that
actually make some difference when the Non-Unicode App setting is set to
Thai in the Control Panel.  The user sent a screen shot showing this was set
correctly.

Thanks,
Ross.

-Original Message-
From: delphi-boun...@elists.org [mailto:delphi-boun...@elists.org] On Behalf
Of Sid Gudes
Sent: Tuesday, 30 June 2009 4:09 a.m.
To: Borland's Delphi Discussion List
Subject: Re: Non-unicode issue in D7

Thai does not need Unicode, as the number of letters in the Thai
alphabet fits into a 1-byte code.  Special fonts are used to
represent the Thai characters.

Is perhaps the Font attribute of the tLabel set to a font name
different from that of the tListView?  If so, there may be a Thai
equivalent of the tListView font, but the tLabel font may be
English-only.  If so, the label will display those characters in the
range #80 to #FF in an English font, which will include all those
funky characters such as accented letter and diphthongs.

What does the tLabel look like?  Can you get a screen shot?  That
might help diagnose the problem.  Also, is the user using Thai
Windows, or English Windows set for Thai?  There is a difference in
the way fonts are rendered between these (in Win 2000 and Win XP,
don't know if Vista does it that way).


At 06:19 AM 6/29/2009, Ross Levis wrote:
My D7 app is not Unicode compliant at all.



A Thai user is complaining of a strange problem where Thai characters
appear
correctly in a ListView, but not correctly in a label just above the
listview.  The label is a Copy of column 1 and 2 from the selected ListView
item.



The user has Thai as the selected language in the Windows regional 
language settings / Advanced tab.



Any ideas?



Thanks,

Ross.

___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com


___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 



___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Re: Internet Search

2009-06-29 Thread Sid Gudes
Using Internet Component Suite or something like 
that, you can formulate your own http string and 
send it to the site, then get the result back and parse it for the results.


But unless the site is set up to return something 
easy for a program to examine (such as XML), 
you're likely to get back HTML which has the 
results intermixed with all sorts of other stuff, 
and will need to parse it to extract the 
results.  This may not be an easy task if the 
result is just a string of text; it's easier if 
there are HTML tags around the results.  Also, if 
there are a lot of results and the site splits 
them onto pages, you'll have to parse the Next 
button (or however they do it) and send that back for the next page.


And when the provider makes some changes to their 
web page, you have to modify your program to parse the new format.


IOW it's doable but will take some research and analysis to get it right.


At 08:24 AM 6/27/2009, you wrote:

Hello!

Is it possible to send name to a search page for 
telephonenumber on the internet, and get the 
answer back in the program?? Ex. if you made a 
program to send Lerberg to www.gulesider.no, 
and then receive all the answer back in the program afterwards.


TIA
Kåre!
___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 



___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Re: Non-unicode issue in D7

2009-06-29 Thread Sid Gudes
Thai does not need Unicode, as the number of letters in the Thai 
alphabet fits into a 1-byte code.  Special fonts are used to 
represent the Thai characters.


Is perhaps the Font attribute of the tLabel set to a font name 
different from that of the tListView?  If so, there may be a Thai 
equivalent of the tListView font, but the tLabel font may be 
English-only.  If so, the label will display those characters in the 
range #80 to #FF in an English font, which will include all those 
funky characters such as accented letter and diphthongs.


What does the tLabel look like?  Can you get a screen shot?  That 
might help diagnose the problem.  Also, is the user using Thai 
Windows, or English Windows set for Thai?  There is a difference in 
the way fonts are rendered between these (in Win 2000 and Win XP, 
don't know if Vista does it that way).



At 06:19 AM 6/29/2009, Ross Levis wrote:

My D7 app is not Unicode compliant at all.



A Thai user is complaining of a strange problem where Thai characters appear
correctly in a ListView, but not correctly in a label just above the
listview.  The label is a Copy of column 1 and 2 from the selected ListView
item.



The user has Thai as the selected language in the Windows regional 
language settings / Advanced tab.



Any ideas?



Thanks,

Ross.

___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 



___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Re: Computing the SHA1 hash of a file: diffreent in XP and Vista?

2009-06-26 Thread Sid Gudes
__

__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 



__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


re: Computing the SHA1 hash of a file: diffreent in XP and Vista?

2009-06-25 Thread Sid Gudes

At 02:41 AM 6/25/2009, Rob Cameron wrote:
Sid, that's a good thought. However I would have thought that it 
would have worked the same in both cases, since the file that is 
being hashed is nominally the same, before and after encryption/decryption.


Is the hash calculated by different code than does the 
decryption?  If so, they could be using different mechanisms to get 
the file size.  Also, if the decryption code decrypts bytes past the 
logical end of the EXE, it won't affect the EXE.


For example, say the EXE is 3,000 bytes long and is in a 4K 
cluster.  This means that the first 3,000 bytes are part of the EXE, 
and the next 1,096 bytes are wasted space.  If the wasted space gets 
decrypted, it won't affect the EXE.  But if the hash algorithm looks 
at that wasted space and uses it, the hash will be off.


I'm of course not saying that this is what's happening, but it's all 
I can think of given your symptoms.




Some more info:

I've been experimenting with a lot more files and in different 
locations. I get the same results whether the files are stored in:


C:\Users\Rob\Temp\folder
or
C:\Temp\folder
or
F:\folder

where folder is my holding folder and F is a USB stick.

However it doesn't do this with all files and so far I haven't been 
able to figure out which files are vulnerable. It doesn't seem to 
depend on file size or file type. I'll do some more expts.


Rob




Sid Gudes wrote:

Could it be that XP returns the actual EXE size, while Vista rounds
up to the next cluster size, so you're hashing some garbage bytes
past the end of the EXE?

At 12:02 PM 6/24/2009, Rob Cameron wrote:
I wrote a program (in Delphi 7) and have been using it for ages to
encrypt then decrypt an executable file, then compare the hash of
the decrypted file with the original. Specifically:

Compute the hash of a file, save it. Let's call it OldHash
Encrypt the file in place
Decrypt the file in place
Compute the hash of the file, let's call it NewHash
Compare OldHash and NewHash.

In XP (SP3 now, but all SPs AFAIK): OldHash = NewHash.
In Vista: OldHash  NewHash.

In both cases the decrypted file appears to be in good order - i.e.
it executes OK and shows no practial differences.

To make the comparisons, I have prepared a folder which contains
only the Launcher (which does the encrypt/decrypt) the target exe
file and a couple of files which are needed for the exe to run (they
are, in fact untouched in these tests). Then I copy this folder from
a machine running XP to a machine running Vista Business and get
different results.
__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 



__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Re: Windows File System

2009-06-25 Thread Sid Gudes
Truecrypt (www.truecrypt.org) emulates a drive, and is open 
source.  Perhaps you can get their source code and see how they do it?



At 03:42 AM 6/24/2009, Sean Cross wrote:

You probaby want to create a shell namespace extension.  You can try
http://www.shellplus.com/examples/namespace-extension-example.html but there
might be some free source out there.

Sean

2009/6/24 Cameron Cole came...@cameroncole.com

 Has anyone ever emulated a drive with a Delphi?  I basically want to create
 a fake drive and read/write contents to a file as a test.  I figure it
 requires writing some sort of driver.  Not really finding anything useful
 out there but this is Delphi and usually finding source or some base
 starting point for these sorts of things is about turning over the right
 rock.
 __
 Delphi-Talk mailing list - Delphi-Talk@elists.org
 http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk

__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 



__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Re: Problem refreshing Memo of a Form

2009-05-10 Thread Sid Gudes
Yes, with your sample code I managed to reproduce your problem.

I suspect the problem is that fsStayOnTop is 
modifying some underlying Delphi runtime data 
structures and causing problems.  If I move 
FormStyle := fsStayOnTop to the OnCreate event, the form works fine.

In fact, Delphi Help for FormStyle property 
(TCustomForm) says Note: It is not advisable to 
change FormStyle at runtime..  This leads me to 
think that FormStyle is a delicate property and 
you may need to rearrange the order of your code to get it to run correctly.


At 12:44 AM 5/10/2009, Cédric Joubert wrote:
hi,

Thanks to you to look at my problem !

Oups sorry...:-)  it is just because you need a main form (let's call it
FormMain) calling the Form1 with a Show instruction (not Showodal) from a
Button (let's call it ButtonMain) on the Main Form. But take a look at the
source here if you want :
http://www.crawleyscastingcalls.com/temp/test/

and yes, you're right it is TForm1 (not TForm2).

So i my example, because of the Stay on Top Form1 above the FormMain form,
the Form1.Deactivate event is fired each time you click on the Button1, or
when you click on the FormMain form which is below Form1.

I work under XP (sp2) with D7.

Cédric

- Original Message -
From: Sid Gudes s...@piasystems.com
To: Borland's Delphi Discussion List delphi@elists.org
Sent: Saturday, May 09, 2009 5:37 PM
Subject: Re: Problem refreshing Memo of a Form


I created a small project that has these
components and it worked fine in D7 under XP;
which version are you using?  I note that your
OnClick below refereces Tform1, but your
OnDeactivate references Tform2.  Perhaps the code
below doesn't reflect all the code in your project?

Also, since the form is change to StayOnTop, the
OnDeactivate event never gets fired...


At 02:20 AM 5/9/2009, Cédric Joubert wrote:
 hi,
 
 I have a simple question about repainting
 controls in a form but this example is maybe simpler to ask my question :
 
 I have a form with 1 TButton, 1 TEdit and 1 TMemo.
 
  the text 'Edit1' is displayed in TEdit.text
  the text 'Memo1' is displayed in the first line of TMemo
 
 In my code Button1.OnClick i have just 2 lines :
 
 procedure TForm1.Button1Click(Sender: TObject);
 begin
FormStyle := fsNormal;
FormStyle := fsStayOnTop;
 end;
 
 In my TForm.OnDeactivate i have just this line :
 
 procedure TForm2.FormDeactivate(Sender: TObject);
 begin
Memo1.Lines.Add('deactivate');
 end;
 
 
 Question : when i launch my form I see the 2
 text Edit1 and Memo1 correctly displayed.
 Then when I click on the button, the Edit1
 text stay right displayed in TEdit
 but the text of TMemo is erased, why ?
 
 TEdit and TMemo have exactly the same priciapl
 heritance hierarchy...(TWincontrol... TPersistent...).
 
 Anyone can help me ?
 
 Cédric
 
 
 ___
 Delphi mailing list - Delphi@elists.org
 http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com


___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 


___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Re: Problem refreshing Memo of a Form

2009-05-09 Thread Sid Gudes
I created a small project that has these 
components and it worked fine in D7 under XP; 
which version are you using?  I note that your 
OnClick below refereces Tform1, but your 
OnDeactivate references Tform2.  Perhaps the code 
below doesn't reflect all the code in your project?

Also, since the form is change to StayOnTop, the 
OnDeactivate event never gets fired...


At 02:20 AM 5/9/2009, Cédric Joubert wrote:
hi,

I have a simple question about repainting 
controls in a form but this example is maybe simpler to ask my question :

I have a form with 1 TButton, 1 TEdit and 1 TMemo.

 the text 'Edit1' is displayed in TEdit.text
 the text 'Memo1' is displayed in the first line of TMemo

In my code Button1.OnClick i have just 2 lines :

procedure TForm1.Button1Click(Sender: TObject);
begin
   FormStyle := fsNormal;
   FormStyle := fsStayOnTop;
end;

In my TForm.OnDeactivate i have just this line :

procedure TForm2.FormDeactivate(Sender: TObject);
begin
   Memo1.Lines.Add('deactivate');
end;


Question : when i launch my form I see the 2 
text Edit1 and Memo1 correctly displayed.
Then when I click on the button, the Edit1 
text stay right displayed in TEdit
but the text of TMemo is erased, why ?

TEdit and TMemo have exactly the same priciapl 
heritance hierarchy...(TWincontrol... TPersistent...).

Anyone can help me ?

Cédric


___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 


___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Re: Access violation in Delphi 7 unit - Help!

2009-01-29 Thread Sid Gudes
 Controls   6237   +3 TWinControl.MainWndProc

00475fa4 MyProgram.exe Classes   10966   +8 StdWndProc

77d4b7a6 USER32.dll SendMessageW

77d4e025 USER32.dll DefWindowProcA

77d4e361 USER32.dll CallWindowProcA

004bef8b MyProgram.exe Controls   6369  +23 TWinControl.DefaultHandler

004d6a52 MyProgram.exe Forms  3774   +7 TCustomForm.DefaultHandler

004bc125 MyProgram.exe Controls   4743   +2 TControl.WMNCLButtonDown

004d74e5 MyProgram.exe Forms  4102  +12 TCustomForm.WMNCLButtonDown



What on Earth could be the problem?  Hundreds of other users are using the
software with no problems.



Any thoughts very welcome!



Thanks,

Ross.

___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 


___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Re: Using Delphi 7 for Chinese language programs

2009-01-16 Thread Sid Gudes
I did some testing of double-byte character sets 
under D7 back in 2006 or so under Win 2000.  To 
fully see/use all the Chinese characters, you 
need to get a copy of Chinese Windows, which, 
unless you can read Chinese, will be impossible to use.

To be able to enter/see Chinese characters 
(rather than funny characters) in tEdit and 
tRichEdit under English Windows, do the following 
(tMenuItem and tComboBox will always show Chinese 
characters oddly under English Windows 2000; for 
other components YMMV, although Quantum Grid 
works OK; don't know if XP or Vista will do better for tMenuItem etc.).

These are the steps that should get you started:

1) Go to Control Panel / Regional and Language Settings

2) On the Regional Options page, set Chinese and China into the two combo boxes

3) On the Language page, check Install Files for East Asian Languages

4) On the Advanced page, choose Chinese in the dropdown box.

You might want to memorize the clicks needed to 
go back, just in case your entire system turns 
Chinese and you can't read menus any 
more...  :-)  (Of course, if you read Chinese that's not an issue.)


At 06:00 AM 1/15/2009, Mick Arundell wrote:
I am now - after a long delay - attempting to 
write programs that can be used in China and 
probably other countries as well. Can you give 
some ideas on where to start. In the first place 
I would like to be able to enter characters into 
forms constructed in Delphi. I am able to test 
these programs but at the moment Delphi shows 
characters as ?? Mick or 米克 
___ 
Delphi mailing list - Delphi@elists.org 
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 


___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Re: Choose DB for Delphi

2008-12-08 Thread Sid Gudes
Good workaround to being able to use LIKE.  For 
small or low-usage databases, this would work 
fine.  For a large database, there are performance hits:

- using Substring would put extra overhead on the server (substring isn't free)

- returning 250 fixed bytes instead of a variable 
number of bytes would put extra overhead on the 
network (unless Advantage trims trailing blanks)

- a char (or true varchar) would be read as part 
of the database row (one I/O), while a memo 
requires 2 or more I/Os (one to read the base 
row, then one I/O for each memo field in that row).

I don't know the overhead that Advantage has for 
memo fields, but in other DBMS, the overhead is 
high.  IIRC, in DB2, varchar has 2 bytes of 
overhead per row, while CLOB has something like 32 bytes of overhead per row.

Again, no problem in a small or low usage 
database, but in a large database the size of 
each record would increase, records per blocks 
would go down, and I/Os would go up, all reducing performance.

For our needs, we plug into many different DBMS 
using ADO.  So we try to keep our SQL standard 
across DBMS.  While the Substring solutions gets 
around the problem in Advantage, it is not the best way to code for other DBMS.

Having not used sp_CreateIndex90, I'm not sure 
what it's doing, but if it lets you create an index on a varchar, great.

In any case, the OP has more information than he probably wanted to know! :-)


At 02:08 AM 12/8/2008, [EMAIL PROTECTED] wrote:
At the risk of teaching you to suck eggs :')

SELECT cropcode, formulation, upper(substring(labeltext,1,250)) AS test1
from labeltx
where  upper(substring(labeltext,1,250)) LIKE '%QUARTS%'

  Order by upper(substring(labeltext,1,250))

CREATE TABLE vchar_test (
   f1 VarChar( 250 ),
   id Char( 10 )) IN DATABASE;
EXECUTE PROCEDURE sp_CreateIndex90(
'vchar_test',
'vchar_test.adi',
'F1',
'f1',
'',
2,
1024,
'' );

I do not use varchar at all, and I do not use memo's much but I find that
substring gets round my problems with this. The modern way is I suppose to
use the Full Text Search (FTS) stuff but I have not tried any of it yet. I
will have to make some time.


Sid Gudes [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
05/12/2008 16:51
Please respond to
Moderated discussion list about database programming with   Borland's
Delphi  delphi-db@elists.org

To
Moderated discussion list about database programming with Borland's Delphi
delphi-db@elists.org
cc

Subject
Re: Choose DB for Delphi


Advantage is fine, we use it for some of our
internal testing via ADO and have had no
problems.  One thing I don't like about Advantage
is that it doesn't have a true Varchar; if you do
a Create Table, Varchars become Memos.  This
means, for example, that you can't have a Varchar
in a key and that the overhead per field is
higher than Varchar.  Also can't use Like on a
memo.  We end up changing many of our Varchars to
Chars and just wasting the space, but that also
gets into recordsize limitations.

If you're working on a small database, this may
not be important.  If the database is large or
you need to use varchars in keys or with the Like
operator, it may be important.  YMMV.


At 01:25 AM 12/5/2008, [EMAIL PROTECTED] wrote:
 I use Advantage database. What they call Local server is available free.
 But even better is the two user development server that has beeen made
 available at http://www.sybase.com/ads_developer_guide_book.
 Then explore the advantage site to download the TTable replcement and
 ordert the book . Total cost about $30 for realy exalant product. And
your
 application will be fully scalable.
 
 
 Cédric Joubert [EMAIL PROTECTED]
 Sent by: [EMAIL PROTECTED]
 04/12/2008 11:15
 Please respond to
 Moderated discussion list about database programming with   Borland's
 Delphi  delphi-db@elists.org
 
 
 To
 delphi-db@elists.org
 cc
 
 Subject
 Choose DB for Delphi
 
 
 Hi,
 
 It's me again ;-)
 
 Which best DB would you use with Delphi7 today for a single user
 application
 (medium size, 50 unit/forms) ?
 
 1/ I need one that fit with :
 - secure data
 - dynamic (auto startup like Interbase/Firebird)
 - freeware if possible
 - querying with good performance
 - transactionnal
 
 5 years ago, I would think about the open source Firebird... but today
 i've
 no idea...
 
 2/ which access method is recommanded, DvExpress, Ado, other  ?
 
 Thanks in advance
 Cédric

***
NOTICE: This e-mail transmission, and any documents, files or previous
e-mail messages attached to it, may contain confidential or privileged
information. If you are not the intended recipient, or a person
responsible for delivering it to the intended recipient, you are
hereby notified that any disclosure, copying, distribution or use of
any of the information contained in or attached to this message is
STRICTLY PROHIBITED. If you have received this transmission in error,
please

Re: Delphi future

2008-08-21 Thread Sid Gudes
At 11:24 AM 8/20/2008, Rory Daulton wrote:
  I would also point out that Delphi 7 is considered by many to be the
  best version of all time and you can upgrade to that without
  encountering the .NET stuff and the massive overhaul of the IDE that
  occurred with later versions. I would recommend doing that if you do not
  anticipate needing Unicode support in your work. If you think you will
  need Unicode support I would upgrade to the upcoming Delphi 2009
  (Tiburon) version.

I am a semi-professional who has been using Delphi 5 Professional 
for a long time.  I would like to upgrade, at least a bit, but I 
can't find Delphi 7
Professional available anywhere.

Any suggestions on where I can get it?  And don't say e-bay, since I have
been looking there for a couple of months and it never appears.

www.provantage.com has the full version (search for Delphi 7), but 
doesn't list the upgrade.  Perhaps you can call them and see if they 
have the upgrade pricing available?

Rory Daulton
[EMAIL PROTECTED]

__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk


Re: Printing Exploded Pie Charts

2008-05-22 Thread Sid Gudes
We didn't have this exact problem, but had some odd printing problems 
that only occurred on certain printers (and not others).  We lived 
with them for a while, then happened to buy the commercial version to 
get a new feature, and all the problems went away with that version.

Apparently they do bug fixing in the commercial version, but the one 
that comes with Delphi is as is and doesn't get bugs fixed or updated.


At 04:22 PM 5/21/2008, Rainer von Saleski wrote:
Hi,

I'm using Delphi 7 and the built-in version of Rave (code interface
only, never use visual designer) to create an exploded pie chart.
Everything looks great on the screen, but when I try to print the chart
(on a black-and-white Laserjet 2300), the shading fill brush patterns
come out in negative -- ghosts of thin white lines with solid black
backgrounds.  Everything else on the page is as expected.

Can anyone suggest another graphics library I could use?  Google
searches get me either no suggestions or hundreds of suggestions, none
of which are right for Delphi.  I'm sure many of you have met and solved
this problem or one like it.  I would really appreciate your
recommendations.  Even if it's as simple as Upgrade Rave.

Thanks,
Rainer von Saleski

___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Re: Qick question on memory use

2008-04-27 Thread Sid Gudes
At 05:03 AM 4/26/2008, Robert Meek wrote:
Morning all,
 Just curious to know what the best indicators and/or utilities
available to help one see the changes in memory and resource usage as it
changes while a Delphi Win32 application is running.

The Task Manager (Ctrl-Alt-Del) Processes page is pretty good for 
seeing what resources are in use.  You can use View/Show Columns to 
select those resources you're most interested in observing.  Note 
that because Delphi uses a sub-allocator, Task Manager will only 
reflect the bulk memory allocated to a Delphi program, not all of 
which might be in use at any given time.

And also if any of you have or know of any special techniques for 
minimizing their use while the program is running but not currently in use.

I don't think that's necessary.  Because Windows pages not-in-use 
programs to its spool file, if a program is not being used it will 
not be in RAM anyway.

 Any comments welcome!


from Robert Meek dba Tangentals Design
e-mail: [EMAIL PROTECTED]
Freelance Windows Programming for XP and Vista
Also proud to be a Moderator of the Delphi-List at elists.org

Reality cannot be explained...only enjoyed or endured as your current
perspective allows!


___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Re: Html to text

2008-04-17 Thread Sid Gudes
The below code loads a string containing HTML into a tRichEdit, from 
whence it could be printed (or, using the tRichEdit.lines property, 
could be stripped into plain text).  Haven't tried it, but looks 
pretty straightforward and since it has all source code, can be user-modified:

http://www.swissdelphicenter.ch/torry/showcode.php?id=1823


At 03:13 AM 4/17/2008, [EMAIL PROTECTED] wrote:
Hello list,

Some time ago I wrote a help-desk application that was entirely
web/email based.  Now a new manager is on board, and wants hard copy
as physical evidence that jobs are being completed.  (apparently an
over-stuffed ring binder is more satisfying than tidy electronic
records, meh).

Heres my problem, in order to get a neat printout of the thousands of
html comments, I have written a little app that displays the comment in
a tWebBrowser, then scrapes the text into a Quick Report Memo.  This
means that I need a web server to run the query on.

So, can one of you gurus tell me:
Is there any way I can read a file directly into a tWebBrowser?
OR
Is there a way to parse html into plain text (simple  cheap*)

*free :o)

Regards - Chris

___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Re: Component for Scheduling/Resource Allocation

2007-11-16 Thread Sid Gudes
At 11:04 PM 11/14/2007, you wrote:
Sid Gudes wrote:
  Any recommendations for a component to do scheduling and resource
  allocation, a la Microsoft Project?
 
  We've got the raw data that is to be displayed, and want a component
  that will take care of drawing all the bars, lines, labels, etc.

So you're not really looking for a component that can do scheduling or
resource allocation.

Yes, I suppose using the verb to do was a bit ambiguous.  :-)

What you're looking for is a component that can draw Gantt charts.
Google find a few things that look helpful.

Yes, we've identified several, but what I'm interested in is hearing 
of people's experiences with various packages, so we can make an 
informed decision.

--
Rob
___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


Component for Scheduling/Resource Allocation

2007-11-14 Thread Sid Gudes
Hi All,

Any recommendations for a component to do scheduling and resource 
allocation, a la Microsoft Project?

We've got the raw data that is to be displayed, and want a component 
that will take care of drawing all the bars, lines, labels, etc.

Thanks for suggestions.


Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


___
Delphi mailing list - Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


MS Project in Delphi

2007-08-19 Thread Sid Gudes
Hi All,

We're trying to integrate (display in an OLEcontainer) MS Project 
into a Delphi application.  We're able to integrate Excel and Word 
pretty straightforwardly, but Project seems to have problems, such as 
popping out of a tTabSheet into its own separate form, and causing 
error messages from the OLE server.

I've tried several things such as placing the OLEcontainer into a 
form, then setting the parent of the form to the tTabSheet, but to no 
avail.  Word and Excel still work dandy, but Project does not.

Has anyone got any suggestions on how to achieve success with 
Project?  I also tried looking for a 3rd-party viewer that might be 
integrated into Delphi, but all the viewers I found were standalone products.

Also, I notice this: We're using D7, which on the Servers tab has 
components for Word, Excel, PowerPoint, Outlook, Access, and Binder, 
but none for Project!  Was this an oversight and it's included in a 
later version of Delphi, or is Project really that different from the rest?

Thanks!


Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


___
Delphi mailing list - Delphi@elists.org
http://www.elists.org/mailman/listinfo/delphi


Re: About compiler-compilers, parsers

2007-08-14 Thread Sid Gudes
Hi Cosmin,

Take a look at Visual Parse++ at www.sand-stone.com.  It provides lex 
and yacc functionality, and its run-time is native Delphi (or several 
other languages, you choose the target), so no DLL or ActiveX 
needed.  It's not freeware or shareware, but not too pricey.  We've 
been using it for almost 10 years and it works just great.

It does accept input from several types of sources, including 
pchars.  I've never tried to run multiple simultaneous instances, but 
it should work.  It basically consists of 3 classes: a parser, a 
lexer, and a consumer (where the lexer gets it string data 
from).  Since you can create as many instances of these classes as 
you want, there should be no problem running multiple simultaneous parsers.

It also includes a visual interactive debugger, so you can debug your 
parser rules visually, which is a real time-saver.  Note that the 
grammar is generated to a resource file (that you can include as a 
resource in your .exe or load as an individual file), so the Delphi 
code it provides is for a generic lexing/parsing engine, it does not 
generate specific code for the grammar, the grammar is data-driven by 
the resource file.


At 12:13 PM 8/12/2007, Cosmin Prund wrote:
Hello everyone. I'm about to start a new program that requires an parser
(possibly complex parser). So I'm asking this question again: What are
the options for an Delphi programmer dealing with parsers? Other then TP
yacc/lex or the Delphi variants?


Different wording:

(1)Is there a Delphi clone of the UNIX tools lex and yacc that
generates modern output? By modern I mean something that can handle
two parsers running simultaneously and allows reading from something
other than TEXT files. All lex/yacc clones I've seen depend on a
lexlib library that's full of global variables and expects
input/output to be done on TEXT files. I almost never need to parse text
files, I'm always parsing text from in-memory strings or TStringList
or TStream descendents. Also I expect my lexers/parsers to work in
multi-threaded environments so global variables are automatically
excluded!

(2)Are there any other tools similar to lex/yacc, commercial or open
source that can generate Delphi code? I've been following a few other
parser projects but they don't generate Delphi code.

I know I've asked those questions before, and I'll probably ask them
again until I'll find a good solution. For now I'm writing all my lexers
/ parsers by hand and it works but it's a bit messy - especially when
it's time to change bits of code that have been written years before!

--

Thanks,

Cosmin Prund
___
Delphi mailing list - Delphi@elists.org
http://www.elists.org/mailman/listinfo/delphi

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


___
Delphi mailing list - Delphi@elists.org
http://www.elists.org/mailman/listinfo/delphi


RE: About compiler-compilers, parsers

2007-08-14 Thread Sid Gudes
At 02:26 AM 8/14/2007, Cosmin Prund wrote:
Visual Parse++ looks like a really, really nice application.
Unfortunately I haven't been able to trial it before. I requested a
trial key about one year ago, but never got my answer back. I sent a new
email today. I'll wait a couple of days and send a fax if I don't get an
answer.

I believe they're a small shop, and I've had to call them (rather 
than e-mail) in the past to get a response.  OTOH once you're past 
the learning curve, there's no need to call tech support, it's a very 
solid product.  (I don't think I've gotten in touch with them for 
several years, and the last time was because of a bad product key, 
not a technical issue.)

Anyway, are you using it with Delphi?

Yes, starting with D1 and going forward.  It uses 3 classes, and you 
basically override the Reduce method in the Yacc class to get at the 
parsed tokens and do whatever your target operation is.  Calling it 
is very simple (following omits error handling and cleanup):

consumer := ssLexStringConsumer.create (pchar(MyString));
lexer := mLexClass.create (consumer, expressLex);
parser := mYaccClass.createLex (lexer, expressYacc);
parser.parse;

In the above, MyString is the string to be parsed, expressLex 
contains the resource file with Lex rules (loaded into RAM), and 
expressYacc contains the resource file with Yacc rules (loaded into RAM).

Have you ever used lex+yacc?

Yes, many years ago we used MKS Lex/Yacc in a DLL called by Delphi 
(since MKS generates C) before switching to Visual Parse++.

Does it offer anything extra compared to those, except a visual 
editor and a debugger?

There are several extensions that they added to make certain types of 
parsing easier.  If you're interested, e-mail me and I can send you a 
couple of sample grammars showing these.

Thanks for reminding me of Visual Parse++

--
Cosmin Prund



  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
  Behalf Of Sid Gudes
  Sent: 13 august 2007 19:20
  To: Borland's Delphi Discussion List
  Subject: Re: About compiler-compilers, parsers
 
  Hi Cosmin,
 
  Take a look at Visual Parse++ at www.sand-stone.com.  It provides lex
  and yacc functionality, and its run-time is native Delphi (or several
  other languages, you choose the target), so no DLL or ActiveX
  needed.  It's not freeware or shareware, but not too pricey.  We've
  been using it for almost 10 years and it works just great.
 
  It does accept input from several types of sources, including
  pchars.  I've never tried to run multiple simultaneous instances, but
  it should work.  It basically consists of 3 classes: a parser, a
  lexer, and a consumer (where the lexer gets it string data
  from).  Since you can create as many instances of these classes as
  you want, there should be no problem running multiple simultaneous
  parsers.
 
  It also includes a visual interactive debugger, so you can debug your
  parser rules visually, which is a real time-saver.  Note that the
  grammar is generated to a resource file (that you can include as a
  resource in your .exe or load as an individual file), so the Delphi
  code it provides is for a generic lexing/parsing engine, it does not
  generate specific code for the grammar, the grammar is data-driven by
  the resource file.
 
 
  At 12:13 PM 8/12/2007, Cosmin Prund wrote:
  Hello everyone. I'm about to start a new program that requires an
  parser
  (possibly complex parser). So I'm asking this question again: What
are
  the options for an Delphi programmer dealing with parsers? Other then
  TP
  yacc/lex or the Delphi variants?
  
  
  Different wording:
  
  (1)Is there a Delphi clone of the UNIX tools lex and yacc that
  generates modern output? By modern I mean something that can
  handle
  two parsers running simultaneously and allows reading from something
  other than TEXT files. All lex/yacc clones I've seen depend on a
  lexlib library that's full of global variables and expects
  input/output to be done on TEXT files. I almost never need to parse
  text
  files, I'm always parsing text from in-memory strings or
TStringList
  or TStream descendents. Also I expect my lexers/parsers to work in
  multi-threaded environments so global variables are automatically
  excluded!
  
  (2)Are there any other tools similar to lex/yacc, commercial or
  open
  source that can generate Delphi code? I've been following a few other
  parser projects but they don't generate Delphi code.
  
  I know I've asked those questions before, and I'll probably ask them
  again until I'll find a good solution. For now I'm writing all my
  lexers
  / parsers by hand and it works but it's a bit messy - especially when
  it's time to change bits of code that have been written years before!
  
  --
  
  Thanks,
  
  Cosmin Prund
  ___
  Delphi mailing list - Delphi@elists.org
  http://www.elists.org/mailman/listinfo/delphi

RE: Recommendations for ISP?

2007-04-26 Thread Sid Gudes
At 12:14 AM 4/26/2007, Cosmin Prund wrote:
If you previously had your own on-site server consider getting an
hosted server. Actually - given your list of requirements I'd be
really surprised if *any* single provider provides everything!

Any recommendations for a hosted server provider?


Cosmin Prund

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sid Gudes
Sent: Thursday, April 26, 2007 1:50 AM
To: delphi-talk@elists.org
Subject: OT: Recommendations for ISP?

Hi All,

We're looking at outsourcing our web server to an ISP.  Anyone have
any vendors they can recommend?

In addition to HTTP, FTP, SMTP, and POP services, we need to be able
to run FogBugz at the ISP site, and need to be able to have the ISP
relay Microsoft MTS sessions to our MTS server which will still be
located in our office.  Thanks!

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk


RE: Recommendations for ISP?

2007-04-26 Thread Sid Gudes
At 01:24 AM 4/26/2007, you wrote:
I can recomend my ISP in Romania but that's not going to be of any use
to you! Given the nature of an hosted server, you may need to drive
there a few times (at a minimum you need to get your server down there).
Look for properly connected service providers that offer at least some
extras (like remote restart - so you don't need to drive to your
hosting location to push the restart button if your Windows Server
decides to crash).

Exactly the reason we want to move to an ISP: we're anticipating 
higher amounts of travel this year and fewer people in the office, so 
having someone else be able to manage the web site is 
critical.  That's why we're looking for positive experiences that 
people have had, we need an ISP that is reliable.

Although I wouldn't mind an excuse to visit Romania, somehow I think 
trying to justify a trip there to evaluate ISPs would raise a few 
eyebrows!  :-)


Cosmin Prund

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sid Gudes
Sent: Thursday, April 26, 2007 9:24 AM
To: Delphi-Talk Discussion List
Subject: RE: Recommendations for ISP?

At 12:14 AM 4/26/2007, Cosmin Prund wrote:
 If you previously had your own on-site server consider getting an
 hosted server. Actually - given your list of requirements I'd be
 really surprised if *any* single provider provides everything!

Any recommendations for a hosted server provider?


 Cosmin Prund
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Sid Gudes
 Sent: Thursday, April 26, 2007 1:50 AM
 To: delphi-talk@elists.org
 Subject: OT: Recommendations for ISP?
 
 Hi All,
 
 We're looking at outsourcing our web server to an ISP.  Anyone have
 any vendors they can recommend?
 
 In addition to HTTP, FTP, SMTP, and POP services, we need to be able
 to run FogBugz at the ISP site, and need to be able to have the ISP
 relay Microsoft MTS sessions to our MTS server which will still be
 located in our office.  Thanks!

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED]


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk
__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk


Re: Recommendations for ISP?

2007-04-26 Thread Sid Gudes
The review site confirms some of my fears, there seem to be more than 
a few fly-by-night operators out there, but also some good 
reviews.  Thanks for the info.

At 09:25 AM 4/26/2007, you wrote:
here are a few to look at:
http://serverbeach.com (quality equipment, so-so support, midrange price)
http://www.theplanet.com (the 800-lb gorilla, better for knowledgeable
and high-volume customers)
http://www.servermatrix.com/ (theplanet's entry-level channel)

here is a review site, info overload but a good place to learn about
issues and vendors:
http://www.internet-hosting-report.com/

and in general, google for dedicated server review for more reviews
and hosts.


[EMAIL PROTECTED] wrote:
  At 01:24 AM 4/26/2007, you wrote:
  I can recomend my ISP in Romania but that's not going to be of any use
  to you! Given the nature of an hosted server, you may need to drive
  there a few times (at a minimum you need to get your server down there).
  Look for properly connected service providers that offer at least some
  extras (like remote restart - so you don't need to drive to your
  hosting location to push the restart button if your Windows Server
  decides to crash).
 
  Exactly the reason we want to move to an ISP: we're anticipating
  higher amounts of travel this year and fewer people in the office, so
  having someone else be able to manage the web site is
  critical.  That's why we're looking for positive experiences that
  people have had, we need an ISP that is reliable.
 
  Although I wouldn't mind an excuse to visit Romania, somehow I think
  trying to justify a trip there to evaluate ISPs would raise a few
  eyebrows!  :-)
 
 
  Cosmin Prund
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of Sid Gudes
  Sent: Thursday, April 26, 2007 9:24 AM
  To: Delphi-Talk Discussion List
  Subject: RE: Recommendations for ISP?
 
  At 12:14 AM 4/26/2007, Cosmin Prund wrote:
  If you previously had your own on-site server consider getting an
  hosted server. Actually - given your list of requirements I'd be
  really surprised if *any* single provider provides everything!
  Any recommendations for a hosted server provider?
 
 
  Cosmin Prund
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of Sid Gudes
  Sent: Thursday, April 26, 2007 1:50 AM
  To: delphi-talk@elists.org
  Subject: OT: Recommendations for ISP?
 
  Hi All,
 
  We're looking at outsourcing our web server to an ISP.  Anyone have
  any vendors they can recommend?
 
  In addition to HTTP, FTP, SMTP, and POP services, we need to be able
  to run FogBugz at the ISP site, and need to be able to have the ISP
  relay Microsoft MTS sessions to our MTS server which will still be
  located in our office.  Thanks!

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk


RE: Converting Delphi EXE to Browser-based

2007-04-23 Thread Sid Gudes
Hi All,

It looks like converting our client-side app to a server-side app is 
going to take some time and effort!  :-)  Too bad there isn't a 
quicker way, but I guess we have to do what we have to do.

While this conversion is going on, we want to look into converting 
our EXE into a browser-aware plugin, so that we can start getting 
people used to the idea of having the program run in a browser.

Does anyone have any tools / articles they can recommend for 
converting a Delphi EXE into a plugin for IE?  Firefox would be nice 
too.  Thanks.


Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk


Re: Quick question slightly left of being On Topic!

2007-04-19 Thread Sid Gudes
Hi Robert,

We haven't taken the plunge into Vista here (we're waiting for 
everyone else to shake out problems :-) ), but quite a while ago we 
switched our news readers to Thunderbird 
(http://www.mozilla.com/en-US/thunderbird/).  Their web site claims 
to support Vista (click on System Requirements under the download button).

Thunderbird is an e-mail client as well as a news client, but you 
don't have to use the e-mail part if you don't want to.


At 07:33 AM 4/19/2007, you wrote:
 Does anyone know of a good newsgroup application that actually
works properly under Vista Ultima unlike the one supplied with it?
 I managed to get OutLook 2002 installed and working as part of
XP Office pro thankfully, although a nasty glitch requires re-inputting
ones password every time you start it up again, but OutLook Express,
which I HAD been using for my newsgroups under XP Pro will not work at
all!
 I seem to remember one of our members here having a free or
shareware newsgroup app that was supposed to be pretty good, but I don't
recall it's or his name.  In any case, if it will at the very least,
allow me to read and write messages on the various professional groups I
normally hang on, like Borland's, Raize, TMS, Jedi, and others, I'd
appreciate hearing about it as this one belongs in Vegas where it can at
least give one a chance to bet on which of it's many glitches and
problems will stop you from making use of it on any particular day!

from Robert Meek dba Tangentals Design
e-mail: [EMAIL PROTECTED]
Freelance Windows Programming for XP and Vista
Also proud to be a Moderator of the Delphi-List at elists.org

Reality cannot be explained...only enjoyed or endured as your current
perspective allows!


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk


RE: Converting Delphi EXE to Browser-based

2007-04-18 Thread Sid Gudes
Thanks for the replies.  IntraWeb looks like it could entail a 
complex conversion effort.  Has anyone used WebExpress and/or Delphi 
for PHP?  Any comments on conversion effort, effectiveness, gotchas 
using either of those products?  Thanks.


At 02:56 PM 4/10/2007, you wrote:
When I went that way, I used intraweb.  I had to rewrite all the gui 
code obviously but all the calculation code I could use as is.  I 
also went 3 tier at the same time using RemObjects to connect to the 
server.  That let me put the webserver with a specialist hosting 
company and keep the database inside our network.

Initially, while I was working for a different company, they 
contracted someone else to write the web app.  It took them 9 months 
to deliver a partially working app with no data connectivity.  Using 
Intraweb and remobjects I did the entire thing in under 3 months of 
part time work.

Regards

Sean Cross
IT Systems Development Manager

Catalyst Risk Management
PO Box 230
50 Dalton St
Napier 4140
DDI: 06-8340362
mobile: 021 270 3466
Visit us at http://www.catalystrisk.co.nz/

Offices in Auckland, Napier, Wellington  Christchurch

Disclaimer:
The information contained in this document is confidential to the 
addressee(s) and may be legally privileged. Any view or opinions 
expressed are those of the author and may not be those of Catalyst 
Risk Management. No guarantee or representation is made that this 
communication is free of errors, viruses or interference. If you 
have received this e-mail message in error please delete it and 
notify me. Thank you.


  -Original Message-
  From: [EMAIL PROTECTED] [mailto:delphi-talk-
  [EMAIL PROTECTED] On Behalf Of Sid Gudes
  Sent: Wednesday, 11 April 2007 6:04 a.m.
  To: delphi-talk@elists.org
  Subject: Converting Delphi EXE to Browser-based
 
  Hi All,
 
  Our company has decided to convert an existing Delphi app (rich
  client EXE) to work within a browser.  (Citrix and MTS are not
  options due to a host of reasons.)
 
  We already have developed some other Delphi apps that are web-server
  based, so have inhouse experience on web server development in general.
 
  Does anyone know the best way to convert our existing app from a
  client-side EXE to a server-side EXE?  At the very least, we need to
  use HTML instead of DFM for our forms, but I would think that more
  than a little of our program logic needs to be changed.
 
  Are there any tools, books, components, etc. that you can recommend
  to help make this transition as painless as possible?  We're looking
  at things like short learning curve, short conversion effort, to the
  degree possible.
 
  Thanks.

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk


Question on Set operator

2007-04-17 Thread Sid Gudes
Hi All,

I've inherited some code that I need to integrate into some existing 
code.  The author of the old code is using a construct I don't 
understand.  There are things like:

if (X - [a, b]) = [] then ...

where X is a set and a and b are valid members of that set.  My 
understanding of sets is that this should be the same as:

if (a in X) or (b in X) then...

but it isn't, because if I replace the first if with the second, 
the program behavior changes.

Can someone help me with my conceptual gap and explain what the first 
if is saying?  Thanks.


Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk


Converting Delphi EXE to Browser-based

2007-04-10 Thread Sid Gudes
Hi All,

Our company has decided to convert an existing Delphi app (rich 
client EXE) to work within a browser.  (Citrix and MTS are not 
options due to a host of reasons.)

We already have developed some other Delphi apps that are web-server 
based, so have inhouse experience on web server development in general.

Does anyone know the best way to convert our existing app from a 
client-side EXE to a server-side EXE?  At the very least, we need to 
use HTML instead of DFM for our forms, but I would think that more 
than a little of our program logic needs to be changed.

Are there any tools, books, components, etc. that you can recommend 
to help make this transition as painless as possible?  We're looking 
at things like short learning curve, short conversion effort, to the 
degree possible.

Thanks.


Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk


Re: copying one richedit to another

2007-03-18 Thread Sid Gudes
Haven't done this in a while, but IIRC it's:

rePhraseSentence.lines.Assign(reSentence.lines);

If that doesn't work, then try this:

mem := tMemoryStream.create;
reSentence.SaveToStream (mem);
mem.seek (0,0);
rePhraseSentence.LoadFromStream (mem);
mem.destroy;

Of course, both richedits should have PlainText := false;


At 04:37 PM 3/16/2007, you wrote:
Hi All,

I have two TRichEdits - reSentence and rePhraseSentence.
The program spends a lot of time figuring out how to highlight
reSentence with different fonts to help the user identify which
words have which significance.

Next, I want to copy the contents of reSentence to rePhraseSentence
intact, with all the same highlight fonts in all the same places so
the program doesn't have to spend a lot of time doing the
exact same highlighting to rePhraseSentence that it already
did to reSentence.

I tried:
reSentence.CopyToclipboard;
rePhraseSentence.PasteFromClipboard;

but that didn't do it.

So I tried:
rePhraseSentence.Lines := reSentence.Lines;
and
rePhraseSentence.Text := reSentence.Text;

but of course that didn't do it either - the highlighted font
information didn't get copied from reSentence to rePhraseSentence.

I tried:
rePhraseSentence.Assign(reSentence);

but that caused a runtime exception stating that I can't assign
a TRichEdit to a TRichEdit.

Since rePhraseSentence is placed on panel rePhraseLeft, I tried:
paPhrasesLeft.rePhraseSentence := reSentence;

but that generated a compiler error.

Can anyone figure out how to move the contents of one RichEdit
to another RichEdit while preserving the highlighted font selections
as well as the text?

Help appreciated,
Rich


___
Delphi mailing list - Delphi@elists.org
http://www.elists.org/mailman/listinfo/delphi

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


___
Delphi mailing list - Delphi@elists.org
http://www.elists.org/mailman/listinfo/delphi


Re: Windows XP network security issue and my Delphi application

2006-12-17 Thread Sid Gudes
This may or may not be helpful, but when one of our customers moved 
from Win NT to Win 2000, their Teradata DBMS no longer worked: 
_sometimes_.  But sometimes it did!  It was driving everyone crazy.

This turned out to be because Win 2000 added an operating system 
service that tried to use the same port that Teradata did.  If that 
service happened to run first at bootup, it grabbed the port, and 
Teradata didn't work.  But if the Teradata service ran first, it 
grabbed the port, and it worked fine.  (Apparently the Windows 
service, if it couldn't get its desired port, grabbed a different 
one, but Teradata was hard-coded to only one port.)

This may not be the problem in your instance (IIRC in our case no one 
could connect to Teradata, even from the server), but perhaps 
something on the network is trying to use port 3050.  I'm not 
familiar with Firebird, but if it can be easily reconfigured to use a 
different port, perhaps you can try that and see if it resolves the problem?


At 10:16 AM 12/17/2006, Cosmin Prund wrote:
  From the server machine I can connect to the Firebird server using
telnet 127.0.0.1 3050.
If I try telent REAL_IP_ADDR 3050 the connection fails! I don't
remember the error number (if any) but it was most likely time out related.
If I run netstat -n -a -o I see the firebird process listening on
0.0.0.0:3050 so it should work on both loopback and the real ip address.

I'll have some colleagues on site tomorrow so I might be able to run
some tests, but I have absolutely no idea what to look for. I already
looked for personal firewalls or anti virus software and I found none.

I also might be able to get an W2k telnet.exe on the XP machine if that
makes any difference.

Thanks for your input, any other ideas?

Wilfried Mestdagh wrote:
  Hello Cosmin,
 
  Can you connect to the server using a simple telnet session ? this
  should be possible if the server uses TCP.
 
  If not, what is the winsock error ?  (I think you have to use the old
  telnet.exe W2K or older to get the error number).
 
  ---
  Rgds, Wilfried
  http://www.mestdagh.biz

__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk


Re: End-user form designer?

2006-12-13 Thread Sid Gudes
We faced the same issue, and rather than have our users learn a forms 
editors, we decided to use Dave Baldwin's HTMLviewer (www.pbear.com) 
to display HTML forms.  This allows our users to author their forms 
in HTML using any commercial HTML editor.  Since their staffs usually 
have HTML expertise, this allows them to start creating forms with no 
learning curve, and also to use forms created for our Delphi program 
in other applications (and vice versa).  Since HTMLviewer supports 
CSS, fine formatting control is available.

The only restrictions we found in HTMLviewer is that JavaScript is 
not supported (although it seems that we can get a third-party 
JavaScript interpreter and integrate it, but we're not at that point 
yet), and that Quantum Grid is not directly supported, but we were 
able to get QG in there using the PANEL tag included in HTMLviewer.


At 01:32 AM 12/13/2006, Cosmin Prund wrote:
Hello!

I need to provide my users with a way to define custom data-input screens.

I already found Greatis Form Designer, I tested it and it would do the
job just fine. I also ordered it BUT the account numbers I got from
SWREG don't add up (I've got an GB IBAN for a DE bank and an total of 3
SWIFT codes on the same invoice). I wanted to contact SWREG to have
those issues sorted but I found NO way to do so! They've got a funny
Help section on the front page but unfortunately my problem is not
listed among the 10 problems selectable there, and there's no other
problems section. So I've opened an support ticket with Greatis: I
basically notified them of my problems with SWREG and asked for a way
around this. I also provided the Reference Order Number I got from SWREG
to make it obviously clear I want to buy the thing. I got no answer in
48 hours...

Anyone any (other) recommendations?

Thanks,
Cosmin Prund

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk


tADOcommand Problem

2006-10-01 Thread Sid Gudes
Hi All,

I'm trying to use tADOcommand to execute an Update statement.  There 
are several parameters set into the Parameters property.  I want to 
get the number of records affected.  However, there doesn't seem to 
be an overloaded call to Execute that lets me do this.  If I make 
these calls, I can't get the right results:

tADOcommand.Execute;
count is not returned

tADOcommand.execute (count, null);
count is returned, but tADOcommand.Parameters is ignored
(same problem if unassigned is used instead of null)

Any ideas on how I can use Parameters but also get a count back?  Thanks.


Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk


Re: Printer.Printers Problem

2006-09-01 Thread Sid Gudes
I've had some issues with printers before due to funny changes to 
case.  Try replacing

 if trim(printer.printers[iLoop])=pn then

with

 if sametext (trim(printer.printers[iLoop]), pn) then

and see if that resolves the problem.


At 03:59 AM 9/1/2006, Chris Moore wrote:
Hello List,

This function DOES work on my development machine (XP SP2) but DOES NOT work
on the target PC (XP SP2).

Function TestForPrinter(pn:string):Boolean;
var
r:Boolean;
ni,iloop:integer;
mess:string;
begin
r:=true;
ni:=-1;
for iloop:=0 to printer.printers.Count-1 do
 begin
 if trim(printer.printers[iLoop])=pn then
begin
ni:=iLoop;
end;
 end;
if ni1 then // Oh No - No Printer
begin
r:=false;
mess:='!! ERROR - printer '+pn+' not installed on this PC !!'+#10;
mess:=mess+''+#10;
mess:=mess+'Contact the Computer Department'+#10;
showmessage(mess);
end;
TestForPrinter:=r;
end;

This snippet works on both PC's - (I thought the trim function might be
getting in the way so I put logic in to test)

procedure testy;
var
iloop:integer;
pn,an:string;
begin
form1.CheckListBox1.Clear;
pn:=form1.edt_find.Text; {tedit used to test for printers and duffstuff}
for iloop:=0 to printer.printers.Count-1 do
 begin
 form1.CheckListBox1.Items.Add(printer.printers[iLoop]);
 if form1.CheckBox1.Checked then
an:=trim(printer.printers[iLoop])
 else
an:=printer.printers[iLoop];
 if an=pn then
form1.CheckListBox1.Checked[iLoop]:=true;
 end;
end;

Why does one work and the other not? - I am confused++

Chris Moore
Computer Department

Brother Industries (UK) Ltd




___
Delphi mailing list - Delphi@elists.org
http://www.elists.org/mailman/listinfo/delphi

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


___
Delphi mailing list - Delphi@elists.org
http://www.elists.org/mailman/listinfo/delphi


Re: Listbox can contain multiple font colours?

2006-07-09 Thread Sid Gudes
Sure, look at the example under tListBox.OnDrawItem.  The canvas's 
font.color should be set to the desired color before calling TextOut 
(or might be the canvas's pen.color, don't recall for 
certain).  Setting the canvas's brush.color will change the 
background color also, if that's desired.  If you want to do that, 
make sure to set brush.color before the call to FillRect.


At 01:10 AM 7/9/2006, Russell Stapleton wrote:
Hi all, absolute newbie here.

Can I make a listbox contain different coloured text? I have a 
listbox that adds words in a wordgame I am writing and would like to 
show the incorrect words in red, correct words black.

If this cannot be done (and I suspect not) I am open to any 
suggestions as to how I should show the incorrect words, otherwise 
anyone playing will forget what their previous attempts were.

TIA, etc,
R.

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


___
Delphi mailing list - Delphi@elists.org
http://www.elists.org/mailman/listinfo/delphi


Re: similiar to opening a csv file in default program

2006-07-08 Thread Sid Gudes
I haven't tried this, but probably what you can do is try to open the 
file exclusively (fmShareExclusive).  If it is in use by DOS, then 
the open should fail.  Once DOS finishes and closes the file, the 
open should succeed.  So something like this:

waiting := 100;
repeat
try
   fs := tFileStream.create (D+'harbor.txt', fmOpenRead or 
fmShareExclusive);
   // at this point the open succeeded, so break out of the loop
   fs.destroy;
   break;
except
   // we get here if the file was not openable, or does not exist
   sleep (100);
end;
dec (waiting);
until waiting = 0;
if waiting = 0 then error...

The above is OTTOMH.  I think also, in case there is an old version 
of harbor.txt on the hard drive, that it would make sense to delete 
the file before running the DOS command, otherwise the 
tFileStream.create might just succeed on the old file before the DOS 
session gets underway.

BTW, should
'/c '+'ipconfig/all  harbor.txt'

be instead
'/c '+'ipconfig/all  ' + D + 'harbor.txt'
?

HTH


At 09:07 AM 7/6/2006, Rich Cooper wrote:
Thanks Rob,

But actually, I did get one to work.  It finally gelled for the following
code in my OnFormCreate handler:

   D := GetStartDir;
   ShellExecute( 0, 'open', PChar('command.com'),
 PChar('/c '+'ipconfig/all  harbor.txt'),
 nil, SW_HIDE );
   Waiting := 100;
   while ( (Waiting0) and (not FileExists(D+'HARBOR.TXT')))
   do begin
 Sleep(250);
 Waiting := Waiting-1;
  end;

   if   (not FileExists(D+'HARBOR.TXT'))
   then raise Exception.Create('Login Error 1.');

But there is still a problem.  The 'Waiting' loop discovers that the
file exists, but not whether it has been completely written and let
loose to be read.  In my OnFormActivate handler, I use:

if   FirstActivation
then begin
   D := GetStartDir;
   Application.ProcessMessages;
   Sleep(500);

   if   FileExists(D+'HARBOR.TXT')
   then begin
   meHarbor.Lines.LoadFromFile(D+'HARBOR.TXT');

which works MOST of the time.  But occasionally, (5%) it causes
an exception related to trying to read a file that is still being written.

Does anyone have a way to determine whether the file HARBOR.TXT
has been released for reading after being completely written?  I would
be able to fix this problem by replacing the Sleep(500) with a loop
that tests till the HARBOR.TXT file is ready.

Thanks,
Rich


Rob Kennedy wrote

  Rich Cooper wrote:
  I'm trying to pipe a DOS command to a file using a ShellExecute,
  but it doesn't create  the output file.  Here's the code:
 
  var D : string;
  ...
D := GetStartDir;
ShellExecute(0,pChar('ipconfig/all 
  '),pchar('harbor.txt'),nil,pChar(D),SW_SHOWNORMAL);
  ...
 
  but no file named 'harbor.txt' gets created.  Does anyone know how to
  fix this?
 
  First, ipconfig/all  is not a shell verb. Did you read the
  documentation for ShellExecute before composing the code above?
 
  Second, you're telling ShellExecute to look in the registry for the
  ipconfig/all  key for files named *.txt, and then execute the command
  it finds there on the harbor.txt file, which I'm guessing doesn't even
  exist.
 
  Third, note that command-line redirection is performed by the
  command-line interpreter. ShellExecute is not a command-line
  interpreter. Read this:
 
  http://blogs.msdn.com/oldnewthing/archive/2006/05/16/598893.aspx
 
  You should be able to find lots of example code to solve your problem
  with the following search:
 
  http://groups.google.com/groups?q=pipe+dos+commandas_ugroup=*delphi*
 
  Fourth, ipconfig is not a DOS command. It's a console program, but it's
  a fully fledged Windows program. Try to run it in DOS (if you even have
  a computer with DOS installed anymore), and you'll simply be told that
  it needs to run in Win32 mode.
 
  Finally, type-casting a string literal to PChar is not necessary and can
  sometimes lead to problems. A string literal can be used as any
  string-related type, including AnsiString, WideString, PAnsiChar, and
  PWideChar. The compiler will choose based on what it needs. You don't
  need to tell it.
  --
  Rob

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


___
Delphi mailing list - Delphi@elists.org
http://www.elists.org/mailman/listinfo/delphi


Re: Windows that can close themselves

2006-02-28 Thread Sid Gudes
I've never done this in an OnButtonClick, but I think this will work:

 self.release;
 self.close;

What I usually do to get a self-closing window is just add this line 
to the OnFormClose event:

 action := caFree;


At 04:51 AM 2/28/2006, Andre van Zuydam wrote:
Hi Everyone

I've made an application that creates little post it windows on the
desktop. Each window has the FormStyle fsStayOnTop property set.

I have a button which I'm using for testing purposes and this creates
the windows.  Notice I have changed the parent window to the desktop
window to stop the forms from disappearing when I minimize my main app.


procedure TfrmMain.Button1Click(Sender: TObject);
var
   frmPostIt : TfrmPostIt;
begin
   frmPostIt := TfrmPostIt.Create (nil);
   frmPostIt.ParentWindow := GetDesktopWindow;
   frmPostIt.lblText.Caption := 'Hello';
   frmPostIt.jvTran.Mask := frmPostIt.JvImage.Picture.Bitmap;
   frmPostIt.jvTran.Active := True;
   frmPostIt.Show;
end;


This is my question :

If I click on a button on the post it form I want it to close the post
it window.  (It is probably an API call or some message that needs to be
sent to windows)  What code could I put in that button click event?

procedure TfrmPostIt.sbCloseClick(Sender: TObject);
begin
{ Your code here  PS Self.Free does not work and I could use
Self.Hide but I don't want this in Memory anymore! }


end;



Thanks in advance for any help submitted!


Andre van Zuydam
Spiceware Software






__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk


Re: Anyone know of a standalone DFM editor?

2006-01-12 Thread Sid Gudes
Thanks to all who replied.  Just wanted to provide some feedback:

1) Skins are a great idea!  Didn't know it's so easy to implement 
them.  Although they don't resolve all the look-and-feel changes we 
need, they do a bunch of them and they also give the end-user the 
ability to change appearance, which is a nice feature.

2) We weren't looking for an end-user form designer, but one that 
could be used by a non-programmer at our offices to redesign forms 
and offload some work from our developers.  Having end-users 
manipulate forms could indeed be dangerous!  However, having 
non-programmers modify forms, which our developers can then review 
before re-integrating the form into our product, would help our workload.

3) Although we don't want to integrate Greatis Form Designer into our 
product (we don't want end-users to be able to modify forms), it 
looks like a component we can use to create our own DFM editor for 
use by our non-programmers, since it appears there is no standalone 
DFM editor out there.

Thanks for everyone's help!



Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk


Anyone know of a standalone DFM editor?

2006-01-08 Thread Sid Gudes
Hi All,

We're looking to do a major overhaul of the look and feel of our 
product.  At the same time, we're developing new features and don't 
want to have our programmers spend time on this.  Several other 
people (non-programmers) at the office could be trained to use the 
IDE's DFM editor and modify existing forms (they are facile with 
other products that allow the visual creation and manipulation of 
objects, such as Photoshop and even Word).

However, we'd like to not use Delphi's IDE to do this, because:

1) It would be really expensive to buy Delphi licenses for the 
non-programmers for this one-time use

2) We want to restrict the properties they can edit to look-and-feel 
properties (e.g. color, font, left, top, height, width) and not 
programmer properties (e.g. enabled, readonly, windowstate).  Of 
course we could tell them what not to modify, but then mistakes can happen.

Does anyone know of a product that will let us do this?  If not, any 
code available to help us build something like this without too much 
trouble?  TIA.



Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


___
Delphi mailing list - Delphi@elists.org
http://www.elists.org/mailman/listinfo/delphi


RE: OT...Wireless networking

2005-12-03 Thread Sid Gudes
 that be
  accomplished
   in
   a peer to peer network between two machines just using an Ethernet to
   Ethernet cable, or an Ethernet to USB?  All the data I had on networking
   is
   also gone of course, and I don't remember what it said about setting a
   system up to do this.  Note, I do NOT want to have to go out and buy
   another
   piece of software, like Norton's PC AnyWhere, just to enable this
  ability
   for a couple of days!
  
   from: Robert Meek at: [EMAIL PROTECTED]
   dba Tangentals Design home of PoBoy
   freeware Windows apps and utilities
   located at: www.TangentalsDesign.com
   Proud to be a moderator for the
   Delphi Programming Lists at: elists.org
  
  
  
   __
   Delphi-Talk mailing list - Delphi-Talk@elists.org
   http://www.elists.org/mailman/listinfo/delphi-talk
 
 
  __
  Delphi-Talk mailing list - Delphi-Talk@elists.org
  http://www.elists.org/mailman/listinfo/delphi-talk
 
  __
  Delphi-Talk mailing list - Delphi-Talk@elists.org
  http://www.elists.org/mailman/listinfo/delphi-talk

__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk

__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk

Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED] 


__
Delphi-Talk mailing list - Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk