|
the callback is guaranteed to be executed on that thread
Wow, that's quite impressive requirement. What should happen if that thread is busy? Seems that you'll need some cooperation from the thread you want your callback to be executed on - for example, waiting for Win32 event when there's no work to do. When the event is in signaled state, thread picks up callback address from the queue and jumps into it.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
The idea is that it's on a timer, so it happens whenever the thread gets around to handling the message. (I'm not trying to do something like QueueUserAPC() without expecting the thread to be in a waitable state!) This requires that all threads using the queue have a message pump, but that will always be the case for this application.
If you do away with encapsulation and let a WndProc on each thread know about the queue, and have the queue store a handle to a window on each thread, than it would just be a matter of posting a message to the window once the timer has elapsed.
If MSDN didn't explicitly disallow it I could pass an HWND who's message pump lives on another thread to SetTimer() with the expectation that it would post a WM_TIMER message to that window after the timeout. If params I sent to SetTimer() included a callback then it could call the callback without having to handle WM_TIMER in each WndProc.
--CoolDev
|
|
|
|
|
I think you should use PostThreadMessage and place the call to message handling code inside the thread's message loop, since messages posted with PostThreadMessage have hwnd == NULL.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi.. Just wanna ask???
How do u determine how long a sound or a video file is played? Is there some form of command that VC++ has that would allow me to input a file name and it automatically gives me an approximate playing time of the sound or video file?
Thanks in advance....
|
|
|
|
|
You can do it through DirectShow. There is one interface (sorry I can't remember the name at this time, but you can find it very easily in the DirectX SDK documentation) that you can query through the IFilterGraph interface, and use the methods to get the time of the media file.
|
|
|
|
|
Cool - I was hoping someone would answer this question. Looks like my weekend has been plotted out - I am working on a database for media files and this was my next problem.
Thanks
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I would like to use the CMyTabCtrl class for Tabs. I put a tab control on my dialog and implemented the code. The problem is that the buttons I have put on the tab have local message maps. I would like for them to call functions on my main dialog. I can not get the handle so that I can call class functions there. Help?
|
|
|
|
|
Sample function:
CMyTabCtrl::MyFunction()
{
CMyDialog *pDlg = (CMyDialog*)GetParent();
pDlg->TheOtherFunction();
...
}
Do that only if the dialog is the parent window and it is of class CMyDialog.
Cheers,
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Duh! This is what I get for not doing any windows programming for about a year. will not let that happen again. I think my problem was that I was casting as a CDialog instead of the derived class that includes all of my functions. Thanks Paolo.
Sometimes to catch mice, you have to act like cheese...
|
|
|
|
|
Sometimes when I edit a resource in a project and then do a build it doesn't seem to recompile the resources. I'm using some includes and defines to conditionally include external resources files. Is there a way to setup a VC project so that compliling the main rc file will depend on these external files?
|
|
|
|
|
When you open the properties for your .rc, what's displayed at 'Dependencies' tab? Are these external files listed there?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
There are some externaly listed .rc files yes. And those external .rc files also contain links to files such as .ico, .bmp, and .txt which are compiled as resources.
|
|
|
|
|
Any chance of adding references of these .ico, .bmp and other files to your project?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I am developing an ISAPI extension in C++. My project uses many HTML forms with text input boxes. When the forms are submitted (using "GET") I am parsing the values from the browser URL. This works nicely but the strings have escape characters (+ instead of space etc).
Is there a better way to process the form information so that there are no escape characters, or does anyone know of a function/code that replaces the escape characters?
Thanks
|
|
|
|
|
Actually, it's pretty easy to write a function that replaces escape characters and vice-versa. Escape characters are pretty good thing, and moreover, it is the standard.
I vote pro drink
|
|
|
|
|
You should really look at ATL Server in that is coming out with VS.NET. It will make ISAPI Extension development much easier and more flexible. The urls and all the data submitted is very easily accessible.
Cheers,
-Erik
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My thoughts are my own and reflect on no other.
|
|
|
|
|
Look up the InternetCrackUrl() function in MSDN.
Jon Sagara
Sagara Software
|
|
|
|
|
Search the web for URL Encode and URL Decode. You should find something on sourceforge.com also.
|
|
|
|
|
Take a look at the InternetCanonicalizeUrl() function. It both encodes and decodes URL's.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
You may want to use a C++ web application server, such as Lightning server, that handles all of that for you. Makes life much easier.
|
|
|
|
|
Hi all,
I'm just beginning to learn STL, primarily the container classes and wanted to know what is the best way to store two related values.
For example I wish to store x and y points in a graph...
The vector container looks ideal for my needs... but am I correct in assuming I have to create my own class to contain the x and y values? Then store instances of my class in the vector container?
Or, would the map container be me more suited to this purpose?
Basically I need to know the most generic, but fast, way of storing such x y values.
Thanks all.
--
The Obliterator
|
|
|
|
|
The vector container looks ideal for my needs... but am I correct in assuming I have to create my own class to contain the x and y values?
Just use std::pair for that.
Or, would the map container be me more suited to this purpose?
It depends - if you want to frequently search for given x, the map may be better.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Wow, lightening fast response.
Cheers... never even heard of std::pair....
Will look into it, thanks.
--
The Obliterator
|
|
|
|
|
Can anyone tell me how to implement multi-selection with the CTreeCtrl? I'm a bit green with MFC and doesn't appear obvious to me.
Principle Design Engineer
EMC Corporation
|
|
|
|
|
The solution was published in Oct'96 issue of Microsoft Systems Journal, in the C++ Q & A column. Chances are you have the article in your VC++ help - look in the 'Periodicals' section. If not, go to msdn.microsoft.com, then to MSDN Magazine and search for past issues.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|