|
sndPlaySound( "sounds//alienlaser.wav", SND_ASYNC);
I use that code to play sound, works great but.. if i play the sound and i play another sound
nearly the same time, one of the sounds doesnt play right.. Hope you know what i mean, i was wondoring if i was doing somthing wrong in the code.
Thank you.
|
|
|
|
|
I don't know, but I'd suspect you'd do better with Direct Sound for multiple sounds at once.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
i play the sound and i play another sound nearly the same time
The sndPlaySound(..) will not do that simply because it won't return (Free the Sound Device) until the previous sound is fully played till end. The next sound is only played once the Sound Device is free from playing the one before.
Instead, use MCI stuff or better yet as Christian mentioned, use DirectSound stuff.
Good Luck!
|
|
|
|
|
In developing an MDI application written strictly in C (no MFC or WFC), I've discovered something very disturbing. If you add a resource file (.rc) to your application, you have to be careful of what you name your resources. For example, I tried naming the Cascade item in my Window menu ID_WINDOW_CASCADE. When I compile, I get an error saying that ID_WINDOW_CASCADE is already defined. Looking through my files, I discover that my .rc file is including 'afxres.h', an MFC file!!! What gives? If I comment out the include file, I get a bunch of new errors when I compile.
Are there any issues with including this file? It doesn't look like the file will make my app MFC reliant, but I want to make sure. Anybody have any thoughts?
Thanks in advance.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
Looks like "TN035: Using Multiple Resource Files and Header Files with Visual C++" might be of some help. Afxres.h is including winres.h - a subset of windows.h. If you not referencing afxres.rc in the .rc file, maybe you can get away with replacing afxres with winres. Some of the include stuff is wrapped in #ifdefs, so it looks like VC is just trying to be as flexible as possible with its resource files. Maybe you can just pare the whole thing down if you want to be a purist - depends what the resource editor does to things. Interesting.
|
|
|
|
|
How best to encode ascii files in c++
1. Create as binary?
2. Exclusive or (^) --- how do I do this ??
Thanks
Gerry.
|
|
|
|
|
By 'encode' you mean simple encryption?
I once used XOR to encrypt a simple settings file
so the users couldn't mess it up. To do this,
you XOR the input string before writing it
into the file and XOR it by the same value when
you read it back out. You should open the file
binary.
Daniel
"das leid schlaft in der maschine" -Einstürzende Neubauten
|
|
|
|
|
The best way is to use Base64 Mime encoding
Encoding and decoding base64 Mime routines are available on the web just search for them
cheers
أمير الدهاء
|
|
|
|
|
i just wanted to ask, how one could search some text in a binary file, for example i want to check, if an exefile is packed with UPX and therefore i want to search the file for the String UPX . How can i do this ?
Looking forward to some Answers
Andrea
|
|
|
|
|
in an editor just switch to ascii mode even if the file is binary and do a search ... or figure out the hex string and search in hex mode (ultraedit does this nicely)
in code just load the file into a memory buffer and trundle thru it (the boyer-moore algorithm is a winner for this stuff)
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Hi,
How can I let the user open multiple child frames (with different views)with the same document? When the user changes something in one of the frames, all the frames with the same document should be updated and redrawn too. There should be one main window for each document. Also the data in the document can be displayed differently, depending on the type of frame the user opened. I've noticed that Cakewalk does this.
Thanks a lot!
Erik
|
|
|
|
|
this subject is covered ad infinitum in msdn and other places if you read a little
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Hi.
Does any know how to detect a url entry in internet explorer in client side?
I what to develop a filter (for internet access) for a network that don't have a server ( all machines use as default gateway a router). My idea: develop a filter, runnig in each computer that enable or disable a connection to an url entry by ie5.5. Is this possible? Any sugestions (a server is out of the question )?
THX
|
|
|
|
|
Sounds like a browser helper object (BHO) will work for you. Your object will be notified when the user navigates to a new URL, and you can then do whatever you want. This is really easy to defeat, though; the user can just remove your object from the list of BHOs in the registry.
--Mike--
http://home.inreach.com/mdunn/
This must be Thursday. I never could get the hang of Thursdays...
|
|
|
|
|
I have done a program which runs in system tray for windows session statistics (start-time, end-time, ...) but on shutdown the code to write the time into the logfile is never executed because the program is terminated immediately!
Help!!!
|
|
|
|
|
You can do this, by handling a windows messages: WM_ENDSESSION and/or WM_QUERYENDSESSION.
For details look at the MSDN library
Davorin Perkovic - Pjero
|
|
|
|
|
Is there anyway to prevent another application from injecting hook dlls into my application. I should be able to unload such a dll but since I didn't load it, I dont have the dll handle. Any ideas?
|
|
|
|
|
Hi,
I have created an SDI application. The View of my application has an ::OnCommand handler in order to catch a message from an external engine. At some point in the …::OnCommand handler of my View, I call a Modal dialog which also has an …::OnCommand handler in order to be able to catch the subsequent same-type of messages from the external engine. The Modal Dialog is called and displayed but the subsequent messages from the external engine are still caught by the ..:OnCommand handler of my View and not from the corresponding handler of my Dialog. Is it possible to, somehow, de-activate the handler of the View once the Dialog is displayed, so as the subsequent messages from the engine to be serviced by the …:OnCommand handler of my Dialog?
I thank you in advance and I hope you have a nice day,
Christos P.
|
|
|
|
|
You know how you see some programs where all the text in the edit box scrolls the text automatically and without scroll bars on the side?
How do I do that in an MFC application?
If you can help, Id appreciate it alot!!
Thanks
Ashman
|
|
|
|
|
Tick the box that says autoscroll in the dialog editor, in the properties for the edit control.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
or do you mean like a scrolling credits window thingie?
if so theres a couple here on codeproject in one of the sections (cstatic i think)
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Yeh, where the text goes from the top to the bottom at a set speed like you see in some Nukes, Hacking progs, etc?
What projects are there on Codeproject, can you get an URL for me plz?
Thanks
Ashman
|
|
|
|
|
I'm a junior WTL Programer.
I want to know how to use CList and CArray in my WTL code.
Thanks in advance
|
|
|
|
|
CList and CArray is MFC not STL....
I dunno how to use both MFC and WTL in the same project...
- Anders
|
|
|
|
|
If you really want the STL classes, use list<> and vector<>. As already stated, CList and CArray are MFC.
--Mike--
http://home.inreach.com/mdunn/
This must be Thursday. I never could get the hang of Thursdays...
|
|
|
|