|
difference of working in debug/release mode is usally because some variables were not initialsed properly before it is used.
If any structure is passed to the api makesure that you zeromemory it.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
This may have to do with timing issues. As the code executes more quickly in release mode, there may not be enough time for the port to receive as many bytes when the call returns.
onwards and upwards...
|
|
|
|
|
can anybody guide me to write c or c++ code to play an raw audio files
thank you
bye
sham
|
|
|
|
|
create a buffer with the characteristics of the raw sound (srate, bits etc) then copy the data in and start playing it.
Don't try it, just do it!
|
|
|
|
|
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
|
|
|
|