0

I have an application that embedding a resource file using the (FindResource, LoadResource and LockResource) functions. and it works properly ON WINDOWS.

Now I'm moving to Linux and other OS'es, where these functions are not defined! So I wonder if there are equivalents for them or another way to do the resource embedding.

Here is the part of the code that I'm using on windows.

HRSRC hFind, hLoad;
hFind = FindResource(hInstance , MAKEINTRESOURCE(ID_BIN), TEXT("Binary");
hLoad = (HRSRC)LoadResouce(hInstance, hFind);
pData = (char*) LockResource(hLoad);
Rami Sahoori
  • 75
  • 1
  • 7
  • 2
    http://stackoverflow.com/questions/1997172/is-there-a-linux-equivalent-of-windows-resource-files and http://www.linuxjournal.com/content/embedding-file-executable-aka-hello-world-version-5967 (but just using a normal file won´t hurt anyone...) – deviantfan Aug 31 '15 at 16:15
  • Linux doesn't have any notion of resource files, and Windows resource files won't do any good on Linux. What exactly are you trying to achieve? – n. m. could be an AI Aug 31 '15 at 16:15
  • I'm saving a file, and this resource file contains a block of data that should be inserted in the beginning of the saved file(Oh god I wish this is not confusing). – Rami Sahoori Aug 31 '15 at 16:21
  • @RamiSahoori I understood it, don´t worry. But again, why are you against using a separate data file? It´s not just easier, but more flexible (eg. changing without recompiling...).Do you want to have a one-file-program without anything external (like libs)? – deviantfan Aug 31 '15 at 16:27
  • I'm building a DLL for my application, and want just the DLL to appear to the user, that's why I'm using this concept. The key of resource file that it is used at compile time not run time. – Rami Sahoori Sep 01 '15 at 06:53

0 Answers0