lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


That was my mistake. The API call itself didn't fail, but the subsequent strrchr() was stopping at the first 0 character which happened immediately due to the set of wchar's returned by the call.

From: "D Burgess" <dburgess@gmail.com>
Reply-To: Lua list <lua@bazar2.conectiva.com.br>
To: "Lua list" <lua@bazar2.conectiva.com.br>
Subject: Re: Lua 5.1 static linkage?
Date: Sun, 23 Apr 2006 08:58:37 +1000

Why is GetModuleFileNameA() failing?

On 4/23/06, Mike Pall <mikelu-0604@mike.de> wrote:
> Hi,
>
> Stuart Scandrett wrote:
> > >Because the Windows API call GetModuleFileName() in setprogdir() is failing
> >
> > Mystery solved on this one. Looks like my project was defaulting to Unicode
> > support (groan) so the string it returned was in wchar's.
>
> Oops. I guess it may be better to use GetModuleFileNameA() in
> setprogdir(). Any objections from the Windows experts?
>
> Bye,
>      Mike
>