Linking in advapi32.lib and netlib32.lib

Daniel Keep daniel.keep.lists at gmail.com
Tue Apr 18 08:40:48 PDT 2006


# extern(Windows)
# int
# GetUserNameW(
# 	wchar* lpBuffer,
# 	uint* nSize
# )

I'm using XP, so I'm fairly sure GetUserNameW should be there (well,
it's there in advapi32.dll -- dependency walker says so).

John C wrote:
> Daniel Keep wrote:
>> <sigh> Oh never mind.  This code just *doesn't* want to work...  Every
>> time I try to call a function in advapi32, it returns the Win32 error
>> code for "A dynamic link library (DLL) initialization routine failed.".
>>
>> And then, even if I hardcode the user name to my own current user name,
>> it refuses to let me see my own home directory :(
>>
>> Stupid Windows...
> 
> What's the function you're trying to call? And what does your function
> definition look like?
> 
> I just tried GetUserName and it worked.
> 
>>
>> Thanks for the help anyway, John.  Think I'll play with embedding Python
>> for a while instead.  So far I've got it in a simple read-eval loop :P
>>
>>     -- Daniel "hates win32"

-- 

v1sw5+8Yhw5ln4+5pr6OFma8u6+7Lw4Tm6+7l6+7D
a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP    http://hackerkey.com/



More information about the Digitalmars-d mailing list