Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Loading Resource  (Read 2359 times)

0 Members and 1 Guest are viewing this topic.

Shay9999

  • Newbie
  • *
  • Posts: 24
    • View Profile
Loading Resource
« on: July 22, 2011, 04:22:43 am »
I'm having this issue with a project I'm doing and I'm unsure on how to do it.

When the program is finished, the files and libraries will be loaded from another folder (when they are needed). However, I have little to know knowledge on how to do this and I was wondering if anyone had a clue as to what to do ^_^

This is what I currently have (and what currently does not work):

Code: [Select]
LoadResource("\\system\\sfml-window-2.dll");
LoadResource("\\system\\sfml-window-d-2.dll");


I assume that it's because I'm supposed to use some other line of code with this, but MSDN is just not helpful >_< I need an example >_<.

All help is appreciated ^_^
C++-Trainee
SFML-Trainee

Turbine

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Loading Resource
« Reply #1 on: July 22, 2011, 09:18:32 am »
Would copying those dll's into the executables directory or into "\Windows\System" be sufficient? Or do you like them in a separate directory?

Shay9999

  • Newbie
  • *
  • Posts: 24
    • View Profile
Loading Resource
« Reply #2 on: July 22, 2011, 07:41:35 pm »
I would like them to be in a folder where my program would be:

MyProgram\ProgramFiles\DLLs

So the full link would be something like

C:\Program Files(x86)\MyCompany\MyProgram\ProgramFiles\DLLs
C++-Trainee
SFML-Trainee

Shay9999

  • Newbie
  • *
  • Posts: 24
    • View Profile
Loading Resource
« Reply #3 on: July 22, 2011, 08:18:50 pm »
Actually, it might just be easier (if this is even possible) to put all the .dll files into the .exe file.

is this possible? Is there a way I can take my resources (.dll files, pictures, etc.) and put them into my application?
C++-Trainee
SFML-Trainee

Contadotempo

  • Full Member
  • ***
  • Posts: 167
  • Firelink Shrine
    • View Profile
Loading Resource
« Reply #4 on: July 22, 2011, 08:54:17 pm »
Yes, link to a static compilation of SFML (sfml-system-s.lib for example).
It will result in a bigger .exe file but that's pretty much it.

Don't forget the SFML_STATIC preprocessor in your project proprieties if you're using SFML 2.0.

Shay9999

  • Newbie
  • *
  • Posts: 24
    • View Profile
Loading Resource
« Reply #5 on: July 23, 2011, 03:11:47 am »
Thank you!
C++-Trainee
SFML-Trainee