Runtime Error 91

The place for threads about TimoSoft ExplorerListView.
Post Reply
fvs

Runtime Error 91

Post by fvs »

Hi!

Hab mir heute die "ExplorerListView" angeguckt, coole Sache!!!

Zum testen hab ich Windows 2000 Pro, per VMWare, wie sich das Steuerelement auf älteren Versionen von Windows verhält.

Soweit auf den ersten Blick gut, jedoch scheitert der Start des Beispiels "Collapsible Groups" mit dem Runtime Fehler:

#91
Objektvariable oder With-Blockvariable nicht festgelegt.

Anschließend hab ich VB auf das Test Windows installiert:

[font=Courier New]With ExLvw.Groups
[highlight=yellow].Add "Group 1", 1[/highlight]
.Add "Group 2", 2
.Add "Group 3", 3
End With[/font]

Hier stoppt das ganze :cry:

Kommentier ich das ganze mit dem hinzufügen der Gruppen aus, stoppt er irgendwann wieder und meint die "uxtheme.dll" sei nicht vorhanden, nun-ja, die gibts ja auch erst ab Windows XP :buck:

[font=Courier New] [highlight=yellow]hTheme = OpenThemeData(Me.hWnd, StrPtr("ExplorerBar"))[/highlight]
If hTheme Then
' assume that all variations have the same size
GetThemePartSize hTheme, Me.hDC, 6, 1, rc, TS_TRUE, expandoSize
CloseThemeData hTheme
End If[/font]

Und auch hier ist der stop. Wenn auch dies auskommentiert wurde, geht alles, nur leider ohne die praktischen Gruppen :(

Kann man das ganze fixen, oder ist das nicht möglich für Windows 2000 (weil ich hab die Gruppen auch erst ab Windows XP gesehn) ;)
[hr]
Translation for visitors not speaking German:
Hi!

Today I've taken a look at "ExplorerListView", great thing!!!

I've used VMWare with Windows 2000 Pro to test how the control behaves on older versions of Windows.

At the first sight it behaves well, but the sample "Collapsible Groups" stops on startup with the runtime error:

#91
Object variable or With block variable not set

Then I installed VB on this system:

[font=Courier New]With ExLvw.Groups
[highlight=yellow].Add "Group 1", 1[/highlight]
.Add "Group 2", 2
.Add "Group 3", 3
End With[/font]

Here the debugger stops :cry:

If I uncomment the insertion of the groups, it stops again and tells me that "uxtheme.dll" wasn't found. Well, this file was introduced with Windows XP :buck:
[font=Courier New] [highlight=yellow]hTheme = OpenThemeData(Me.hWnd, StrPtr("ExplorerBar"))[/highlight]
If hTheme Then
' assume that all variations have the same size
GetThemePartSize hTheme, Me.hDC, 6, 1, rc, TS_TRUE, expandoSize
CloseThemeData hTheme
End If[/font]

Here it stops again. Uncommenting it makes the program run, but the groups are missing. :(

Can you fix this or isn't this possible for Windows 2000? (I've seen groups on Windows XP only)
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Post by TiKu »

Hi,

ja, die Gruppen funktionieren nur mit Version 6.0 (oder höher) der comctl32.dll (steht so auch in der Hilfe). Diese Version gibt es erst ab Windows XP, weshalb das Beispiel unter Windows 2000 nicht funktioniert.
Ich werde die Beispiele dahingehend erweitern, dass sie die Version der comctl32.dll prüfen und ggf. eine Fehlermeldung anzeigen.

Das Beispiel "Collapsible Groups" ist derzeit ohnehin etwas sinnlos. Das Zusammenklappen von Gruppen wird erst von Windows Vista unterstützt. Jedoch funktioniert das Beispiel auch unter Windows Vista nicht, denn klickt man auf den Gruppen-Header wird unter Vista kein Click-Ereignis ausgelöst, welches für das Beispiel nötig ist. Doch damit nicht genug: Auch das LVGS_COLLAPSED-Flag, welches eigentlich die comctl32.dll anweist, die mit diesem Flag markierten Gruppen als zusammengeklappt zu behandeln und darzustellen, scheint von Vista derzeit noch nicht unterstützt zu werden.
Vista's Explorer bietet zwar zusammenklappbare Gruppen, aber ich habe noch nicht herausfinden können wie er das macht. Ich hoffe, die Beta 2 von Vista bringt da etwas Licht ins Dunkel.

TiKu
[hr]
Translation for visitors not speaking German:
Hi,

yes, the groups need version 6.0 (or higher) of comctl32.dll to work (the helpfile doesn't tell you anything different). This version is available for Windows XP and above only, so the sample won't run on Windows 2000.
I'll modify the samples so that they check the version of comctl32.dll and popup an error message if necessary.

The sample "Collapsible Groups" doesn't make much sense anyway. Only Windows Vista supports collapsible groups. But the sample doesn't even work on Windows Vista, because clicking on the group header doesn't raise the Click event on Vista, but the Click event is essential for the sample.
And there's another problem: The LVGS_COLLAPSED flag which tells the comctl32.dll to handle and draw the groups marked with this flag as collapsed, doesn't seem to be supported by current versions of Vista.
Vista's Explorer has collapsible groups, but I was not yet able to find out how it is doing this. I hope Beta 2 of Vista will bring some light into the dark.

TiKu
Last edited by TiKu on 03 Oct 2005, 23:25, edited 1 time in total.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
fvs

Post by fvs »

Hi!

Schade, Schade, mir ging es hauptsächlich um diese Gruppen, wahnsinn's Ding :mrgreen:

Dann mal hoffen, dass das Feature dann in Vista Beta II drin sein wird, aber woher erfährt man denn überhaupt, dass dieses Feature kommen wird und wie man es "ansteuert"?
[hr]
Translation for visitors not speaking German:
Hi!

Sad, sad, basically I was looking for these groups, great thing :mrgreen:

Let's hope this feature will be in Vista Beta II, but where do you know from that this feature is coming and how you use it?
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Post by TiKu »

fvs wrote:Dann mal hoffen, dass das Feature dann in Vista Beta II drin sein wird, aber woher erfährt man denn überhaupt, dass dieses Feature kommen wird und wie man es "ansteuert"?
Nun, es gibt ja das Platform SDK, welches auch die nötigen Header-Dateien (*.h) enthält, um das Win32-API in C/C++-Programmen zu nutzen. Diese Dateien stammen mehr oder weniger direkt aus dem Windows-Quellcode.
Die Datei commctrl.h gehört zum Platform SDK und enthält die ganzen Fensterstile, Fensternachrichten, Flags usw. der Common Controls. Zu den Common Controls gehört das ListView und der Abschnitt für ListView-Fenster enthält u. a. folgendes:

Code: Select all

#define LVGS_NORMAL         0x00000000
#define LVGS_COLLAPSED      0x00000001
#define LVGS_HIDDEN         0x00000002

#define LVGA_HEADER_LEFT    0x00000001
#define LVGA_HEADER_CENTER  0x00000002
#define LVGA_HEADER_RIGHT   0x00000004  // Don't forget to validate exclusivity
#define LVGA_FOOTER_LEFT    0x00000008
#define LVGA_FOOTER_CENTER  0x00000010
#define LVGA_FOOTER_RIGHT   0x00000020  // Don't forget to validate exclusivity
Die bloße Anwesenheit dieser Flags heißt zwar nicht, dass die entsprechenden Features auch implementiert sind, aber sie zeigt, dass die Features zumindest geplant waren, als die entsprechende Version des Platform SDK veröffentlicht wurde (die obigen Flags stehen übrigens da drin, seit es Windows XP gibt).
Wenn man sich nun die Beta 1 von Windows Vista anschaut, fallen einem unweigerlich im Explorer die zusammenklappbaren Gruppen auf. Wir haben also ein Feature und wir haben im Platform SDK namentlich passende Konstanten. Dass die Konstanten etwas mit dem Feature zu tun haben, ist sehr wahrscheinlich. Jetzt muss man nur noch herausfinden wie man die Konstanten nutzt. Das ist relativ einfach, weil eine andere LVGS_*-Konstante (LVGS_NORMAL) bereits ausreichend dokumentiert ist.

Dass LVGS_COLLAPSED bei Vista bisher nicht funktioniert, kann 2 Ursachen haben:
1) Man muss das Feature möglicherweise erst irgendwie aktivieren, bevor man Gruppen als "Collapsed" markieren kann.
2) Der Explorer von Vista nutzt für das Feature derzeit möglicherweise nicht die comctl32.dll, sondern eigenen Code.

Sobald eine Version des Platform SDK erscheint, die auf Windows Vista ausgerichtet ist, werde ich meine Controls fit für Windows Vista machen und sie um die neuen Features erweitern.

TiKu
[hr]
Translation for visitors not speaking German:
fvs wrote:Let's hope this feature will be in Vista Beta II, but where do you know from that this feature is coming and how you use it?
Well, there's the Platform SDK, which also contains the header files (*.h) that are required to use the Win32 API in C/C++ programs. Those files are more or less copied out of the Windows sourcecode.
The file commctrl.h is part of the Platform SDK and contains all those window styles, window messages, flags and so on of the Common Controls. The listview is part of the Common Controls and the section about listviews includes the following lines:

Code: Select all

#define LVGS_NORMAL         0x00000000
#define LVGS_COLLAPSED      0x00000001
#define LVGS_HIDDEN         0x00000002

#define LVGA_HEADER_LEFT    0x00000001
#define LVGA_HEADER_CENTER  0x00000002
#define LVGA_HEADER_RIGHT   0x00000004  // Don't forget to validate exclusivity
#define LVGA_FOOTER_LEFT    0x00000008
#define LVGA_FOOTER_CENTER  0x00000010
#define LVGA_FOOTER_RIGHT   0x00000020  // Don't forget to validate exclusivity
Although the pure existence of those flags doesn't mean that the corresponding features are implemented, but it tells us that they were at least planned when this version of the Platform SDK was published. (BTW, the mentioned flags have been in commctrl.h since Windows XP was released)
Now taking a look at Beta 1 of Windows Vista, you'll recognize the collapsible groups in Explorer. So we have a feature and we have constants in Platform SDK that match by name. It's very likely that the constants have something to do with the feature. Now all we have to do is finding out how to use the constants. This isn't that difficult as another LVGS_* constant (LVGS_NORMAL) is already documented sufficiently.

That LVGS_COLLAPSED is currently not working on Vista, may have 2 reasons:
1) Maybe you have to somehow activate this feature before you can mark groups as collapsed.
2) Maybe Vista's Explorer doesn't use the comctl32.dll for this feature, but own code.

As soon as a version of Platform SDK is released, that targets Windows Vista, I'll make my controls fit for Windows Vista and extend them with the new features.

TiKu
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Post Reply