How to include audio and picture into .exe ( Visual Studio ) [closed] - c++

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
Does anyone know how can I include a picture and a .wav file into my .exe file? ( C++ )
If i run the build PlaySound(TEXT("Audio.wav"), NULL, SND_FILENAME | SND_ASYNC); it will work well, but if a another person opens the .exe where the .wav file is not in the same direction the sound won`t play, how can i include the audio into the .exe?

Firstly, I suggest you could try to add the files to your project as resources, then you could try to use PlaySound function to use them.
I suggest you could refer to the thread:PlaySound works in Visual Studio but not in standalone exe

Related

How to use Resources in c++? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 months ago.
Improve this question
I want to put an exe file in my C++ program, but I don't understand how to do it.
I am using Visual Studio 2019. I know that it can be done through project resources, but I don't know how to work with it.
Create an .rc file to refer to the desired embedded .exe as an RCDATA resource, eg:
MYEXE RCDATA "path\to\file.exe"
Add the .rc file to your project.
The referred .exe file will then be compiled into your final executable.
You can then access the MYEXE resource at runtime using the Win32 FindResource()/LoadResource()/LockResource() functions, or higher-level framework equivalent.

How can I convert a .out file in exe on Debian Linux? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I perfectly know that .exe files are not executable under Linux but I need some files to be converted in .exe. Is there a way?
You can cross-compile your source files with special compilers : they are runnable on one platform, but produce executables for another.

How to extract files from C++ program and then run one from them [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I'm writing updater program in C++, i need extract files from them.
I'm using Microsoft Visual Studio.
What I'd like the achieve:
User runs exe
exe unpacks files
exe runs one of extracted files
Can anyone recommend a good solution?
Thanks!
Extracting resources from a file with C++:
Extract file from resource in Windows module
Self-Extracting Executable C++
http://www.codeproject.com/Articles/4221/Adding-and-extracting-binary-resources
You're writing an updater.
User runs exe
exe unpacks files
exe runs one of extracted files
So your program should:
Download the patch from the server (use a networking library like winsock or something higher-level)
Unzip the archive (depending on the format in question, there should be libraries for that, like zlib)
Move the new files and overwrite the old ones (use win32 or something higher-level like MFC or Qt)

Include files without #include [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
it is possible to include headers files intro visual studio wihtout #include preprocessor ?
I mean, i have a .cpp intro a visual studio project, and i don't want to use #include intro header file or source file. I want to be included automatically.
I mean some Windows header files are included automatically.. Soo i think is possible with files from my project too..
Best regards.
Having some kind of global include files ain't what is recommended in C++ as you can't reason about dependencies anymore. Though it is possible with the Visual Studio compiler by using the /FI command line option.

How to use a filename other than main.cpp for the main() method in a c++ executable [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm using Eclipse IDE but there is a linking error while trying to build the project without a main.cpp file.
I know that what i'm trying to do is possible because the HelloWorld example has its main() method inside HelloWorld.cpp but i can't find what i need to change inside the eclipse IDE project building parameters.
That being said, is there any drawback in having the main() method in a file different than main.cpp in one project?
Thanks
Edit: After a computer reboot the problem never appeared again. I haven't been able to reproduce it since then so it looks like it wasn't a coding problem or conventional configuration issue. The normal behaviour is as described in the marked answer to this question.
Eclipse will check every file in the project for main, but not your entire harddisk. Did you add the file with main to your project?