Solved

GetModuleFileName Win95 vs NT

Posted on 1997-08-12
3
338 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 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

22 Experts available now in Live!

Get 1:1 Help Now