msdnLib2PB - Library Importer

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

msdnLib2PB - Library Importer

Post by chi »

And without any further ado... ;)

Download: (beta 4) msdnLib2PB.zip (407KB)
Image
Last edited by chi on Sat May 30, 2015 9:52 pm, edited 3 times in total.
Et cetera is my worst enemy
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 796
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

Re: msdnLib2PB - Library Importer

Post by Zebuddi123 »

Hi chi very nice! very useful thanks for sharing, I have noticed that some api`s data are not processed (I presume your regexing from the downloaded file) ie comctl32lib.lib where api "ImageList_AddIcon" "CreateToolbar" and others etc, On closer inspection it seems that these are already predefined in APIFunctionListing.txt. if that is the case maybe an already defined symbol/icon added to the listview would be nice, just a thought!.

Also a question why the green highlighting ?

Zebuddi. :D
malleo, caput, bang. Ego, comprehendunt in tempore
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Re: msdnLib2PB - Library Importer

Post by chi »

Hi, glad you like it.

msdnLib2PB (Update Checked/Selected) only recognizes functions that are actually available on msdn. Since there is no site for "CreateToolbar", there is nothing to extract. "ImageList_AddIcon", on the other hand, is a macro (maybe I'll add macros too, need to investigate first).

Red Highlight = There were more than one paragraphs as for the description (it's possible that the actual description is not starting at the beginning)
Green Highlight = Letters count exceeds more than 150 letters
Double clicking a function will either open the url from the "website" column or search the function on msdn.
Et cetera is my worst enemy
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: msdnLib2PB - Library Importer

Post by Danilo »

Awesome work, chi! Many thanks! :)

1.)
I think you could enhance the search result for many Ansi/WideString funtions:
If no result is found for a function and the last character of the function name is uppercase 'W' or 'A',
then remove the last character and search again.
For example, many functions in unicows.lib can't be found because they end with 'W': CharLowerW, ChooseFontW, etc...
Help pages for CharLower and ChooseFont could be found.

2.)
Callbacks or function pointers (Prototypes in PB) are not parsed correctly, for example: RatingObtainQuery function.

Code: Select all

void (*fCallback)( DWORD dwUserData, HRESULT hr, LPCTSTR pszRating, LPVOID lpvRatingDetails)
becomes

Code: Select all

void
Maybe you could enhance that.

3.)
Could you allow to load multiple .lib or a whole directory containing .lib files?
That would allow to import whole WindowsSDK .lib directory (300+ .lib), or at least
a few files at a time.

4.)
I think a "Select All" and "Clear Selection" right-click popup-menu or button would be nice, to control the checkboxes.
User avatar
Bisonte
Addict
Addict
Posts: 1313
Joined: Tue Oct 09, 2007 2:15 am

Re: msdnLib2PB - Library Importer

Post by Bisonte »

Wohow ! ImageImageImage

But I checked the function of this program only after an intensive search....

A little description is needed .... ;)
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Re: msdnLib2PB - Library Importer

Post by chi »

beta 2 is ready to test...

@Danilo: Thanks for the bugreport ;)
  • 1.) fixed
    2.) fixed (with a workaround for APIFunctionListing.txt). Better ideas?
    3.) definitely, but a little bit later...
    4.) added
I changed a lot more, so please don't use the old .xml's from beta 1

@Bisonte: Will do, but also later

@PB-Devs: It would be very nice if we could have dynamic statusbar fields in the IDE out of the box! So that every "separator" from an APIFunctionListing line gets its own field (+auto adj. width?!). Also a clickable weblink or button generated from an URL could be awesome. ;)

cheers, chi
Et cetera is my worst enemy
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Re: msdnLib2PB - Library Importer

Post by chi »

beta 3 is ready to test...
Et cetera is my worst enemy
User avatar
hallodri
Enthusiast
Enthusiast
Posts: 208
Joined: Tue Nov 08, 2005 7:59 am
Location: Germany
Contact:

Re: msdnLib2PB - Library Importer

Post by hallodri »

Hi chi,

your program imports too many functions. One can understand the "glaux.lib".
You have functions that begin with "__imp_" also filter out.

... There will be some improvements to the speed, perhaps by a online cache or read and compare the APIFunctionListing?
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Re: msdnLib2PB - Library Importer

Post by chi »

Hi hallodri,

it seems that glaux.lib is some kind of a special lib. If you open it with 7-zip it differs from any other lib I tested (contains .obj instead of .dll). Since my importer is only looking for "__imp_"-sections right now, it obviously fails on most of the functions. Thanks for pointing that out... Need to rewrite some parts of the Lib-Parser!

Regarding the speed improvements:
There isn't much left to improve ^^. The most time consuming part is searching for the right URL of the function, which, if not found in the first run, triggers up to 3 more search terms (macros, ...). So if the function doesn't exist at all on msdn, it can take ~ 4-5 seconds for nothing :cry:
Et cetera is my worst enemy
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: msdnLib2PB - Library Importer

Post by Danilo »

chi wrote:it seems that glaux.lib is some kind of a special lib. If you open it with 7-zip it differs from any other lib I tested (contains .obj instead of .dll). Since my importer is only looking for "__imp_"-sections right now, it obviously fails on most of the functions. Thanks for pointing that out... Need to rewrite some parts of the Lib-Parser!
Usually .lib contain static .obj with the actual code. There is some special kind of .lib files,
that contain no code objects but only import sections for DLLs.
I doubt that function names contained within .obj files can be found at MSDN, most of the time.
chi wrote:Regarding the speed improvements:
There isn't much left to improve ^^. The most time consuming part is searching for the right URL of the function, which, if not found in the first run, triggers up to 3 more search terms (macros, ...). So if the function doesn't exist at all on msdn, it can take ~ 4-5 seconds for nothing :cry:
Is it fully threaded search / downloading / scanning of pages?

Should be faster with 8+ threads (Quadcore+ with hyperthreading) & pretty good online connection (like 50MBit+).
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: msdnLib2PB - Library Importer

Post by Danilo »

BTW, some small Gadget/StatusbarField size problems with 125% DPI display (could be real problems with 200% DPI, for example MS Surface Pro):

Image

The PayPal button at top right is a little bit pale/colourless in my opinion... but I found and used it, anyway. ;)

PayPal message:
I would really like Multi-.Lib-Loading and the DPI issue changed.
Maybe command-line-arguments like msdnLib2PB.exe -in abc.lib -out abc.xml
What about remembering the window size+position and ListIconGadget column widths, in msdnLib2PB.ini?
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Re: msdnLib2PB - Library Importer

Post by chi »

Danilo wrote:The PayPal button at top right is a little bit pale/colourless in my opinion... but I found and used it, anyway. ;)
Oh wow, thank you very much Danilo! Consider most (if not all) of your requests done ;). Beta 4 will be available in the next couple of days...
Et cetera is my worst enemy
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: msdnLib2PB - Library Importer

Post by Danilo »

chi wrote:Consider most (if not all) of your requests done ;). Beta 4 will be available in the next couple of days...
Thanks chi! Did you think about adding drag&drop to the window, so we can drop .lib (and .xml?) onto the window instead
opening with FileRequester?
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Re: msdnLib2PB - Library Importer

Post by chi »

Soon ^^
Image

Sorry for the delay, got a lot of other things to do right now. But beta 4 should be ready tomorrow (with many changes incl. Drag&Drop).
Et cetera is my worst enemy
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: msdnLib2PB - Library Importer

Post by Danilo »

Looks good, chi! Thanks in advance!
Post Reply