|
Hi,
I have a quick question. (well, hopefully the answer is as quick as my question as I'm sure I'm doing something dumb.)
I have a direct sound application that runs just fine as a windows console app which makes sense because there is nothing else going on.
I'm working on a software synth and have gotten to the point where I grow weary of punching in values to a text file. It's a subtractor synth built from scratch. I now need to support knobs, sliders, etc.. to modify my sounds.
This is where things go downhill.
Waiting on notifications in my console app works just fine, but in the threaded app it waits forever. I know about MsgWaitForMultipleObjects but it just falls through and I dont' update my streaming buffers correctly.
I'm a complete noob at dialog based windows programming so if someone has some example code of waiting for directsound buffer notifications with dialog based apps I'll be very thankful.
If you want source code I don't mind providing it, I just figured if someone had a main loop that they could share with me it would trigger a spark in my mind.
Thanks in advance.
|
|
|
|
|
calducciano wrote: I know about MsgWaitForMultipleObjects but it just falls through
But with what return code? That's what tells you if you a) have a message to process, or b) one of your handles has been signalled!
For something like audio, I'd have thought you'd want a dedicated thread handling the audio, communicating with the UI thread using PostMessage (audio thread -> UI thread) and events? (UI thread -> audio thread). But I could be completely wrong - I've never really looked at DirectSound
BTW - does this CP article help[^] any? It's got a dialog with sliders and it talks about DirectSound
|
|
|
|
|
I build an app that scans a computer for active COM ports. I tryed using CreateFile() but it detects only ports from COM1 to COM9.
How can I detect over COM9?
In VC++6 ... if possible
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
How are you using CreateFile, like this?
HANDLE hPort;
WCHAR wszModName[12] = {0};
wsprintf( wszModName, L"\\\\.\\%s", szPort );
hPort = ::CreateFile(wszModName, GENERIC_READ | GENERIC_WRITE,FILE_SHARE_READ | FILE_SHARE_WRITE,0,OPEN_EXISTING,0,0);
|
|
|
|
|
Q115831 was the right answer. I used the syntax you mentioned. Thanks.
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
RomTibi wrote: How can I detect over COM9?
By reading MSDN article Q115831.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Thanks!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Dammit!
I screwed up the CWinApp class in my copy of "afxwin.h".
(Because I did something dumb.)
I don't have install media, because company policy doesn't allow it.
I can put in a call to get VS reinstalled, but that will take a long time.
Does anybody have a suggestion on how I can restore that file? It's VS 2005.
|
|
|
|
|
Eurosid wrote: I can put in a call to get VS reinstalled, but that will take a long time.
A long time because the folks in IT are not located in the same building as you?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
They aren't even on the same continent any more.
I'm in the US, they're in India. Installs are now
done via Remote Desktop.
It's more efficient that way.
|
|
|
|
|
|
It's seems identical to AfxWin.h from Visual Studio 6.
Thanks for the link, but it doesn't seem to be the right version for 2005.
|
|
|
|
|
Why can't ask one your colleague to send that file to you?
- ns ami -
|
|
|
|
|
I've been struggling with this for a week and a half. Time to ask for help. I have a VC++6.0 / MFC application which "hung-up" when the laptop it was running on suspended operation because of power management. The thing is, I really don't want to loose the data that was entered into the program but not saved. So, I have duplicated the problem on another laptop - all I get is a blank window frame where my program should be. I'm trying to use the Visual Studio debugger to "attach to process" and stop it (break). The call stack shows it's in NTDLL, but I can see my program's code space. How can I find out where my document's data is in memory? Ideally, I'd like to be able to dump it to disk, or even better serialize it. At the very least I'd like to inspect it as a class and manually view member data. Any ideas? Thanks!
|
|
|
|
|
Wouldn't it be easier to just handle the WM_POWER and/or WM_POWERBROADCAST message(s) and save your data accordingly?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
True, but right now the immediate need is to not loose the data from this one instance of the running program. I'll worry about fixing the code later.
Thanks
|
|
|
|
|
I've tried two things, first is a process memory dump called cprocess at http://www.nirsoft.net/utils/cprocess.html[^].
The next is a project here on codeproject at http://www.nirsoft.net/utils/cprocess.html[^].
With a running process, using Mdump from codeproject in the link above, I could use the "find" feature to locate user inputted ascii text in a running process. I've yet to try it in a hung-up process. There's no native dump to file in Mdump, but on its own is useful for locating where in memory text is.
|
|
|
|
|
As you know, within a pe file, there may be a few icons; but the Windows Explorer shows just one of them in order to show the file to the user. Can you tell me please which ICON within a pe file is shown by the Windows Explorer?
Thank you masters!
|
|
|
|
|
Have a look here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thank you. That's why you're a Gold member and I'm NOT.
Thank you masters!
|
|
|
|
|
Hi,
I'm using Visual Studio 2008 and seem to have a problem with the form designer. I'm new to MFC and want to create a project that allows me to use the form designer. I create a new MFC application form and all the code is created. When I build and run this project, there is a basic window with a few components. However, I can only seem to see the code for this application. Is it possible for my to open this in the form designer and manually edit the form in the editor rather than through code?
Thanks
|
|
|
|
|
If you have the Express Edition then no cookie for you: the visual resource editor is not included.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
Thanks for the reply. I have the professional edition but still no luck
|
|
|
|
|
See [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
In VC2005 (and I guess it is similar with VC2008), you have to open the resource editor. On the left side, you have your solution explorer (which is listing all the files from your project). If you look carefully, you should see tabs at the bottom, click on the one called "Ressource View" (or Ctrl + shift + e). There you should be able to browse and edit your resources.
|
|
|
|