I read a an old post yesterday where Worrier King was having troubles using COM objects from HLA as done by Ernest Murphy in the masm lib, so I spent some time cleaning up a test program I wrote a while back that loads and displays images using Ernest Murphys bitmapfromfile and bitmapfrompicture functions that I converted into HLA syntax. they are placed in the bitmap.hhf file and I also slapped a namespace onto them (bitmap), also there's a ole32.hhf included, but it only has the ole32 prototypes necessary for this program. you either run the program from commandline 'view c:\test.jpg' or associate (open with..).
one weird thing though, when I use 'open with...' the arg filename starts off with a ' " ' which must then be removed before passing it to OleLoadPicturePath. ahwell...

edit: added the bug info from kain to the source, hlaview.zip is found a few posts down
Posted on 2004-04-10 15:43:09 by BinarySoup
also, here's a small sdl test program that I wrote yesterday to help out a guy on another board that had troubles. it simply opens a sdl window and loads a bmp into it (a pig I once drew for a counterstrike clan :grin: ), also here the sdl.hhf header file just contains the necessary prototypes and structs (opps!, records) needed to run this small program. in order to link it, you need the sdl.lib, which you can find at http://www.libsdl.org/release/SDL-devel-1.2.7-VC6.zip and to run it you need sdl.dll which can be found at http://www.libsdl.org/release/SDL-1.2.7-win32.zip.

ok, hope someone finds this helpful!

kind regards, binarysoup
Posted on 2004-04-10 15:44:24 by BinarySoup

I read a an old post yesterday where Worrier King was having troubles using COM objects from HLA as done by Ernest Murphy in the masm lib, so I spent some time cleaning up a test program I wrote a while back that loads and displays images using Ernest Murphys bitmapfromfile and bitmapfrompicture functions that I converted into HLA syntax. they are placed in the bitmap.hhf file and I also slapped a namespace onto them (bitmap), also there's a ole32.hhf included, but it only has the ole32 prototypes necessary for this program. you either run the program from commandline 'view c:\test.jpg' or associate (open with..).
one weird thing though, when I use 'open with...' the arg filename starts off with a ' " ' which must then be removed before passing it to OleLoadPicturePath. ahwell...


This is related to a bug with HLA standard library args.hhf It will be reapired in the next release of HLA (1.63).

In the meantime, you can use the following attachment of kfuncs.hhf which also includes a correction to str.eq (also taken care of for the next release of HLA), and various other functions.

The ones of importance to you will be:

CmdLine() use instead of args.cmdLn()
aargc use instead of args.c
aargv use instead of args.v

Another note: Windows 98 has a bug when passing command line parameters through drag-drop (and by file association). Windows 98 fails to quote file-names that have white space seperation. This will result is a problem if you click on a file called

"My picture" <- this will be passed as 2 arguments instead of one quoted argument "My Picture"

So you'll have to code in a function to take all the arguments and concatenate them into one filename if you want to maintain compatibility with Win98 (and possibly earlier versions of Windows). This bug is fixed in WinME and over.
Posted on 2004-04-10 20:59:52 by Kain
Oops, forgot to attach the file. Here it is:

Nice work on the SDL. Thanks, it should come in handy. :alright:
Posted on 2004-04-10 21:01:59 by Kain
thanks for the info Kain, I updated the hlaview source with the info you gave me, apparently I did a mistake when deleting the attachment (should have used 'upload new' I guess), and now I couldn't attach to the top post :( so here is the updated hlaview:
Posted on 2004-04-10 22:48:59 by BinarySoup
view.exe doesn't work on Win98se.

I tried loading your "mypig.bmp"

I the commandline, it does nothing.
Through "open with.." in Windows, I get a crash.

Is there some other file that I need to have?
Posted on 2004-04-10 23:53:06 by Kain
:( sorry, I've only tested it on win2k and XP, on which it worked fine. maybe OleLoadPicturePath isn't supported on <winME? it links to ole32.lib and oleaut32.lib, are those present in win98se?

also, as far as I know, OleLoadPicturePath only handles .gif, .jpg and .bmp, although that isn't the problem here. maybe it's something with the path it recieves from win98se, if you have any chance to assemble the program you could perhaps output the filename argument to the console and see what it recieves?

oh, and I forgot to say, when calling it from commandline, you need to supply _FULL_ path, like:

'view c:\pictures\verygoodlookingbabes\bestlookingbabe.jpg' :grin:

btw, did the sdl example work?
Posted on 2004-04-11 00:09:23 by BinarySoup

'view c:\pictures\verygoodlookingbabes\bestlookingbabe.jpg'


Okay, I did this. Now I get crash from the command line too :)


btw, did the sdl example work?


Yes, that works fine, thanks.

I have all the libraries in the Masm32 libs folder, but that shouldn't be a problem to an already compiled file, unless it also needs some dll ? I tried with the sdl dlls but those didn't work either.

I'll take a look at the code later and run it through my debug window to see if it's some Windows compatibility issue. I'm too tired now as I spent some hours polishing up my configuration-file library.
In any case, I can test it on my WinME next week.
Posted on 2004-04-11 03:21:06 by Kain