Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

delphi 7 pro and win98

0 views
Skip to first unread message

Martin

unread,
Sep 15, 2002, 8:10:25 PM9/15/02
to
hi,
im having a small problem with the combobox string list. the problem is
that when i add an entry to the string list via property editor and try and
save i get a general program exception in user.exe module and delphi7
crashes.

if i programatically add in the entries it works fine, but if a add a empty
string (to signify no entry selected for my app) and then select the empty
string entry while my app is running the same general exception message
mentioned above happens.

im running win98 se with 192mb ram and ie6


Raymond Kennington

unread,
Sep 15, 2002, 9:23:21 PM9/15/02
to
Perhaps check for Count = 0.

Raymond Kennington

Martin

unread,
Sep 16, 2002, 1:25:21 AM9/16/02
to
this is the following code

cboFields.Items.Add('');
cboFields.Items.Add('ItemType');
cboFields.Items.Add('Make');

the error occurs when i select the empty string.

"Raymond Kennington" <raym...@chariot.net.au> wrote in message
news:3D853289...@chariot.net.au...

Lawrence Thurman

unread,
Sep 16, 2002, 11:50:04 AM9/16/02
to
Sounds like you have an event that fires when the combobox is selected, and
the value is being used for something. that requires a creation of an
object or is trying to access the string the was selected within the
combobox and/or convert it to something else

I know this is vague, but without all of the code we really can only guess
--
Lawrence "Zen" Thurman
http://www.powerofzen.com
"Martin" <mar...@surefire.com.au> wrote in message
news:3d856b3c$1...@newsgroups.borland.com...

Martin

unread,
Sep 16, 2002, 8:58:21 PM9/16/02
to
there is no other code involved. if on a win98 SE machine with d7 pro
installed and just put a combo box on the form. and then create a event that
is not related to the combobox and put the code below into such as

procedure TForm1.FormCreate;
begin


cboFields.Items.Add('');
cboFields.Items.Add('ItemType');
cboFields.Items.Add('Make');

end;

then run the app and select the first entry in the list. this is the point
where i get the error.

but i am still puzzled about the other problem i have which is if i add
lines to the string list via the property editor and then save that delphi7
crashes with the same error message.

"Lawrence Thurman" <lthu...@columbus.rr.com> wrote in message
news:3d85fd39$1...@newsgroups.borland.com...

Martin

unread,
Sep 17, 2002, 5:33:07 AM9/17/02
to
i have found the problem it is in the function (in StdCtrls.pas Line:2325)
TCustomComboBoxStrings.Get(Index: Integer): string;

which reads:
Len := SendMessage(ComboBox.Handle, CB_GETLBTEXTLEN, Index, 0);
if Len <> CB_ERR then
.....

in order to solve i had to this
Len := SendMessage(ComboBox.Handle, CB_GETLBTEXTLEN, Index, 0);
if (Len <> CB_ERR) and (Len <> 0) then
..


Martin <mar...@surefire.com.au> wrote in message

news:3d86...@newsgroups.borland.com...

Martin

unread,
Sep 17, 2002, 5:38:50 AM9/17/02
to
this change strange as it may be also solved my other problem as well.
hopefully borland might notice this to include in an update pack for delphi
7.

Martin <marty...@iprimus.com.au> wrote in message

Martin

unread,
Sep 17, 2002, 5:48:15 AM9/17/02
to
unfortunately. when i restart my delphi the same error message appears
again. aarrrrgggghhhh!!!!!!!!!!!!!!!!

Martin

unread,
Sep 17, 2002, 8:41:12 AM9/17/02
to
if i include the stdctrls.pas where i have implemented the change, i do not
get the general exception errors that i have been experiencing.

Martin

unread,
Sep 19, 2002, 3:19:18 AM9/19/02
to
after working out how to recompile the vcl70.bpl with my change in it i have
fixed the problem.

"Martin" <mar...@surefire.com.au> wrote in message

news:3d85218f$1...@newsgroups.borland.com...

0 new messages