|
Prev: c++/c to asm
Next: MASM Expert needed immediately
From: James Daughtry on 24 May 2006 12:02 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 24 May 2006 12:22 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 24 May 2006 13:02 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 24 May 2006 14:52 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 24 May 2006 19:35
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 |