|
Look:
HANDLE h=CreateMutex(NULL, FALSE, "q123");
WaitForSingleObject(h, INFINITE);
h is used only in this piece of code - from some MFC dialog based application - with no effect.
Any ideea why?
rechi
|
|
|
|
|
Bogdan Rechi wrote:
Any ideea why?
Yes. From MSDN
The state of a mutex object is signaled when it is not owned by any thread.
that is, since you created it with FALSE (not owning the mutext) it has nothing to wait upon since no one currently owns it. Alas, it returns immediately.
What have happened to the art of reading docs?
|
|
|
|
|
The mutex is in fact a binary semaphore. Owning means working with it in non-signaled state as no other thread to have access to the shared resources.
I've used it before in the same manner and it worked.
And by the way: if what you say is true, how could you gain the ownership to the thread, once it is created with FALSE?
rechi
|
|
|
|
|
Bogdan Rechi wrote:
I've used it before in the same manner and it worked.
If you say so. Then it must be either the global name or something else in your setup that has changed. I mean, since you already have used it, it has got to work. Right?
And by the way: if what you say is true,
It's not me saying this, it's the MSDN documentation. If that's wrong (wouldn't be the first time), we all know what company to blame and also how much use it is complaining to them.
how could you gain the ownership to the thread, once it is created with FALSE?
Ehhh, say again? You haven't created no thread that I've seen, you've created a mutex.
It seems to me there's something you're not telling us here...
|
|
|
|
|
It has to work, of course. I use mutexes in the same application for some modules and it works ok. That's why it seems so strange to me. I begin to question myself on that stuff.
About your last two sentences: you allways have the main thread in every Windows program.
rechi
|
|
|
|
|
Hi,
I'm trying to write a program that will make real time dsp of cd audio songs (something like the winamp dsp plugins that make
surround sound).
1. How can i 'capture' the sound signal before it comes to the sound card?
2. Where can i find tutorials regarding this prob and subject?
tnx
|
|
|
|
|
Eran wrote:
How can i 'capture' the sound signal before it comes to the sound card?
I assume you neither have the source-code nor a plugin-interface to/for the player, in case this would have been a non-issue.
For sounds going "out" from an application and to the soundcard, you can't. Well, at least not without writing a (kernel mode device-) driver to do it. Actually, This is exacly what Microsoft wants to prohibit anyone from doing by "locking down" Windows and make everything "DRM enabled" (i.e. taking over your machine and taking away your rights).
|
|
|
|
|
Well, what about message hook?
Can i use this stuff?
Anyway, It can be done, cuase non Microsoft's programmers did kind of stuff.
How can i make real time dsp of cd audio?
Any idea?
|
|
|
|
|
Well, what about message hook?
For real-time stuff like audio data?! LOL. No, seriously, I don't think this is anything to suggest (especially since IIRC thread switching is done at most every ~10ms, Win95 is even worse at about 250ms).
Anyway, It can be done, cuase non Microsoft's programmers did kind of stuff.
Where? Really, I'd really like to see a plain application that can intercept any other applications wave audio output to any Win32 exposed wave-audio device (not to mention replacing that output with its own modified signal).
How can i make real time dsp of cd audio?
Now you're switching to a completely different matter; real-time modification of sound input.
What direction of stream is it you really want to intercept? Please try to be as specific as you can be.
|
|
|
|
|
files of cda format (*.cda).
I'm not sure but, does the player convert it to wav?
|
|
|
|
|
You just could have told this in a more clear way from the beginning.
You just have to read the plain CDDA wave audio from the CD. Check how e.g. CDRecord's cdda2wav does.
|
|
|
|
|
Sorry.
I'm kinda new to this sh*t...(dsp)
Can u point me to any good tutorial that will give me some more info?
tnx
|
|
|
|
|
I need to remove macro's from excel file.
Does anyone know the excel file format ?
Me
|
|
|
|
|
It's like everything else "Office" based upon OLE storage. Look up StgOpenStorage and go from there.
|
|
|
|
|
...but I'll have to ask anyway
How to I import functions from a dll that don't have name decoration?
If I do a __declspec(dllimport) void __stdcall MyFunc I get something like __imp__MyFunc@4 ,
if I do a extern "C" void __stdcall MyFunc I get C name decoration: _MyFunc@4
and all this results in unresolved external symbols.
The Win32 API does it by I can't get it to work... anyone plz?
Cheers, Marc Click to see my *real* signature
|
|
|
|
|
Look up stdcall (or maybe __stdcall). Basically it's PASCAL calling conventions that Win32 uses. Draw your own conclusions re. the history of Windows (though that its linker initially needed a switch to _obey_ case sensitivity rules might be a hint ).
|
|
|
|
|
|
Originally, I intended to link to the DLL statically (at compile time), but it turned out to be slightly more tricky than I thought, so I had to fall back on a wrapper class that links to it at run-time, as you suggest it.
Cheers, Marc Click to see my *real* signature
|
|
|
|
|
If I do an AddNew in ADO recordset in the middle of the recordset. Where will the record appear, and will it visible to me ?
|
|
|
|
|
At the end of the recordset and it will be visible. Remeber to call Update to save the data after calling AddNew and modifying the new fields, unless you have opened the recordset in a BatchUpdate mode...but I'll let you read baout that.
Have a mess around in VB on this to get a feel, or try a good (and amazingly cheap) book like SQL Sever and ADO Programming from Sybex, which covers SQL, T-SQL and ADO. A really good reference book, and covers these kinds of issues.
|
|
|
|
|
Does anyone know a good little C++ compiler for DOS (not Watcom)?
|
|
|
|
|
Not Watcom you say. How about OpenWatcom (the Open Source version - though the license isn't OSI approved yeat AFAIK)?
If you don't like that idea for some reason, what about djgpp? You can't get a better deal than a GPL compiler.
If you drop the "little" requirement you could probably find MSVC 1.52c (and the "c" is vital) somewhere. Perhaps even MS themselves would sell you a copy.
|
|
|
|
|
The first sentence on the DJGPP site:
<br />
DJGPP is a complete 32-bit C/C++ development system for Intel 80386 (and higher) PCs running DOS. It includes ports of many GNU development utilities. The development tools require a 80386 or newer computer to run, as do the programs they produce. In most cases, the programs it produces can be sold commercially without license or royalties. <br />
Are you sure that DJGPP can make 16-bit DOS executables?
|
|
|
|
|
Ok, ok, you can
Thanks!
|
|
|
|
|
[snipped DJGPP "manifest"]
Are you sure that DJGPP can make 16-bit DOS executables?
No, I'm not. Coming to think of it, perhaps it "only" created 32-bit DOS executables using its own "extender"...
For a more informed answer, perhaps you should head over to this place. Even that it's Open Watcom stuff, I believe many of the participants know quite a lot about DOS programming and therefore what possible compilers are available.
I also think you should have a look at the available searchable newsgroups to see if a similar question hasn't surfaced.
|
|
|
|