?
Solved

GetModuleFileName Win95 vs NT

Posted on 1997-08-12
3
Medium Priority
?
347 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
davmarc earned 200 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 Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared 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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

752 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