Hi, i've been trying for ages to use functions in the masm32.lib static lib, i've got the masm32.lib file included in my linker options, i've got the function i want to use defined as DWORD __stdcall ArgCL(DWORD, DWORD); but i always get error LNK2001: unresolved external symbol _ArgCL@8, which is odd because i opened the masm32.lib file with IDA and it's defined as _ArgCL@8, am i missing something really important here or is it just not possible?

ta in advance
Posted on 2005-03-25 09:11:57 by Cronus
ok, this is just plain weird+just my luck, it seems that other functions work just fine included the function that superceded ArgCL (GetCL) it's just ArgCL that won't work, it might also be worth mentioning that even when i havn't defined the ArgCL function vc++ brings up the code completion tooltip with the definition ArgCL(DWORD,DWORD), odd me thinks.
Posted on 2005-03-25 09:36:51 by Cronus
Well i figured it out, one of those zen moments, and being that i hate it so much when i read a forum post about something i'm trying to find info on and then realising the solution was never posted i figured i'd share with y'all what was wrong.

Basically, don't trust the masm32 lib help file, it's definitions that masm32 lib's include files no doubt map to are NOT the internal names the object file uses, check the .asm files in \masm32\m32lib\ to see what i mean, for example in the help file you have:

Malloc proc public cb:DWORD

however if you check alloc.asm you can clearly see they actually used:

Alloc proc public cb:DWORD

was pretty much the same thing for ArgCL, it was a lower case l (el) not L, hope this helps somebody out there, peace
Posted on 2005-03-25 10:34:00 by Cronus

Help file = ArgCl proc ArgNum:DWORD, ItemBuffer:DWORD
Include file = ArgCl  PROTO :DWORD,:DWORD  ; GUI mode version
Source file = ArgCl proc ArgNum:DWORD, ItemBuffer:DWORD

Vaguely I remember some years ago fixing a typo for one of the command line argument algos but its something like 3 to 5 years ago. Just check how old the MASM32 lib and help file is you are using.

Posted on 2005-03-25 19:16:37 by hutch--
I'm just curious, why do you want to use ArgCL() instead of familiar int main(int argc, char *argv[])?
Posted on 2005-03-25 22:07:17 by Starless
Hi Cronus,

Here is an example of using the ArgClC function with C

#include <stdio.h>

extern int __stdcall ArgClC(int ArgNum, char *ItemBuffer);

int main()
char buffer[100];
printf("Cmdline param=%s",buffer);
return 0;
Posted on 2005-03-26 06:43:50 by Vortex