Link to home
Start Free TrialLog in
Avatar of Feldercarb
Feldercarb

asked on

GetModuleFileName Win95 vs NT

My app calls GetModuleFileName to locate a dll but my betas are
reporting problems under Win NT --- apparently I'm not getting
the full path back. Runs fine under 95; I don't have NT to test
it here.

I use GetModuleFileName to get the full pathname for the directory
of the DLL, and then use that pathname to access data files stored
with the DLL. From the mangled path name reported by the beta
testers, it seems I'm getting a much shorter path name, missing
some of the path components. My buffer size is 1024 and the
path name is much shorter, so this shouldn't be a problem.

Any ideas on Windows NT compatibility differences in
GetModuleFileName vs Windows 95?
ASKER CERTIFIED SOLUTION
Avatar of davmarc
davmarc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Feldercarb
Feldercarb

ASKER

GetModuleFileName's return is not checked, but since *some*
part of the name is being generated, it seems likely to be
returning successfully. It shouldn't fail --- it's finding
its own path!

Unicode-There's no use of Unicode anywhere in this Win95
program. From what I understand, it should run under NT
without any Unicode stuff, since nothing asks for it.
There aren't any funny characters in the path name;
I don't think the observed result is related to what
a Unicode result would look like.

The path shouldn't be affected by permissions stuff when
finding its own name, I'd think.
You are right, Unicode and permissions shouldn't matter in your case.

Can you provide us with some examples of the complete path returned under Win95 and of the incomplete path returned under WinNT?

Davide Marcato.