Solved

GetModuleFileName Win95 vs NT

Posted on 1997-08-12
3
341 Views
Last Modified: 2013-12-03
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?
0
Comment
Question by:Feldercarb
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
davmarc earned 100 total points
ID: 1403821
Does GetModuleFileName() always returns success?
Are you sure it is not a Unicode problem under Windows NT?
Or, maybe, the path retrieved might be somewhat messed up by NT's sharings and privileges...

Davide Marcato.
0
 

Author Comment

by:Feldercarb
ID: 1403822
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.
0
 
LVL 4

Expert Comment

by:davmarc
ID: 1403823
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now