From ini to LoadLibrary

This is a discussion on From ini to LoadLibrary within the Windows Programming forums, part of the Platform Specific Boards category; Hey guys. I have created a ini file, inside I have nothing. I want the user to write there which ...

  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    38

    From ini to LoadLibrary

    Hey guys. I have created a ini file, inside I have nothing. I want the user to write there which DLL he would like to load. By default I have a DLL called Medit.dll that loads when the application opens, but I also want to open the dll that the user specified in the ini to load as well. =\ Can you guys help me out of point me somewhere? Thanks

  2. #2
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    You can use LoadLibrary with REadPrivateProfileString

    but what you want to do with the library AFTER you load it?
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  3. #3
    Registered User
    Join Date
    Mar 2007
    Posts
    38
    Thanks, I will try that. I'm trying to do a loader, that will inject the Medit.dll. But I want the user to be able to add another dll to be injected. I got all the code ready, all I need is how to take the dll name that user set in the ini file.

  4. #4
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    GetPrivateProfileString - this is the correct function name for reading strings from ini-file
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  5. #5
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    How are you going to GetProcAddress() the functions in an unknown dll?

    How will you know what paramaters the functions take?
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  6. #6
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    I suppose the replacing dll should export exactly the same interface as the dll it is going to replace...
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  7. #7
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    So the new DLL has the same functions (I assume different functionality), with the same paramaters?

    Why does it have a different name/path then?

    Is it a bogus copy of the original DLL for some neferious / malicious reason?

    If so why are we helping?
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Parsing a INI file
    By Wraithan in forum C++ Programming
    Replies: 6
    Last Post: 10-17-2005, 05:17 AM
  2. Ini File Reading using fscanf()
    By Mr.Modem in forum C Programming
    Replies: 5
    Last Post: 08-13-2005, 12:58 PM
  3. ini files
    By ProjectsProject in forum C Programming
    Replies: 1
    Last Post: 10-18-2004, 03:01 PM
  4. INI Functions
    By Bordonel in forum C Programming
    Replies: 2
    Last Post: 06-19-2002, 04:49 AM
  5. ini file reader/writer
    By cozman in forum Game Programming
    Replies: 7
    Last Post: 06-11-2002, 10:09 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21