View Issue Details

IDProjectCategoryView StatusLast Update
0001987JEDI VCL04 Feature Requestpublic2004-09-03 06:15
ReporterglchapmanAssigned ToAHUser 
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001987: Add AutoComplete support to JvToolEdit for pre-D7 compilers
DescriptionIt doesn't take much code to enable the AutoComplete features in JvToolEdit with Delphi compilers before D7. I'm attaching a zip file which has a small unit which defines the necessary interfaces, plus a patched JvToolEdit.pas and a diff with JvToolEdit.pas from current CVS. Of course, if you want to add this feature, and if you decide to add a small support unit as I did, you'll also have to patch the relevant packages.
Additional InformationI made a few other changes to JvToolEdit. First, I removed the calls to CoInitialize and CoUninitialize; instead, the uses now references ComObj (I've always assumed that was the right way to make sure CoInitialize was called, but perhaps this can cause subtle problems I don't know about?). Second, I added an except block to TAutoCompleteSource.Clone, since Delphi constructors can raise exceptions (though it actually might be better to skip creating the new object and simply return E_NOTIMPL). Finally, I changed various references to IID_IXXX to just plain IXXX.
TagsNo tags attached.

Activities

2004-07-20 17:30

 

JvToolEdit_AutoComplete.zip (34,173 bytes)

remkobonte

2004-08-02 15:13

developer   ~0004871

Thanks for the elaborate report.

I don't have D6 at home thus won't make the pre-D7 specific changes (can't test).

> I removed the calls to CoInitialize and CoUninitialize; instead, the
> uses now references ComObj

ComObj.pas is quite large. I suspect calling CoInitialize and CoUninitialize multiple times doesn't add overhead, and its use is pretty straight forward; thus I didn't commit that part of your solution.

user72

2004-08-04 06:03

  ~0004923

Addendum:
ComObj only calls CoInitialize automagically when "Application.Initialize" is present in the dpr. I, for one, sometimes remove it because it can cause problems with certain apps and can also wreak havoc with chm help files.

In short, if something relies on CoInitialize, it should be called explicitly.

Remko, I think you can close this report now.

remkobonte

2004-08-04 13:10

developer   ~0004930

> Remko, I think you can close this report now.

The original problem that autocomplete is only supported by D7 and not by D5, D6 still exists.

I don't have D6 at home thus won't make the pre-D7 specific changes (can't test).

obones

2004-08-05 23:19

administrator   ~0004946

Can you outline what those "pre-D7" changes are?
(note: I haven't had a look at the attached file)

remkobonte

2004-08-06 12:31

developer   ~0004950

The only difference AFAICS is that D5&D6 are missing some const & types, there are no code diffs. The consts & types are defined in D7 in ShlObj.pas, such as IAutoComplete, IAutoComplete2 and the ACO_ consts.

The zip file contains a diff log.

glchapman

2004-08-06 13:10

reporter   ~0004951

I got an email indicating that this entry needs my comment. Looking at the CVS, I see a check-in has been made with the comment "Add AutoComplete support to JvToolEdit for pre-D7 compilers" -- but it doesn't appear to do that, since all the {$IFDEF COMPILER7_UP} directives are still in place.

Anyway I redid the patch against the current CVS source. The new zip file contains my patched JvToolEdit.pas, a diff file against current CVS, and ShlAutoComplete.pas, which is a unit containing the definitions missing from pre-D7 ShlObj.

2004-08-06 13:11

 

JvToolEdit_AutoComplete.2.zip (35,563 bytes)

glchapman

2004-08-06 13:12

reporter   ~0004952

I forgot to add that this latest patch leaves CoInitialize/CoUninitialize in place, and does not use ComObj.

AHUser

2004-08-20 14:22

developer   ~0005057

Just a reminder for OBones.

AHUser

2004-09-03 06:15

developer   ~0005156

Added to CVS.

Issue History

Date Modified Username Field Change
2004-07-20 17:30 glchapman New Issue
2004-07-20 17:30 glchapman File Added: JvToolEdit_AutoComplete.zip
2004-08-02 15:13 remkobonte Note Added: 0004871
2004-08-04 06:03 user72 Note Added: 0004923
2004-08-04 13:10 remkobonte Note Added: 0004930
2004-08-05 23:19 obones Note Added: 0004946
2004-08-06 02:22 user72 Status new => feedback
2004-08-06 12:31 remkobonte Note Added: 0004950
2004-08-06 13:10 glchapman Note Added: 0004951
2004-08-06 13:11 glchapman File Added: JvToolEdit_AutoComplete.2.zip
2004-08-06 13:12 glchapman Note Added: 0004952
2004-08-20 14:22 AHUser Note Added: 0005057
2004-09-03 06:15 AHUser Status feedback => resolved
2004-09-03 06:15 AHUser Resolution open => fixed
2004-09-03 06:15 AHUser Assigned To => AHUser
2004-09-03 06:15 AHUser Note Added: 0005156