The MASM Forum

General => The Workshop => Topic started by: jj2007 on November 25, 2012, 06:12:29 AM

Title: Lightweight Win32 & COM help
Post by: jj2007 on November 25, 2012, 06:12:29 AM
Hi everybody,

I am working on a little helper for the Win API and COM stuff. Feedback on handling etc would be very welcome.

Usage: extract both files to a folder on your Masm32 drive, then open JNotes.exe

Note that I am not sure about the legal status of the sample database. Maybe abandonware, but... therefore: By clicking on the download link, you oblige yourself to use it only for betatesting, and to delete the database immediately after you are done with testing. All other usual disclaimers apply, too.
Title: Re: Lightweight Win32 & COM help
Post by: CommonTater on November 25, 2012, 06:27:58 AM
Quote from: jj2007 on November 25, 2012, 06:12:29 AM
Hi everybody,

I am working on a little helper for the Win API and COM stuff. Feedback on handling etc would be very welcome.

Usage: extract both files to a folder on your Masm32 drive, then open JNotes.exe

Note that I am not sure about the legal status of the sample database. Maybe abandonware, but... therefore: By clicking on the download link, you oblige yourself to use it only for betatesting, and to delete the database immediately after you are done with testing. All other usual disclaimers apply, too.


First question... what the #$%# is this ~frlocal.exe file it spits out and produces only "error 127" when run?


Title: Re: Lightweight Win32 & COM help
Post by: Vortex on November 25, 2012, 06:38:18 AM
Hi Jochen,

Nice work but you could tell that the application needs internet connection. I discovered it by disabling temporarily my ethernet card.
Title: Re: Lightweight Win32 & COM help
Post by: Vortex on November 25, 2012, 06:43:21 AM
Quote from: CommonTater on November 25, 2012, 06:27:58 AM
Quote from: jj2007 on November 25, 2012, 06:12:29 AM
Hi everybody,

I am working on a little helper for the Win API and COM stuff. Feedback on handling etc would be very welcome.

Usage: extract both files to a folder on your Masm32 drive, then open JNotes.exe

Note that I am not sure about the legal status of the sample database. Maybe abandonware, but... therefore: By clicking on the download link, you oblige yourself to use it only for betatesting, and to delete the database immediately after you are done with testing. All other usual disclaimers apply, too.


First question... what the #$%# is this ~frlocal.exe file it spits out and produces only "error 127" when run?

Hi CommonTater,

I think Jochen's application is downloading a SFX archive to unpack a database.
Title: Re: Lightweight Win32 & COM help
Post by: jj2007 on November 25, 2012, 07:21:14 AM
Quote from: Vortex on November 25, 2012, 06:43:21 AMI think Jochen's application is downloading a SFX archive to unpack a database.

Hi Erol,

You are right, of course. The attachment is 19k, the download 2.8MB, and the final database is 35MB. I am so used to have a permanent Internet connection that I forgot to mention that, sorry ;-)

Re Tater's problem: Good question. It works on my machine, and apparently on Erol's. What the JNotes.exe does is
- give itself a specific window title, "Loading: JNotes"
- launch the SFX
- Setup.exe finds the window
- and sends a WM_COPYDATA message indicating where the extracted file can be retrieved.
That part could be much easier if the SFX could be instructed to extract its content to the current folder, but nope, it has to be something like C:\DOCUME~1\user\IMPOST~1\Temp\freearc132302216\  :( ... therefore the trick with the window title.

But good to know it chokes, thanks Tater :icon14:
Maybe I must increase the timeout value for the Launch command... ::)

A workaround could be to launch JNotes.exe and immediately after the SFX.
Title: Re: Lightweight Win32 & COM help
Post by: CommonTater on November 25, 2012, 07:27:28 AM
Quote from: jj2007 on November 25, 2012, 07:21:14 AM
Re Tater's problem: Good question. It works on my machine, and apparently on Erol's. What the JNotes.exe does is

First thing through my mind when software starts doing stuff that

a) I'm not asked about
and
b) I'm not told about

is one word... "Virus".

Windows programmers should never, ever, even think about doing stuff behind their user's backs!



Title: Re: Lightweight Win32 & COM help
Post by: jj2007 on November 25, 2012, 07:31:03 AM
Quote from: CommonTater on November 25, 2012, 07:27:28 AMWindows programmers should never, ever, even think about doing stuff behind their user's backs!

You are absolutely right, Tater. Pass the message on to Microsoft, Adobe and a few others :t
Title: Re: Lightweight Win32 & COM help
Post by: CommonTater on November 25, 2012, 08:56:22 AM
Quote from: jj2007 on November 25, 2012, 07:31:03 AM
Quote from: CommonTater on November 25, 2012, 07:27:28 AMWindows programmers should never, ever, even think about doing stuff behind their user's backs!

You are absolutely right, Tater. Pass the message on to Microsoft, Adobe and a few others :t

Given that the first thing I do when I install Win7 is disable all their stupid spyware, automatic updates, scheduled tasks, services and just about anything else it doesn't need to boot up... I think they get the message.


Title: Re: Lightweight Win32 & COM help
Post by: jj2007 on November 25, 2012, 10:04:58 AM
Quote from: CommonTater on November 25, 2012, 08:56:22 AMGiven that the first thing I do when I install Win7 is disable all their stupid spyware, automatic updates, scheduled tasks, services and just about anything else it doesn't need to boot up... I think they get the message.

Well done, me too. But still, my byte counter says >50MB in the last three hours, without YouTube & Co ::)

Apologies that I scared you with the little 3MB download - I thought it was obvious that a comprehensive Win32+COM help could not fit into a 20k attachment...

I am still wondering why it didn't work for you. The download succeeded obviously, the extraction should not take more than 4...5 seconds unless it's a really trusty old CPU - and during the extraction the caption of the main window should be already set to Loading: JNotes, which the Setup should find reliably. Did you try the workaround?
Title: Re: Lightweight Win32 & COM help
Post by: CommonTater on November 25, 2012, 11:34:18 AM
Quote from: jj2007 on November 25, 2012, 10:04:58 AM
Well done, me too. But still, my byte counter says >50MB in the last three hours, without YouTube & Co ::)

If you have automatic updates off, disable the BITS service too... Things like uTorrent use it to seed by setting up transfer tasks in the background.  (If you are using uTorrent, also go into advanced settings and disable "Graceful Shutdown".)

Open a console window and type .... bitsadmin /list ... that will tell you if it's in use.

Quote
Apologies that I scared you with the little 3MB download - I thought it was obvious that a comprehensive Win32+COM help could not fit into a 20k attachment...

Yeah, that's why I wanted to look at it... I figured it would ask if I wanted to download the database... didn't expect an exe
file...

QuoteI am still wondering why it didn't work for you.

Windows Defender killed it.

Some of MS's toys are actually useful.


Title: Re: Lightweight Win32 & COM help
Post by: dedndave on November 25, 2012, 11:46:28 AM
i can see why it might get flagged
the main exe has no manifest or version control block
it spawns an exe and downloads a package, then opens it as a chm
malware can be spread in a chm via iframe

however, i trust Jochen, so i let it do it's thing   :P
a lot to take in - i am interested to do some reading   :t
Title: Re: Lightweight Win32 & COM help
Post by: CommonTater on November 25, 2012, 12:07:04 PM
Quote from: dedndave on November 25, 2012, 11:46:28 AM
i can see why it might get flagged
the main exe has no manifest or version control block
it spawns an exe and downloads a package, then opens it as a chm
malware can be spread in a chm via iframe

however, i trust Jochen, so i let it do it's thing   :P
a lot to take in - i am interested to do some reading   :t

Suspended defender... got it to work...
Interesting....

It's the old Win98 SDK if I'm not mistaken...

A complete copy of the original in .hlp format can be downloaded... HERE (http://www.pellesc.de/files/help/setup_Win98SDK.exe)  (INNO Setup file)
Windows 7 users can install a patch to open .hlp files ... HERE (http://www.microsoft.com/en-us/download/details.aspx?id=91)

Just click on GUIDE.HLP and you're off to the races.  If your ide/editor can search hlp files for keywords you can install guide.hlp and do keyword searches on windows api calls... about 80% of the current ones are there. In poide it even works on the F1 key, like regular POIDE help does... very helpful  :biggrin:

If you want the whole anchelada you can download the windows 7 SDK as an ISO ... HERE (http://www.microsoft.com/en-us/download/details.aspx?id=18950)
Title: Re: Lightweight Win32 & COM help
Post by: jj2007 on November 25, 2012, 06:44:33 PM
Quote from: CommonTater on November 25, 2012, 12:07:04 PM
A complete copy of the original in .hlp format can be downloaded... HERE (http://www.pellesc.de/files/help/setup_Win98SDK.exe)  (INNO Setup file)

Looks similar indeed, but (apart from being a 15MB download, instead of only 3 :P) there are subtle differences. Try searching e.g. for seterrorinfo

Most of the older members here in the Forum have the old Win32.hlp (http://www.powerbasic.com/support/downloads/Microsoft%20Tools.htm), too.

But the point is another one: I developed this tool because the *.hlp viewer, while being much more comfortable than the new *.chm viewer, is a clumsy old pig. Too much clicking around to find what you need. With JNotes, type seterrori<tab><cursor down>, and start reading...

And not by accident, the "manual" fits into the search box tooltip  :icon_mrgreen:
Title: Re: Lightweight Win32 & COM help
Post by: CommonTater on November 25, 2012, 07:36:46 PM
Quote from: jj2007 on November 25, 2012, 06:44:33 PM
Looks similar indeed, but (apart from being a 15MB download, instead of only 3

It's a question of completeness... There are lots and lots of partical api references out there.  Far as I know the one I linked to is the only complete one.  (And yes, it was me who put it together in an installer archive)

In any case, since the topic was SDK documentation I just thought I'd toss in a few nice links I new about...
Sorry if that's a problem...
Title: Re: Lightweight Win32 & COM help
Post by: jj2007 on November 25, 2012, 08:49:15 PM
Quote from: CommonTater on November 25, 2012, 07:36:46 PM
It's a question of completeness... There are lots and lots of partical api references out there.  Far as I know the one I linked to is the only complete one.  (And yes, it was me who put it together in an installer archive)
Good job :t
You used FreeArc, too, I suppose? INNO seems to cooperate closely with them.

QuoteIn any case, since the topic was SDK documentation I just thought I'd toss in a few nice links I knew about... Sorry if that's a problem...
Did I say it is a problem? ;-)

Re completeness: Agreed, but for my daily work, I need <1% of what is online or in the bloated SDK pigs, the rest can be done much more efficiently by Google.

But the 1% I need quickly and in a handy format. The current JNotes still needs wildcard search and integration into the IDE, otherwise it is already handier than the *.hlp viewer, let alone *.chm. It has favourites (right-click), and I will add the option that users can add their own stuff (in my case, it will be the MasmBasic help file).
Title: Re: Lightweight Win32 & COM help
Post by: jj2007 on November 25, 2012, 08:57:54 PM
Quote from: dedndave on November 25, 2012, 11:46:28 AM
i can see why it might get flagged
the main exe has no manifest or version control block
All that worked, otherwise Tater would not have see error 127
By the way, MSE doesn't spot anything on my puter ::)

Quoteit spawns an exe and downloads a package, then opens it as a chm
malware can be spread in a chm via iframe
No chm there, it's a plain old RichEdit control.
Title: Re: Lightweight Win32 & COM help
Post by: jj2007 on November 26, 2012, 10:35:38 AM
Here is version 2:
- asks for download
- can handle two search strings
- is prepared for use in IDEs:
    either send a WM_COPYDATA message with s=whatever
    or use MasmBasic to do the job:

include \masm32\MasmBasic\MasmBasic.inc   ; download (http://masm32.com/board/index.php?topic=94.0)
  Init
  ; send a string passed via the commandline:
  SendData "Sdk32OLE - JNotes", Cat$("s="+CL$())
  Exit
end start
Title: Re: Lightweight Win32 & COM help
Post by: Vortex on November 27, 2012, 05:51:57 AM
Hi Jochen,

The new release works fine on my XP Sp3 :t
Title: Re: Lightweight Win32 & COM help
Post by: jj2007 on November 29, 2012, 08:49:49 AM
Quote from: Vortex on November 27, 2012, 05:51:57 AM
Hi Jochen,

The new release works fine on my XP Sp3 :t

Thanks, Erol!

In the meantime, I have fixed a few glitches and added the integration to qEditor's Help menu.
Attached is the new version for use with qEditor. Feedback welcome - the usual disclaimers apply 8)

P.S.: The first zip (xHelpQE2c.zip) is xHelp, the zip below the image is the image itself (don't open that one).