Fooman
asked on
DriveCombo not updating on new disk
Using the TDriveComboBox, i am scanning disks and cataloging the information. Delphi 2, Win95.
Problem is:
When I change the CD-rom, the drive combo box does not update to reflect the new volume label, which i use to identify the CD in my database. The combobox still has the volume label of the previous CD-rom displayed.
I have tried the update and invalidate methods, to no avail.
I would really apreciate a solution to this one.
If it's quite involved, I will require sample code, as i am at a complete loss.
Thanks,
Ash. (Fooman)
Problem is:
When I change the CD-rom, the drive combo box does not update to reflect the new volume label, which i use to identify the CD in my database. The combobox still has the volume label of the previous CD-rom displayed.
I have tried the update and invalidate methods, to no avail.
I would really apreciate a solution to this one.
If it's quite involved, I will require sample code, as i am at a complete loss.
Thanks,
Ash. (Fooman)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ooops...
Add
Result := FALSE;
as the last line of this function, just before the end statement.
function TChangeAwareDriveComboBox. HookWndPro c (var message : TMessage) : BOOLEAN;
Sorry...
The return value from this function indicates to Delphi whether you've handled the message or normal processing should continue. As I didn't set any return value, it would be random what the function returned... Not good.
Regards,
Erik.
Add
Result := FALSE;
as the last line of this function, just before the end statement.
function TChangeAwareDriveComboBox.
Sorry...
The return value from this function indicates to Delphi whether you've handled the message or normal processing should continue. As I didn't set any return value, it would be random what the function returned... Not good.
Regards,
Erik.
ASKER
Fantastic!
Added the Result:= True;
and the component works perfectly.
Thanks for the solution. Points well earned.
Added the Result:= True;
and the component works perfectly.
Thanks for the solution. Points well earned.
ASKER
Sorry for not grading your answer quickly, I had to try it out...
I compiled the code into a component, but when i use it, the app just hangs. no IDE error, just hangs. The window is still grayed, (hasn't initialised?).
As it happens, I have recieved a solution from a ng, just change the textcase property, and it rebuilds it's list! (odd!)
But, if you can explain the hang, i'll certainly award the points, you've earned them.
Also: now my taskbar is only about 10 pixels high, and therefore useless. this happened after recompiling the component lib, but I don't know if it has anything to do with your code. (unlikely).
Thanks for your efforts, and again, if you can explain the error, I will give you the points.
Ash.