CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 1998
    Location
    USA
    Posts
    7

    EXE name from DLL



    Thanks for your response


    since I know only the name of my DLL. so I retrieved handle to myDLL


    and tried GetModuleFileName(). But that func returned the complete path


    where my DLL was residing.


    Whereas, I was expecting the name of the EXE which loaded my DLL.


    looking forward for your reply



  2. #2
    Join Date
    Apr 1999
    Posts
    3

    Re: EXE name from DLL





    This piece of Code Works For Me


    extern "C" DllExport void __stdcall GetProcessName()

    {

    // TODO: Add your dispatch handler code here



    char * strL;

    strL = new char[100];

    GetModuleFileName(NULL, strL, 100) ;

    AfxMessageBox(strL);



    }

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