GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 01-Jun-2006, 13:32
Bulhakov Bulhakov is offline
New Member
 
Join Date: Jun 2006
Posts: 2
Bulhakov is on a distinguished road

Threads in MFC - can you help a beginner?


I created a simple MFC dialog application with an OpenGL display and a few standard slider controls to manipulate 3D objects.

Now, I am working on adding sound synthesis to this project (I used the popular P.Cook's STK). However, when the sound generation loop runs (sending a few thousand samples directly to the sound port) the whole application must wait for it to finish. I need to be able to influence the sound generation real-time using the slider controls.

I know this can be done using threads, but I am completely new to the subject. The few tutorials I found online have either been over my head, or provided source that did not compile correctly.

Can I put the sound generation loop in a background (worker?) thread in some simple way? Or do I need to rewrite my whole program, putting the user interface in its own thread as well?

Maybe someone can point me to a simple tuorial with good source code examples for using threads in MFC Apps?
  #2  
Old 03-Jun-2006, 15:47
TurboPT's Avatar
TurboPT TurboPT is offline
Regular Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 992
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: Threads in MFC - can you help a beginner?


see if this article at codeproject.com may be helpful:

http://www.codeproject.com/threads/threads_and_mfc.asp

let us know if it does, so that others will have a reference.
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
  #3  
Old 04-Jun-2006, 01:24
Bulhakov Bulhakov is offline
New Member
 
Join Date: Jun 2006
Posts: 2
Bulhakov is on a distinguished road

Re: Threads in MFC - can you help a beginner?


Its a very good article that I've already looked at, but I cannot compile the code that goes with it. Every time I try to compile I get a "Debug Assertion Failed" error message, and running the precompiled examples causes a windows "Illegal action" error to pop up.
 
 

Recent GIDBlogUS Elections and the ?Voter?s Responsibility? by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fibonacci with 'threads' balusss Java Forum 0 19-Mar-2006 04:39
Apache2 config issues monev Apache Web Server Forum 2 28-Jun-2004 07:19
[You Decide] - Do we allow NEW threads with a list of links to resources? JdS GIDForums™ 24 07-Mar-2004 14:19
Latest Search Engines indexing GIDForums threads / posts JdS GIDForums™ 3 22-Apr-2003 00:29

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 15:24.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.