|
Have you tried SDL[^]?
Saurabh-
|
|
|
|
|
Thanks.
I once looked at SDL documentation and I thought, using SDL is something that I might use to build the entire application, not to add functionality. Am I wrong ?
|
|
|
|
|
I am not sure what you mean by "building an entire application" vs "adding functionality". SDL can be used to play sound. This is from the documentation.
1. Set audio playback of 8-bit and 16-bit audio, mono or stereo, with optional conversion if the format is not supported by the hardware.
2. Audio runs independently in a separate thread, filled via a user callback mechanism.
3. Designed for custom software audio mixers, but the example archive contains a complete audio/music output library.
-Saurabh
|
|
|
|
|
You could also use a 3rd party audio library. I've tinkered with the following two:
http://www.fmod.org/[^]
http://www.un4seen.com/[^]
They are overkill, perhaps, but they'll do what you need them to do.
They are free for non-commercial use. They also have shareware licenses and full commercial licenses.
Good luck!
|
|
|
|
|
In the class CXTFlatCombobox, there's a member function SetBackColor to modify the background color. But how to do the same thing in CXTPControlCombobox? Thanks.
|
|
|
|
|
laoyanwei wrote: CXTPControlCombobox
Ask it at CodeJock Visual C++ / MFC forum[^].
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
From where he got that Class CXTFlatCombobox?
|
|
|
|
|
Regards,
Sandip.
|
|
|
|
|
i know why u r
|
|
|
|
|
Can AnyOne Please post the code 'How to Print DataGrid in Visual C++' Please Reply
Regards,
Rocky
|
|
|
|
|
Hi all,
How can change color of menubar and how can made changes in view of menu.
(like text color,size of text etc)
Please tell me,In which class of SDI applcation this coding is done.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
|
Your link was good he's ThatsMe,I remember him now.
|
|
|
|
|
dear all
i would like to save my data formated 100x3, i need to save it row by row when my program will run. how to program for this function? thanks a lot.
for example: sprintf(buff, "C:\database\%d",mydata), if i want to save a certain file in notepad or excel, how to do it?
gentleguy
|
|
|
|
|
Can you use like this code?
HANDLE handle=CreateFile(_T(""C:\\database\\123.txt"),...)
CFile m_File(handle);
m_File.Write(mydata);
...
...
|
|
|
|
|
i never use such code, can you explain detail thanks a lot. how to use sprintf() function to do this? thanks
gentleguy
|
|
|
|
|
|
So what exactly do you need help with? What code do you have so far? What does your data structure look like?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi All,
I am beginer for Threading program.I did some programs on all the four thread synchronization classes(CCriticalSection,CMutex,CSemaphore, CEvent). Now my question is "What happens if a thread which locks a resource crashes/terminates without unlocking it?"
Thanks in Advance.
|
|
|
|
|
ss431 wrote: "What happens if a thread which locks a resource crashes/terminates without unlocking it?"
That resource will be locked for ever and no other threads can lock it again.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thank you for your reply Raj,
If the resource is locked what we have to do to unlock that locked resource and make it used by other Threads.
If the resource is locked by CMutex object then there is no problem as it will automatically unlocks the locked resource after the thread whick locks it is exited. But what about the situation if we use CCriticalSetion or CSemaphore,as they don't release the resources automatically.
|
|
|
|
|
ss431 wrote: Now my question is "What happens if a thread which locks a resource crashes/terminates without unlocking it?"
Well, it depends what kind of resource it is and what kind of synchronization object you've used to control the access to the resource.
If the resource resides only within your process, you should use a critical section (also known as a fast mutex) to synchronize access to the resource from different threads in the process. If the process crashes, you don't have a problem since the resource is gone as well.
A critical section is not a kernel object and is used to synchronize resources between threads in the same process.
If it's a global resource you cannot use a critical section to control access to it, you have to use a kernel object such as a mutex and give it a name (identity) in order for other processes to use the same mutex when accessing the same resource.
If a process that has locked the global resource with a mutex crashes, the mutex remains locked, preventing other processes from locking it and obviously preventing other processes from using the global resource. This scenario will likely freeze your computer.
Mutexes, semaphores and events are kernel objects and can be used for synchronization of access to global resources between processes.
Critical sections are not kernel objects and can only be used within a single process to synchronize access to process local resources such as queues shared between threads.
Reading tips:
To avoid common pitfalls when starting out with multithreaded programming, read this excellent article[^].
To know how to distinguish between when synchronization can or should be avoided and when it's absolutely necessary, read this article[^].
To know how to use synchronization objects, read this article[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
In addition to Roger's reply...
You should also do everything you can to make sure your threads can't crash...
Handle exceptions, use good error checking, etc
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi everyone,
I encounter a problem when combining 2 workproject together. I am currently using Microsoft Visual C++ 6. I need to combine the 2 workproject which are initially in 2 different workspaces because I have created the projects separately and want to combine them into 1 program.
Here is the scenario:
I open project A and then add project B to it. I set Project A as active project. I create a button in the main dialog box of Project A to open up the main dialog box of Project B but cannot seem to do so.
Apparently it seem to be that the new workspace folder only has the files (.rc, .h, .cpp) of Project A and I am able to see Project B in the workspace due to some linking mechanism (I guess)
May I know how to combine 2 projects and successfully link them?
Rgds
kindaichinisan
|
|
|
|