|
The following steps can be used with Resource Workshop:
1) Resource->New->NewType
2) Type in "ID_SOUND" or "ID_WAVE".
3) If you type yes for creating a resource id make
sure you have access to that symbol. For now
press No.
4) Resource->New and choose "SOUND" resource type.
This will bring up a text editor. Edit the text to
look similar to the syntax mentioned in the
section above.
NOTE: Wave files usually takes a lot of memory which means you might have very large resource files.
Now, let us examine how to access the wave file and play it
from the application. The following code can be used to load
and play the resource.
LPCSTR sound;
hResource = LoadResource( hInst,FindResource( hInst,MAKEINTRESOURCE(ID_SOUND),"SOUND" ) );
sound = ( LPCSTR )LockResource( hResource );
sndPlaySound( sound, SND_MEMORY );
UnlockResource( hResource );
FreeResource( hResource ); In the code above our resource type is "SOUND" and the resource
identifier ID_SOUND. We first use FindResource API function to
find the resource. This function returns a handle to the
resource. This handle is passed to the LoadResource which
returns a handle to a copy of the resource in memory. The
LockResource is next used to get a pointer to the resource. Once
a pointer is available, the latter can be used in a call to the
sndPlaySound() function. The second parameter, SND_MEMORY, is
used to denote that the first parameter is a pointer an in memory
copy of the wave file.
You have to include mmsystem.h header and link to winmm.lib library
wrote:
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
hi all,
how to print in tabular format with 4 col IN A PRINTER LIKE THIS
----------------------------------------------------------------
----------------------------------------------------------------
| | |
----------------------------------------------------------------
| | |
----------------------------------------------------------------
| | |
INSIDE EACH BOX MY TEXT SHOULD BE APPEARED
anyone know plz tell me
-- modified at 8:00 Thursday 15th June, 2006
|
|
|
|
|
That's not very clear. Where do you need to print it ? On the screen ? You can simply use cout and make a tabulation inside your text.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
|
printf("%04.04s%04.04s%04.04s", "a", "ab", "abc");
or
CString cs;
cs.Format("%04.04s%04.04s%04.04s", "a", "ab", "abc");
But take UNICODE into consideration and adjust the code for UNICODE if you need to.
Use minus-sign to right-justify. ("%-04.04s")
|
|
|
|
|
kakan wrote: Use minus-sign to right-justify. ("%-04.04s")
That should be left-justify.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I should have checked that. Sorry.
|
|
|
|
|
GANsJob wrote: how to print in tabular format with 4 col
anyone know plz tell me
You may use C++ IO manipulaters for same.
for e.g. setw(size) sets the width of the stream you are suppose to output on console.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
can anybdy gimme a code snippet for implementing socket arrays...
|
|
|
|
|
shuchigo_jane wrote: can anybdy gimme a code snippet for implementing socket arrays...
Here is the Array
#define SOCKET_COUNT 10<br />
CSocket socArray[SOCKET_COUNT];
Ask the question in details you will get answers in details..
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hi everybody,
I want to disable a list view item. I know that I should use SetItemState method, but I don't know how.
thank you in advance.
|
|
|
|
|
Disabled how? You can set the LVIS_CUT style so icon is grayed, and use custom draw to change the text color to gray.
If you mean disabled as in not selectable, that feature isn't built in to the control.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|
|
Hi Michael,
Thank you so much. That's very kind of you.
I use your articles before and they help me so much. I wish best things in your life.
yours sincerely,
Roozbeh.
|
|
|
|
|
Roozbeh69 wrote: I want to disable a list view item.
Disable or deselect?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,I`m a c++ programer and newely I started to work with vc++.I have met a big problem, in windows Nt,Xp and newer versions of windows non of my programs dont work.but they work perfectly in win98 win Me and Dos os.So if it is possible, let us know about the classes and objectes in Vc++ that controls the hardware in windows.thanks
|
|
|
|
|
If u can post a code sample that is not working ,we can help you in fixing the problem.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
i think he needs to general information
whitesky
|
|
|
|
|
|
You are dealing with a security problem. I say this because you are talking about accessing the hardware and I assume that you mean directly. If you want to access the hardware then you need to call a driver to do it for you. On systems like Win2000 and XP you can not access the hardware directly (even in assembly) without it getting upset with you. It does not matter whether or not you are using VC++ or not, it is an OS thing. There is a public domain diver out there some where that will allow you to access hardware ports directly, I used it a couple of years ago and forget its name (so keep looking).
If you post a small example of the problem (in code) or explane what exactly you are trying to do, then someone here will probably be able to help you.
Good Luck,
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
I have two questions.
1. How do I use ShellExecute inside my MFC program to register an activex control, say MyControl.ocx located at D:\MyFolder?
2. I do not want it to be in the hard disk, but would like to include the activex control within my program as a resource and then I want to register it. I imported it as a resource. How can I proceed?
Regards,
Aljechin Alexander
|
|
|
|
|
|
NiceNaiduUse DllRegisterServer
Exactly how is this of any help outside of the ActiveX file?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
1) u can use ShellExecute(NULL, NULL, "regsvr32.exe", <path to="" ocx="">, NULL, SW_HIDE);
2) you cant keep an ocx in the resourse and use it if you are doing static linking. if u are doing only dynamic lnking then, one thing you can do is to store the binaries from reourse into the harddisk and register from there.
cheers..milton kb
|
|
|
|
|
|
Aljechin wrote:
1. How do I use ShellExecute inside my MFC program to register an activex control, say MyControl.ocx located at D:\MyFolder?
While you can use ShellExecute() or CreateProcess() for this, you could also use LoadLibrary() and GetProcAddress() to call the exported DllRegisterServer() function.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|