Solved

GetModuleFileName Win95 vs NT

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

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 …
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

756 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