From: James Daughtry on
I know I can call a DLL that HLA supports with a .lib file, like when I
write my own DLL or use DLLs that HLA supports, but what about
something like msvcrt.dll that doesn't have a corresponding .lib? Do I
need to make one?

Thanks!

From: hutch-- on
James,

If what you need is a standard Microsoft format import library, you can
use the msvcrt.lib from masm32. You will have to manage the HLA
prototypes yourself. The are in C calling convention which should be
easy enough to do in HLA if you understand the syntax.

Regards,

hutch at movsd dot com

From: Julienne Walker on
James Daughtry wrote:
> I know I can call a DLL that HLA supports with a .lib file, like when I
> write my own DLL or use DLLs that HLA supports, but what about
> something like msvcrt.dll that doesn't have a corresponding .lib? Do I
> need to make one?
>
> Thanks!

You can use LoadLibrary and GetProcAddress to access an arbitrary DLL:

program dll_example;

#include ( "win32.hhf" );

static
msvcrt: dword;
printf: dword;
hello: string := "Hello, world!";

begin dll_example;

// Find the DLL
w.LoadLibrary ( "msvcrt" );
test ( eax, eax );
jz done;
mov ( eax, msvcrt );

// Import a name
w.GetProcAddress ( msvcrt, "printf" );
test ( eax, eax );
jz done;
mov ( eax, printf );

// Use the name
pushd ( hello );
call ( printf );
add ( 4,esp );

// Clean up
w.FreeLibrary ( msvcrt );
done:

end dll_example;

From: santosh on
James Daughtry wrote:
> I know I can call a DLL that HLA supports with a .lib file, like when I
> write my own DLL or use DLLs that HLA supports, but what about
> something like msvcrt.dll that doesn't have a corresponding .lib? Do I
> need to make one?

Anyone correct me if I'm wrong, but what's wrong using one of the
MSVC*.LIB files distributed with Visual C++. The latter is a free
download provided you pay for the bandwidth ;)

From: sevagK on

hutch-- wrote:
> James,
>
> If what you need is a standard Microsoft format import library, you can
> use the msvcrt.lib from masm32. You will have to manage the HLA
> prototypes yourself. The are in C calling convention which should be
> easy enough to do in HLA if you understand the syntax.
>
> Regards,
>
> hutch at movsd dot com

There is also a utility made by Silk Odyssey msm2hla that converts MASM
prototypes from an inc file into HLA hhf format.

-sevag.k
www.geocities.com/kahlinor

 |  Next  |  Last
Pages: 1 2 3
Prev: c++/c to asm
Next: MASM Expert needed immediately