Tools Links Login

VB, Assembler & Resource files

VB, Assembler & Resource files by Robert Rayment
(see small update below)
Only those interested in this topic should download these files.
If you have been following some of the VB+assembler progs
I've been putting on PSC you may have noticed that the assembly
part is either in a bin file (com in earlier examples) or in a DLL.
The disadvantage of both these is that they need to be in the same
folder as the prog. This is OK for testing but is a nuisance for an
EXE. Also we're usually talking about small bits of assembler to
beef up parts of VB (Heineken approach). The DLL may be
specific and so is not appropriate to register. Assembled snippets
are often much faster than VB. Also, once you've got over the
red-tape and peculiarities of the particular assembler, its often
_easier_ (this may be a secret so don't tell anyone)
A DLL has a minimum size of 16KB and a bin file 4KB (cluster size).
What this submission shows is how to put your assembler code into a
resource file which gets incorporated into an EXE freeing it from
associations and only taking a few more bytes than the bin file size.
A 32-bit Hex/Long integer/Binary converter is developed to demonstrate
these techniques. The zip file is ~11KB.
UPDATE: it is possible to simplify the load from res by
InCode = LoadResData(101, "CUSTOM")
lpMCode = VarPtr(InCode(0))
avoiding the save to disc. Make sure to delete the line lpMCode = VarPtr(InCode(1))

Original Author: Robert Rayment

Assumptions

Shows use of resource files

Returns

Number conversion

API Declarations

CallWindowsProc

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 84 times

Categories

Visual Basic 6

Attachments

CODE_UPLOAD1277512172000.zip
Posted: 9/3/2020 3:45:00 PM
Size: 13,077 bytes


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.