Embedded Resources

  • Thread starter Thread starter David Hanson
  • Start date Start date
D

David Hanson

All,

I have a Wav file which i have included into my solution. I am trying to
embed it ad when i look throught they groups they all suggest that I select
the wav file then view the properties then on there there is supposed to be
a Build as Embedded or something,

Problem is when I rick click on the file and look at properties none appear
it's blank.
 
I don't know why it's blank. You should have two sections: Advanced and
Misc.
Under Misc, you just have the File Name and Full Path.
Under Advanced, you have Build Action, Custom Tool, and Custom Tool
NameSpace.
(I'm using VS 2003. VS 2002 may be a bit different. I don't know.)

What you'll need to do is change the Build Action from the default action
which is "Content" to "Embedded Resource".

This is not unique to WAV files or other common resources. You can do it
with a .cs file if you'd like. You should have added the WAV file to the
project the same way that you would have added an existing source code file.
THe available propertie should be the same too.

Once you get the WAV file compiled as a resource. I'd sure be interested to
know if anyone knows how to play it as a resource using the PlaySound API
with SND_RESOURCE as in this example:

PlaySound("MyAssembly.MyResource.wav", hMod, SND_RESOURCE);

Good luck.
Dave
 
I CANNOT GET THE PROPERTIES WINDOW UP!!!!

Getting really annoyed with this! Has anyone else had this problem trying to
embed a resource?
 
That's closer than anything I've seen so far. It will probably do the job in
my case, but I'm still wondering if there's a way to use SND_RESOURCE
instead of SND_MEMORY. It may be a moot point if the same thing is going on
under the hood.

Dave
 
Fixed it! It has something to do with a corrupt solution. It occurs when you
need to start a new solotuion and import files from an older solution.
Something goes funny!
 
Back
Top