Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
I was planning on adding it at one point, can't recall at the moment why I stopped the effort since it looks like was a year ago but it's just the prelimary copy of the SDK, it won't compile in MKTYPLIB and modification to avoid VB6 incompatible arguments isn't complete (looks like I stopped half way on line 886). Left the source in for possible inclusion in the future or if someone else was interested.
Last edited by fafalone; Aug 31st, 2018 at 08:36 AM.
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Non-final report: I removed some includes, gave it a new GUID, compiled it, copied it over to SysWOW64, had to re-reference it in VB IDE (probably because of the new GUID), and everything worked just fine. So I did not exclude anything I needed, good. oleexp.tlb is now 989.352 bytes, so roughly 200 KB smaller. Don't know about the inner counts. So far I had no "Out of memory" error, but it's too early to say. Give me some days...
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Update: I now think reducing the size of the typelib did not have such a large effect. The error is coming back even with the smaller typelib.
I currently assume it might have to do with the Undo/Redo cache of the VB6 IDE. When I get the error I can simply close and reopen the IDE and work on for some hours.
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Thanks, but my error is not "Fixed or static data can't be larger than 64K". It's not a compile error at all. It pops while typing or pasting into the IDE, usually when I declare a new variable.
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Hi fafalone.
Can you fix the STGOPTIONS structure definition? Also make StgCreateStorageEx to has the optional parameter.
It should contain the two short fields instead long, and the long one instead ULONG.
Thank you in advance!
Last edited by The trick; Feb 13th, 2019 at 12:47 PM.
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Sure thing. Will finish a couple other things and update this weekend.
Edit: Sorry I haven't updated yet. Forgot what a massive mess of other partially finished things were in the current dev version, was gone for a week, then got wrapped up in something else. Will definitely get it done over the next few days.
Last edited by fafalone; Mar 1st, 2019 at 02:33 AM.
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
It's not defined as PROPVARIANT, it's defined as Variant, which should be used in place of PROPVARIANT, which never works right. Use VB's Variant type then PropVariantToVariant (to another VB Variant); you can use the propvariant API's to change types if needed.
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Well in this particular case, that's how it was defined in the original olelib that this project expanded.
But more generally, VB doesn't support user-defined structures with unions, so you can't define a real PROPVARIANT period, and always having it as a long pointer to a variable has always failed wherever I've tried it. I've even tried specifically defined propvar structs for certain data types, and things still failed every time. After many hours, using a Variant instead is the only way I've ever been able to use functions that require PROPVARIANT, and they've always worked just about perfectly-- because Variant and PROPVARIANT have very similar internal structures.
Last edited by fafalone; Jun 21st, 2019 at 01:19 AM.
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Originally Posted by The trick
Hi fafalone.
Can you fix the STGOPTIONS structure definition? Also make StgCreateStorageEx to has the optional parameter.
It should contain the two short fields instead long, and the long one instead ULONG.
Thank you in advance!
Trick in StgCreateStorageEx how do I declare it to be optional? It's saying 'invalid attribute for this item' no matter how I declare it, despite optional parameters working in interface definitions.
The way the control works is just to enumerate the items and use the system Property Store.
... .. .
Now if you needed the additional information on the individual multi-style fonts (where you'd double click one in the control and then an entry would show up for each), the quickest shortcut would be to check the Folder attribute (siFont.GetAttributes SFGAO_FOLDER, dwAttribs: If (dwAttribs And SFGAO_FOLDER) = SFGAO_FOLDER Then), and then just take siFont and enumerate that in the same way that was done for the font folder... siFont.BindToHandler 0&, BHID_EnumItems, IID_IEnumShellItems, pEnum2
Do While pEnum2.Next(1&, siSubFont, pcl) = S_OK
etc. ... .. .
Thanks a ton to your invaluable "extended" guidance (with sample code lines), I was easily able to obtain the multiple styles for fonts which possess the same. Two points of interest in this regard:
For whatever reason, in the primary 'Fonts' folder screen, Windows (I have Windows 10) does not show the individual file names for fonts with multiple styles. This has been raised as an issue too here (in a Microsoft Windows forum). But, thanks to you, now in my program, additionally, I can show the file names for multiple styles too, in a grid which I have created (to show fonts info, in the same way as shown in the 'Fonts' folder). Note: Even for fonts without multiple styles, for whatever reason, Windows shows all the file names in uppercase, totally. I am showing the same in my grid now, in the exact case in which the path&file names are existing in the system.
As far as I can see, Windows is showing the 'Size' info cumulatively for fonts with multiple styles. For instance, for Arial, it shows it as 4,240 KB (cumulatively, considering all the nine Arial .ttf fonts). But now, in my program, since I am showing the file name for each of the individual styles, I am able to show the file size too for each of the individual font styles.
I was able to give the above-mentioned additional info in my grid only because you took the time to give extended guidance on how to recurse through fonts which have multiple font styles. I remain ever in thankfulness to you. Thank you so... much.
Note: I have been trying to post this message since 24-May-2020 itself (in the originating thread mentioned at the top of this message) but every time I am meeting with errors only - of more than one kind. I am just unable to post. I tried posting through 3 different browsers. So, I am posting this message in this thread itself now, instead of in the thread specified at the very top of this message. Anyway, as such, this is the right thread for me to post this message since I have availed your library only so far and not your ucShellBrowse control. So, hopefully, no issues.
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Glad everything is working out, you're welcome
The control/code here is just pulling data through the same methods that Explorer is; I checked the Fonts folder there and combined sizes and upper case names is how everything is shown in Explorer too, so not too much to be done there besides manually changing it yourself like you're doing.
As always, I'm happy to help and don't hesitate to post if any issues come up
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
hi!
nice work. I am a bit confused, does oleexp.tlb include the interfaces etc. that exist in oleexmpimp.tlb/mimelib.tlb.
also does it include the windows api declarations, structures and constants.
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
oleexpimp.tlb contains slightly different versions of a small number of interfaces. For example, in oleexp.tlb, IEnumIDList.Next is a function that returns a Long, because knowing the return value is important for that call. But VB does not allow you to implement a class that contains functions, only subs, so if you wanted to implement that interface yourself in a class (Implements IEnumIDList), you'd use the version in oleexpimp.tlb instead, because that version is written without any return values. You don't need to include a reference to oleexpimp.tlb unless you specifically need one of these alternate versions for a class module Implements statement.
Only a few API declarations are included, most of which are related to or frequently used by the interfaces. All of that ones that are included are oleexp.tlb.
mimelib.tlb is interfaces specifically for MIME in messages; interfaces mostly starting with IMime____. It's very unlikely you'll need this one, and don't need to reference it.
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Project Updated to Version 4.7
In one of the sample projects, an issue came up where the enum IUN_Flags and NII_Flags had all the same entries, so produced an ambiguous name error. I had not realized such an issue could make it through compiling the TLB, so had not checked. After realizing that was possible, I created a tool that scanned the code for duplicate constants or enum names, and found a number of them. So it was important to get this new version released to avoid bugs like that. But I had also done quite a bit of other work, so there's a bunch of other new stuff in the release too.
Here's the full changelog:
Code:
(oleexp 4.7 - Released 23 Dec 2020)
-Added interfaces IFrameworkInputPaneHandler and IFrameworkInputPane, with coclass FrameworkInputPane.
-Added interface IShellTaskScheduler with coclass ShellTaskScheduler.
-Added interface ISharingConfigurationManager with coclass SharingConfigurationManager.
-Added interface IDefaultFolderMenuInitialize with coclass DefFolderMenu.
-Added interfaces IAccessible, IAccessibleHandler, IAccessibleWindowlessSite, IAccIdentity, IAccPropServer, and IAccPropServices (with coclass CAccPropServices) from oleacc.h, and related consts.
-Added undocumented interface ICustomizeInfoTip
-Added coclass PropertyChangeArray
-CHANGE TO MAJOR OLELIB INTERFACES: IFolderView has been updated to use As Any in a ByRef Long to get objects in .Items and .GetFolder. Also associated SVGIO enum for several members. Changed ByRef Long for interface pointers in IShellView and IShellView2 .GetItemObject, ICategoryProvider .CreateCategory
-IPropertyStore.SetValue and .Commit were already functions, made the rest of the methods into one as well.
-Added a number of error/success consts including OLE_E_, REGDB_E_, STG_E_, and RPC_E_ error codes.
-The wmp.dll dependency has been removed from oleexp.tlb, and placed in its own dependent tlb, oleexpwmp.tlb. The source is in \source\wmp\, which just moves the wmp.inc source file from olelib/oleexp and like mimelib.tlb, it's compiled including oleexp.tlb.
-Bug fix: IItemNameLimits is typically used for Implements, but had out-only parameters making that impossible.
-Bug fix: IUN_Flags and NII_Flags contained duplicate enum values. This caused an error using any of them and you had to specify which to use. The former has been removed. Change any instance of 'IUN_Flags' to 'NII_Flags'. The values themselves are unchanged.
-Bug fix: After the above issue popped up, I created a tool to root out any further duplicates. Unfortunately, there were many, as I had never worried about this under the assumption that a compile error would be triggered for such a situation.
The following were fixed: Two SVSI_Flags enums, one with additional values. Two SVGIO_Flags enums, ditto. Full duplicates of SVUIA_STATUS and SV2GV_Flags. ISCM_FLAGS was not used anywhere, and contained only a single value found in MUTZ_FLAGS. The URLACTION enum contained some duplicate values from URLPOLICIES.
-(oleexpimp) oleexpimp.tlb has been recompiled using oleexp 4.7
-(oleexpimp) Bug fix: This used the IShellFolder definition from olelib2, but VB says that's a bad interface for Implements
-(mWIC) Added WebP and Heif container format UUIDs.
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Thanks again to your efforts to continue the development of this great library!
I'd like to know how you do the conversion of the headers to ODL? All manually? Like to share how it's done? Some others could then support you.
I ask because I did some modifications and enhancements to the library because some of the declarations seem not to work.
(Have you ever used IServiceProvider of oleexpimp.tlb? It always crashes if I implement it. I had to change the code like this to get it working:
As you can see one has to set a pointer to a specific interface (here IExplorerPaneVisibility) instead of a general long pointer to an interface. I found this to be required also for other implemented ServiceProviders.)
Back to the question: I tried to automate the conversion of the MSDN headers using a self developed parser. But it's really hard concerning all the conditional statements an includes. I am now at the state to generate a ODL that then further needs some manual adjustments. But that still is hard work.
My actual target is the Media Foundation API (https://docs.microsoft.com/en-us/win...api/mfobjects/). And especially a replacement for DirectShows Sample Grabber (https://docs.microsoft.com/en-us/win...i/mfreadwrite/) as the new methods are much easier to implement; much less code!
It would be an exceptional addition to oleexp if it included the media foundation interfaces and functions!
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Was it crashing on entry or when you tried to set the pointer to an object? I'm not familiar with IServiceProvider but I've never had an issue with ObjPtr()/vbaObjSetAddRef for a generic object, which pops up fairly often. Though sometimes I've had to implement the function in a standard module with a vtable swap.
But to the question, I do it all mostly manually, just find/replace for common conversions and aliasing data types so not so many of them have to be changed; I use a modern VS to keep a project with all the files, have 2 panes side by side, and have syntax highlighting.(*) As you found, trying to automate it is just too complex to be practical. I've looked at it briefly before, but always just concluded between the time to make a tool and all the manual touching up, it would be quicker to just do it by hand; can do it quite quickly now after so much practice. I've tried to convert every argument using a type that's worked before, but sometimes interfaces have individual quirks that cause issues... like it won't accept a pointer to a GUID so it has to be passed as 4 Longs (why 4 Longs specifically you may ask? Structuring it any other way crashed). And of course sometimes there's just mistakes, it would be way too time consuming to test every single interface in VB when tons of them I'm not even familiar with. I also never went through and checked all the original code from the olelib project this is forked from, which includes ISP.
If you've found and corrected bugs, by all means share and I'll update the project, and credit you for the help. With IServiceProvider here I'd really want to try to find a workaround that didn't result in everyone having to compile their own custom version, so I'll have a look into that.
The Media Foundation API looks great, would love to include it! It does look like a ton of interfaces though; what have you done so far, maybe I can tackle a few of the headers when I get back tonight?
-
* - I do have some code that automates converting to VB... like create IID_IWhatever() UUID functions for mIID.bas or PKEYs for mPKEY/related, or to convert structs to Types in VB code, or to convert enums. But none of it is for automating the C headers to VB6-compatible ODLs.
Last edited by fafalone; Jan 10th, 2021 at 06:50 PM.
If you're interesting here is a small example where you can extract the images from a youtube video frames using Media Foundation API. The example is intended for extracting slides from a video so it analyzes frames and extract the slides and skip animations. For example if you have a video with a slideshow which are animated it should extract the static images:
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Originally Posted by fafalone
Was it crashing on entry or when you tried to set the pointer to an object? I'm not familiar with IServiceProvider but I've never had an issue with ObjPtr()/vbaObjSetAddRef for a generic object, which pops up fairly often. Though sometimes I've had to implement the function in a standard module with a vtable swap.
The sample I've posted is for handling the panes of an explorer browser control. It's somehow complicated: You have to implement IServiceProvider in a class module to hook the GetPaneState calls of IExplorerPaneVisibility, which is also implemented in this class. So the first step ist to tell ExplorerBrowser where to find the IExplorerPaneVisibility interface. The method I found for this is IUnknown_SetSite [oExplBrowser], Me. oExplBrowser then calls the implemented IServiceProvider several times. If the queried IID is the one of IExplorerPaneVisibility I return Set ... = Me as the functions result. It crashes in this case if I use the declaration in oleexpimp. But not with my altered declaration above.
(I have tried this also with a vtable swap but the result was the same.) BTW: I have all the samples from Morcillo; there is no one that uses the implements version of IServiceProvider, so I had to test that myself.
Time to update your sample.
But to the question, I do it all mostly manually, ...
That has been my guess. The most difficult cirumstance to automate the ODL creation for me are the many aliases for types. You have to jump into many includes to find e.g. what the result DBAPI means... finally it's just a DWORD.
If you've found and corrected bugs, by all means share and I'll update the project, and credit you for the help.
No, no, I have not found bugs. Just the issue with IServiceProvider caused me to modify oleexpimp. (Another addition to oleexp are the ActiveScript interfaces that I borrowed and extended from D. Zimmer.)
The Media Foundation API looks great, would love to include it! It does look like a ton of interfaces though; what have you done so far, maybe I can tackle a few of the headers when I get back tonight?
Looks like TheTrick has already done the job! Wow!
Last edited by SaschaT; Jan 13th, 2021 at 06:31 AM.
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Originally Posted by The trick
If you're interesting here is a small example where you can extract the images from a youtube video frames using Media Foundation API. The example is intended for extracting slides from a video so it analyzes frames and extract the slides and skip animations. ...
Incredible! That's what I have dreamed of! A nearly complete type library for the Media Foundation objects!
I am just missing some functions in mfreadwrite like MFCreateSourceReaderFromByteStream and so. But I'll make this up by myself.
The same question to you: How do you manage to create the ODLs?
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Hi, fafalone. Thanks for continue supporting this library.
Originally Posted by fafalone
Code:
Public Function GUIDToString(tg As UUID, Optional bBrack As Boolean = True) As String
'StringFromGUID2 never works, even "working" code from vbaccelerator AND MSDN
Dunno about vbAccelerator, however, this one is working well for me:
Code:
Public Declare Function StringFromGUID2 Lib "ole32.dll" (rguid As UUID, ByVal lpsz As Long, ByVal cchMax As Long) As Long
Private Function GUIDToString(uGuid As UUID)
Dim sGUID$
sGUID = String$(39, 0)
If StringFromGUID2(uGuid, StrPtr(sGUID), Len(sGUID)) > 0 Then
GUIDToString = Left$(sGUID, 38)
End If
End Function
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Originally Posted by fafalone
[CENTER]OLEEXP : Modern Shell Interfaces
Current Version: 4.7 (Released 23 Dec 2020)
Source distributed separately due to attachment size limits.
eleexp47.tlb Registration Failed(Error:8002801c)
where to download 4.6 version?
now it's ok!
it take me more times
need add by me:
Reference=*\G{F9015E81-CAAC-45C0-94E8-42B7DA5D7557}#4.3#0#..\..\Windows\SysWow64\oleexp.tlb#OLEEXP - olelib With Modern Interfaces by fafalone, v4.3
Reference=*\G{F9015E81-CAAC-45C0-94E8-42B7DA5D7557}#4.3e#0#..\..\Windows\SysWow64\oleexp.tlb#OLEEXP - olelib With Modern Interfaces v4.62
Reference=*\G{F9015E81-CAAC-45C0-94E8-42B7DA5D7557}#4.6#0#..\..\Windows\SysWow64\oleexp.tlb#OLEEXP - olelib With Modern Interfaces v4.6
Reference=*\G{F9015E81-CAAC-45C0-94E8-42B7DA5D7558}#4.7#0#C:\Windows\SysWow64\oleexp.tlb#OLEEXP - Modern Shell Interfaces for VB6, v4.7
Last edited by xiaoyao; Mar 24th, 2021 at 11:57 PM.
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
You shouldn't need to register it manually, VB handles that when you load it.
That was a mistake changing the GUID but as long as the path is still right VB will load and use the new one without issue. But you can update the file by going to References, uncheck oleexp, click ok, open References again, and check oleexp again.
Last edited by fafalone; Mar 25th, 2021 at 02:00 AM.
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Originally Posted by fafalone
You shouldn't need to register it manually, VB handles that when you load it.
That was a mistake changing the GUID but as long as the path is still right VB will load and use the new one without issue. But you can update the file by going to References, uncheck oleexp, click ok, open References again, and check oleexp again.
{F9015E81-CAAC-45C0-94E8-42B7DA5D7557}#4.6
{F9015E81-CAAC-45C0-94E8-42B7DA5D7558}#4.7
because ,it's use not same GUID
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Right but it doesn't matter. It's still just an upgrade of the previous version. Just follow the steps I listed in any app that's already using it. Uncheck it in references, close that dialog, open it again, and select oleexp. You don't need to do anything with registration outside VB.
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Excuse my ignorance being new to this with tlbs', but after reading the "requirements" and "installation" paragraphs in post #1 I'm a bit confused. The requirements says:
No other files are required. You do not need to add oleexpimp or mimelib unless you specifically want to use them. All of the addon modules are optional, but mIID is strongly recommended; it saves a ton of time by allowing direct IID_ / FOLDERID_ / etc usage without having to convert a string to a GUID.
Ok
Installing oleexp
oleexp.tlb (and oleexmpimp.tlb/mimelib.tlb if you're using them) should be placed in a permanent, common folder all your projects can access-- typically SysWow64 (or System32 on a 32-bit Windows install).
So how do I deal with the addon modules and where do I put them? As it's .Bas files the natural way seems to be to put them in my project folder and include them in my project, but after looking at some of the sample projects for guidance none seems to take that approach, and placing .bas files into in SysWow64 doesn't seem right to me... Sorry, I'm probably the dumbest person in the forum as no one else seems to talk about it, or you're all here way beyond you first cautious tlb steps and others don't dare to ask such a stupid question you just are supposed to know about! :-)
M$ vs. VB6 = The biggest betrayal and strategic mistake of the century!?
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
ok maybe I get it now. Previously I was just unzipping the sample projects looking for any of these BAS files, but when I now actually loaded a sample project I noticed that it complained about these files missing in the tl_ole parent folder. Still could have been some mentioning of how this is setup rather than have to go by trial and error... so all well and ready to explore further ;-)
M$ vs. VB6 = The biggest betrayal and strategic mistake of the century!?
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Yeah the .tlb is good to keep in the system folder, but for the modules, say all your projects are C:\VB\Project1, C:\VB\Project2, etc, the easiest thing to do (and what sample projects referencing them expect by default, though you can change it), is to have all the addon modules in C:\VB\tl_ole.
You're right though I should make that more clear.
Everyone was new to all this at one point, never feel bad about asking questions, that's what this site is here for
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
WebBrowser1.Navigate App.Path & "\123.svg"
Webbrowser selects the SVG file and right-clicks "Save Picture As" to save it in transparent PNG format. How to use the code to make him save as, it is best not to pop up a window.
The image saved by webbrowser has a white background, how to make it transparent?
You can draw the control in the memory by querying the IViewObject interface of the control
Code:
Private Sub DoSave_Click()
Dim tIv As IViewObject
Dim trc As RECT
trc.Right = 100
trc.Bottom = 100
'USE OLELB.TLB
Set tIv = WebBrowser1.Document
Picture1.Cls
tIv.Draw DVASPECT_CONTENT, 1, ByVal 0, ByVal 0, Picture1.hDC, Picture1.hDC, trc, trc, ByVal 0, ByVal 0
Picture1.Refresh
End Sub
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
Hi fafalone, I have taken the opportunity to optimize all the extra addon bas modules and some functions. Take a look if you wish, and i you feel like it could add value to your project feel free to use it, or reject , totally up to you.
Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb
I found this library recently. Vey impressive.
There is a slight bug in the call back function for pNotify.afChannelVolumes(1) in IAudioEndpointVolumeCallback_OnNotify(pNotify As AUDIO_VOLUME_NOTIFICATION_DATA)
The afChannelVolumes array is limited to channel 0.
I had a quick look at your source code.
Perhaps the typedef structure should be float afChannelVolumes[2]; ?
typedef struct AUDIO_VOLUME_NOTIFICATION_DATA
{
UUID guidEventContext; // Context associated with the originator of the event.
BOOL bMuted;
float fMasterVolume;
UINT nChannels;
float afChannelVolumes[1];
I also found it quite a challange to return callback values to the main form.
After much testing with subclassing and other over-complications..
I overcame the crashes by copying to global values then enabling a 1ms Time control in the main form to process the global variables.
Absolutely no crashing.
I found I could enable callbacks for default speaker and microphone concurrently, with careful programming.
However there appeared to be no way to differentiate the callback data by the device type that originated the callback.
Is there a way?
Does the secret lie in the pnotify.guidEventContext field ?
What is the significance of the 4 parameters?
Or to set up a second callback class with a different identity?