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

Author Topic: Font will not load from file while injected  (Read 1868 times)

0 Members and 1 Guest are viewing this topic.

The Dab

  • Newbie
  • *
  • Posts: 2
    • View Profile
Font will not load from file while injected
« on: January 05, 2018, 11:37:40 pm »
" font.loadFromFile(filename.ttf); " returns false. The reason is because I am using working in a dynamic link library (DLL) instead of a console application. I put the font file in the project directory as well as in the process directory of the application I am injecting into. I put the exact code in a console application and it worked. I am using visual studio 2017, is there any way I can link it in project properties, or is there a function I am missing?
« Last Edit: January 05, 2018, 11:41:51 pm by The Dab »

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: Font will not load from file while injected
« Reply #1 on: January 05, 2018, 11:51:19 pm »
You should check what is the current working directory at the time of loading the font, it’s not necessarily the directory of your executable.
Want to play movies in your SFML application? Check out sfeMovie!

The Dab

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Font will not load from file while injected
« Reply #2 on: January 05, 2018, 11:56:09 pm »
It is, I right click on the solution name, then "open folder in file explorer", it brings me right to the folder where my font is located.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Want to play movies in your SFML application? Check out sfeMovie!

dabbertorres

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • website/blog
Re: Font will not load from file while injected
« Reply #4 on: January 06, 2018, 11:20:40 pm »
And for reference, Visual Studio's default working directory when executing is the project directory

(the setting is <right-click on project> -> Properties -> Configuration Properties -> Debugging -> Working Directory)