|
i didn't get what your are trying say. please an you be more specfic.
|
|
|
|
|
I propose that you use DirectSound.
You create a buffer with the specifications of the wave data (sample rate, bits/blocksize, ...), then you lock the buffer, copy the data in, unlock it and then start playback. read the sdk for further information.
Don't try it, just do it!
|
|
|
|
|
Here's what I do in Visual C++ 6.0.
1. Import the .wav file and name it something you'll remember, like IDR_BADBEEP.
2. Add #include "mmsystem.h" to the top of your file.
3. In Project/Settings/Link, add Winmm.lib
4. In the actual code where I want the sound effect to play, add:
PlaySound(MAKEINTRESOURCE(IDR_BADBEEP),GetModuleHandle(NULL),SND_RESOURCE | SND_ASYNC);
This will play the sound effect until the program is shut down, the sound effect is entirely played, or another sound effect is started. It's easy and works.
Dimenser
|
|
|
|
|
suggestion which you have given it support for only .wav file ,but i need to play .raw files at some sampling rate(Fs=8000).plz guide me.
|
|
|
|
|
simple, to play a .wav file in VC++ use
PlaySound(...) function //look for the parameters at www.msdn.com
And dont forget to include the winmm.lib in the project settings.
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
|
|
|
|
|
but i want play this raw with some sampling rate(Fs=8000), i don't thing this would support it.
|
|
|
|
|
Hi!
I have an std::string object;
std::string messages = "MSG Go and have a lunch. MSG Hi how are youMSG are you fine";
In this string i expect there are many messages and each message starts with "MSG" and ends till next "MSG" is found. I want to separate all these messages. How can i do so ??
Imtiaz
|
|
|
|
|
For example (untested...),
std::string::size_type p = messages.find ( "MSG" ) ;
std::string::size_type p2 = std::string::npos ;
while ( p != std::string::npos )
{
p2 = messages.find ( "MSG", p + 1 ) ;
DoMessage ( message.substr ( p, p2 )) ;
p = p2 ;
}
Paul
|
|
|
|
|
Nice method. Thanks!
The below is tested one.
void main()
{
std::string messages = "MSG: Apple. MSG: Banana.";
std::string::size_type p = messages.find ( "MSG" ) ;
std::string::size_type p2 = std::string::npos ;
while ( p != std::string::npos )
{
p2 = messages.find ( "MSG", p + 1 ) ;
string ss = messages.substr ( p, p2 );
cout << ss << endl;
p = p2 ;
}
}
Maxwell Chen
|
|
|
|
|
How to find - which area of Window made "invalid" ?
When else window moves over my CDialog,
I need to find which area is declared as "invalid",
to redraw background of appropiate childs,
but nt All each time.
- in OnEreaseBackground(CDC* pDC)
Thanks.
|
|
|
|
|
GetUpdateRect(..);
might be of some help to you.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
Thanks.
How to set for control another Client area ?
|
|
|
|
|
vgrigor wrote:
How to set for control another Client area ?
I didnt get your question.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
Need to enlarge child window area,
ao hay react according to event on that other area.
|
|
|
|
|
If you have the pointer to the child window or a window handle to that child window then you can use SetWindowRect(...) to resize the window.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
thanks, but it is need to get size to
draw as previously.
But react as bigger thing.
some clipRect function does not that ?
|
|
|
|
|
Sorry i am out of ideas
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
No problem - not all people here have ones.
|
|
|
|
|
GetUpdateRect / GetUpdateRgn , depending on whether you want to deal with the full complexity of a region, or just the rectangle that contains all the invalid parts.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi ALL,
I want to retrive the URL of the currently displayed page for that I am using the following code
in SetSite() function:
<br />
SetSite() <br />
{<br />
CComBSTR bstrURL;<br />
hr = GetSite(IID_IServiceProvider, (void**)&spSrvProv);<br />
<br />
hr = spSrvProv->QueryService(SID_SWebBrowserApp,IID_IWebBrowser2,<br />
(void**)&spWebBrowser);<br />
<br />
if (FAILED(spWebBrowser->get_LocationURL(&bstrURL)))<br />
return false;<br />
}<br />
But the contains of bstrURL is emtpy. where I am making a mistake?
Also want to know when Setsite function is invoked before or After loading the page,
When debugged its my guess that it is called before loading the page,
if this is the case how i can get the URL?
Can anyone please help me.
Thanks in Advance.
AL
|
|
|
|
|
I have one BMP file. i want to load that bmp file into a form. Please tell me the procedure.
Thanks
JP
ALL THINGS ARE POSSIBLE UNTIL THEY ARE PROVED IMPOSSIBLE-AND EVEN THE IMPOSSIBLE MAY ONLY BE SO,AS OF NOW
|
|
|
|
|
In the OnDraw function write codes as follow
CBitmap img;
img.LoadBitmap(IDB_IMG);//IDB_IMG is ID of the resource.
CDC * pMemDC=new CDC;
pMemDC->CreateCompatibleDC(pDC);//pDC pointer to DC of current window
pMemDC->SelectObject(&startImg);
pDC->StretchBlt(0,0,cr.right,cr.bottom,pMemDC,0,0,1024,768,SRCCOPY);
delete pMemDC;
I am a Chinese and my English is very poor,so I wish you correct my mistake.
YangXiaowei(China)
|
|
|
|
|
CString szFilename("path to ur bmp file");
HBITMAP hBmp = (HBITMAP)::LoadImage(NULL,szFilename,
IMAGE_BITMAP,0,0,
LR_LOADFROMFILE|LR_CREATEDIBSECTION);
CBitmap bmp;
bmp.Attach(hBmp);
CClientDC dc(this);
CDC bmDC;
bmDC.CreateCompatibleDC(&dc);
CBitmap *pOldbmp = bmDC.SelectObject(&bmp);
BITMAP bi;
bmp.GetBitmap(&bi);
dc.StretchBlt (0,0,500,500,&bmDC,0,0,bi.bmWidth
,bi.bmHeight,SRCCOPY);
// please see the parameters for StretchBlt() and pass them accordingly
bmDC.SelectObject(pOldbmp);
|
|
|
|
|
how to pass through two level http proxy? or are there any information article about it? thanks
|
|
|
|
|
As the Thread title Suggests I am having a problem taking 2 chars (which make up a byte) from the array and placing it into an Integer Variable all the while allowing it to retain its value. I have books here that Explain Type Conversion, but it does not go into Copius Detail on char to int conversion.
The 2 char values I am trying to take from the array will end up being a HEX Value within the Integer Variable.
I am trying to do 2 things:
1). Convert 2 chars from the array into an Integer HEX Value
2). Convert that New HEX Valued Integer to a Decimal Integer Value.
For the Sake of this thread, I will give an example:
RawPacket[8] = 3
RawPacket[9] = 9
Now this comes from the following Data within the array:
[code]
4840200039 |Array Data
----------
0123456789 |Corresponding Array Position
[/code]
What I want to do is take that 3 and 9, put it together and put 39 into an int variable.
Then take that 39 and convert it into a decimal value which in this case would be 57.
Another Example:
[code]
484020005C |Array Data
----------
0123456789 |Corresponding Array Position
[/code]
What I want to do is take that 5 and C, put it together and put 5C into an int variable.
Then take that 5C and convert it into a decimal value which in this case would be 92.
I have had some algorithms given to me, but none of them worked.
Hopefully someone here can help me if possible.
Thank you
|
|
|
|