Home All Groups Group Topic Archive Search About
Author
10 May 2005 9:06 PM
Casey Provance
Okay gurus, here is my problem.  First off, I am aware that VB can only hold
one resource file at a time and that I have the alternative to compile the
resource into a DLL and use the LoadLibrary to get the handle of the file
and get my resources that way.

However, what I have been trying to accomplish is a program used by the end
user to add graphics files to a program, and then dump them into a resource
file for use within a different program.

Now, it's not a problem to create the .rc file and compile a .RES file with
the end users choice of graphics.  However, I have been unable to find a way
to get VB to read an external .RES file...or even know if it's possible to
do.  I've spent a goodly amount of time combing the Platform SDK and have
turned up nothing usabled.

One alternative is instead of compiling a .RES file, to have the program
create a resource DLL, but that does not seem like a viable solution either
because it would mean distributing and manipulating the LINK.EXE file from
VB.

So...with all this in mind, what are my alternatives here?  Can I somehow
get VB to read an external .RES file or find a way to compile a list of
graphic files to a resource DLL via an already compiled program, NOT using
the VB IDE.

Thanks for any input you gentlemen may have.

- Kevin Provance

Author
11 May 2005 2:35 AM
Tom Esh
On Tue, 10 May 2005 17:06:43 -0400, "Casey Provance"
<ca***@tpasoft.com> wrote:

>Okay gurus, here is my problem.  First off, I am aware that VB can only hold
>one resource file at a time and that I have the alternative to compile the
>resource into a DLL and use the LoadLibrary to get the handle of the file
>and get my resources that way.
>
>However, what I have been trying to accomplish is a program used by the end
>user to add graphics files to a program, and then dump them into a resource
>file for use within a different program.
>...

Digging about in the binary res format would ~not~ be my idea of fun,
but this site has some info on it that might be useful:
    http://www.wotsit.org/


-Tom
MVP - Visual Basic
(please post replies to the newsgroup)
Author
11 May 2005 3:44 AM
Casey Provance
Tom -

Thanks for the input.

Me and searching through binary files don't mix.  I think I'm screwed on
this project.

I tinkeredwith the Resource Editing API only to find out it's proprietary to
NT.

I read on one of the MS bloggers pages that Matt Curland had a way to make
them work in 9x.  It's not mentioned in his book as far as I can tell and
searching the web has not turned up anything useful.

I've wasted almost a week on this.  I think I have to admit defeat on this
one.

Thanks for the site tho, I appreciate it.  :)

- Kev


Show quote
"Tom Esh" <tjeshGibber***@suscom.net> wrote in message
news:niq281dhc952t13pf56ns83nj5b8ts1h80@4ax.com...
> On Tue, 10 May 2005 17:06:43 -0400, "Casey Provance"
> <ca***@tpasoft.com> wrote:
>
>>Okay gurus, here is my problem.  First off, I am aware that VB can only
>>hold
>>one resource file at a time and that I have the alternative to compile the
>>resource into a DLL and use the LoadLibrary to get the handle of the file
>>and get my resources that way.
>>
>>However, what I have been trying to accomplish is a program used by the
>>end
>>user to add graphics files to a program, and then dump them into a
>>resource
>>file for use within a different program.
>>...
>
> Digging about in the binary res format would ~not~ be my idea of fun,
> but this site has some info on it that might be useful:
> http://www.wotsit.org/
>
>
> -Tom
> MVP - Visual Basic
> (please post replies to the newsgroup)
Author
11 May 2005 4:11 AM
Tom Esh
On Tue, 10 May 2005 23:44:10 -0400, "Casey Provance"
<ca***@tpasoft.com> wrote:

>Me and searching through binary files don't mix.  I think I'm screwed on
>this project.
>
>I tinkeredwith the Resource Editing API only to find out it's proprietary to
>NT.
>
>I read on one of the MS bloggers pages that Matt Curland had a way to make
>them work in 9x.  It's not mentioned in his book as far as I can tell and
>searching the web has not turned up anything useful.
>
>I've wasted almost a week on this.  I think I have to admit defeat on this
>one.

Yeah, I think Curland did a dll that incorporated the UpdateResource
functionality for Win9x, but I'm not sure it (or the MS resource
editing Api) works with anything but exes anyway. Maybe Reshacker
(handy freeware product) would be useful:
    http://rpi.net.au/~ajohnson/resourcehacker


-Tom
MVP - Visual Basic
(please post replies to the newsgroup)
Author
11 May 2005 5:00 AM
Casey Provance
Tom -

The Resource Editing API will work on DLLs as well.  Pretty much any valid
hModule as far as I can tell.  I did get it to work in its basic form under
XP...but without 9x support for those end users who are happy with that type
of OS, it's no good to them...and I have to try to make everyone happy.  ;-)

I've seen ResHack before...but I'm not sure the chap will be keen on telling
me how he did it, although I may ask anyway.

In the meantime, I am still in search of Curlans's solution.

Thanks again

- Kev


Show quote
"Tom Esh" <tjeshGibber***@suscom.net> wrote in message
news:iq0381hgmakdq50f00ms6f1g7pb9pg5g8c@4ax.com...
> On Tue, 10 May 2005 23:44:10 -0400, "Casey Provance"
> <ca***@tpasoft.com> wrote:
>
>>Me and searching through binary files don't mix.  I think I'm screwed on
>>this project.
>>
>>I tinkeredwith the Resource Editing API only to find out it's proprietary
>>to
>>NT.
>>
>>I read on one of the MS bloggers pages that Matt Curland had a way to make
>>them work in 9x.  It's not mentioned in his book as far as I can tell and
>>searching the web has not turned up anything useful.
>>
>>I've wasted almost a week on this.  I think I have to admit defeat on this
>>one.
>
> Yeah, I think Curland did a dll that incorporated the UpdateResource
> functionality for Win9x, but I'm not sure it (or the MS resource
> editing Api) works with anything but exes anyway. Maybe Reshacker
> (handy freeware product) would be useful:
> http://rpi.net.au/~ajohnson/resourcehacker
>
>
> -Tom
> MVP - Visual Basic
> (please post replies to the newsgroup)
Author
11 May 2005 6:00 AM
Casey Provance
FWIW, the code Curland wrote for ANSI versions of the UpdateResource is part
of the MSUL.

Now the problem because, how to use unicows.dll with VB as all the code is
C++.  I image I will just translate C code as I have been schooled to do.
Show quote
:)
Author
11 May 2005 10:33 AM
Dave
Casey (or is it Kevin?)

If you just want to store user selected binaries, you might find it easier
to store them in a ZIP file (which you can obviously rename to something
other than .ZIP) then  use something along the lines of  InfoZip or XP/2003
built in ZIP support to extract the files as needed.

Another possibility is storing them as BLOBS in a database, but I know zilch
about how to do that.

A third possibilty is to just append all the files together into a single
file, then store the offset and the length of each file within that, it is
then simple to extract the one(s) you need.

In the old DOS days it was easy to make an executable with an area of nulls
and then to overwrite that with user defined data after compilation, but I
suspect attempting to do that with a win32 executable would panic any
anti-virus software running.

Given time and more information about what you're trying to do, I'm sure I
could think of loads of other ways to do this.

Regards
dave.

Show quote
"Casey Provance" <ca***@tpasoft.com> wrote in message
news:uGw8uudVFHA.2128@TK2MSFTNGP14.phx.gbl...
> Tom -
>
> Thanks for the input.
>
> Me and searching through binary files don't mix.  I think I'm screwed on
> this project.
>
> I tinkeredwith the Resource Editing API only to find out it's proprietary
> to NT.
>
> I read on one of the MS bloggers pages that Matt Curland had a way to make
> them work in 9x.  It's not mentioned in his book as far as I can tell and
> searching the web has not turned up anything useful.
>
> I've wasted almost a week on this.  I think I have to admit defeat on this
> one.
>
> Thanks for the site tho, I appreciate it.  :)
>
> - Kev
>
>
> "Tom Esh" <tjeshGibber***@suscom.net> wrote in message
> news:niq281dhc952t13pf56ns83nj5b8ts1h80@4ax.com...
>> On Tue, 10 May 2005 17:06:43 -0400, "Casey Provance"
>> <ca***@tpasoft.com> wrote:
>>
>>>Okay gurus, here is my problem.  First off, I am aware that VB can only
>>>hold
>>>one resource file at a time and that I have the alternative to compile
>>>the
>>>resource into a DLL and use the LoadLibrary to get the handle of the file
>>>and get my resources that way.
>>>
>>>However, what I have been trying to accomplish is a program used by the
>>>end
>>>user to add graphics files to a program, and then dump them into a
>>>resource
>>>file for use within a different program.
>>>...
>>
>> Digging about in the binary res format would ~not~ be my idea of fun,
>> but this site has some info on it that might be useful:
>> http://www.wotsit.org/
>>
>>
>> -Tom
>> MVP - Visual Basic
>> (please post replies to the newsgroup)
>
>
Author
11 May 2005 5:15 AM
J French
On Tue, 10 May 2005 17:06:43 -0400, "Casey Provance"
<ca***@tpasoft.com> wrote:

Show quote
>Okay gurus, here is my problem.  First off, I am aware that VB can only hold
>one resource file at a time and that I have the alternative to compile the
>resource into a DLL and use the LoadLibrary to get the handle of the file
>and get my resources that way.
>
>However, what I have been trying to accomplish is a program used by the end
>user to add graphics files to a program, and then dump them into a resource
>file for use within a different program.
>
>Now, it's not a problem to create the .rc file and compile a .RES file with
>the end users choice of graphics.  However, I have been unable to find a way
>to get VB to read an external .RES file...or even know if it's possible to
>do.  I've spent a goodly amount of time combing the Platform SDK and have
>turned up nothing usabled.
>
>One alternative is instead of compiling a .RES file, to have the program
>create a resource DLL, but that does not seem like a viable solution either
>because it would mean distributing and manipulating the LINK.EXE file from
>VB.

Personally I would append the graphics data to the end of an EXE
- in effect write ones own 'resource' system

There is then the problem of getting Byte Arrays into say a Bitmap
- but Eduarno has a solution for that

AddThis Social Bookmark Button