CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Nov 2009
    Location
    India
    Posts
    10

    LoadLibrary with Short Path & Execute EXE with long path

    Hi,

    I have encountered a very strange situation. I have an MFC EXE developed using VC2008 that simply displays a dialog with a "Show Dialog" button. When I click on "Show Dialog" button, it shows another model dialog that comes from an MFC Extension DLL. The Extension DLL is loaded in EXE in OnInitDialog() by converting the DLL path to short path using GetShortPathName() API.

    Now the EXE is built and deployed on another machine where VC2008 is not installed. The deployment directory is provided with CRT and MFC redistributable DLLs with manifest from VC2008 redist directory. I mean I provide all the dependent DLLs and manifest in the application's folder.

    Now I run the EXE. Then click on "Show Dialog" button; the application hangs.

    But if I load the DLL in EXE's OnInitDialog() with long path (I mean fully qualified path), this situation does not occur.

    ================================================

    I solved the problem by reading following blog:

    http://blog.kalmbach-software.de/200...redist_x86exe/

    But still I am not able to figure it out what is the actual problem?

    Is it because of redistributable?

    Is there a bug in GetShortPathName() API or does this API not work with redistributable?

    Can anyone please show some light?

    Thanks & Regards,
    -Abhay
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured