Thread: Determine dependant dlls

  1. #1
    Registered User
    Join Date
    Apr 2011

    Determine dependant dlls

    I have a CVI executable that calls functions from a Visual Studio prj that produces a UserDriver.dll.
    I had a problem whereby i copied the UserDriver prj and modified it to generate a UserDriverEngRel.dll. I had not modified the .def file and so the .exe was in fact calling UserDriver.dll functions instead of UserDriverEngRel.dll functions.

    From the CVI .exe i wish to determine which dlls are used by the .exe and display the build date & time and version issue on the UI so the user can verify that these are correct.
    How do i do this?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Apr 2011
    Thanks for the pointer to the utility which looks really useful, i will try it out in anger tomorrow at work. When i put the post on i was ideally looking for some sort of C function that would perhaps return an array of strings listing the dependant dlls?
    Is this possible? or is there a windows type function that would do this?

  4. #4
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Portland, OR
    The depends.exe utility works by walking the import tables recursively, starting with the program executable. There is no built-in Windows function that accomplishes that.

    Even so, that's not the whole story because DLLs can get loaded by a call to LoadLibrary() at runtime. A program might depend on foo.dll even if foo.dll is not imported. The problem has no generic solution.
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Inter-dependant classes
    By Colin_theRobot in forum C++ Programming
    Replies: 8
    Last Post: 04-03-2006, 12:08 PM
  2. Use of DLLs
    By Supar in forum C++ Programming
    Replies: 7
    Last Post: 06-17-2003, 03:25 PM
  3. question from linux board ( not os dependant )
    By crypto in forum C Programming
    Replies: 4
    Last Post: 11-15-2002, 02:09 AM
  4. What does implementation-dependant mean?
    By Gamma in forum C++ Programming
    Replies: 1
    Last Post: 04-19-2002, 06:56 PM
  5. How CProgramming dependant are you :)?
    By Carlos in forum A Brief History of
    Replies: 0
    Last Post: 09-17-2001, 09:16 AM