|
I want to capture video frames that is played by
Mediaplayer or other players.
Can anyone tell me how to do?
|
|
|
|
|
MCI_CAPTURE - use this command in the mciSendCommand()
this may help. just try that.
Zxczc
|
|
|
|
|
Hi all,
I have a written a DLL that, during initialization, creates an instance of a dialog class derived from CDialog. This dialog contains a third party ActiveX control. If the DLL is loaded by an application, the creation of the dialog instance fails during the CDialog::Create method. If I remove the third party ActiveX from the dialog, everything is fine.
But, when I include the same ActiveX control into a dialog that is used in an application based on CWinApp rather than in a dll, it works perfectly well.
Any ideas?
|
|
|
|
|
Maybe you forgot OleInitialize()
SkyWalker
|
|
|
|
|
That is dangerous because in a DLL, you have no control over what type of apartment your code runs in. AX controls are apartment-threaded, so if the calling thread is in a MTA, or never called CoInitialize() at all, you're SOL.
See this post[^] for more info.
--Mike--
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
Hi I am Mani Rajesh Kumar, working as Software Developer. I am currently developing an Image Processing Application
which deals with Large Amount of Data. I require as much as 2.5 GB of memory for my application. My System Configuration is
Microsoft Windows XP with Service Pack 1, 32Bit 2 GB RAM.
As we know By default OS allocates 2 GB memory for any single application.
I would like to know how to increase these 2 GB to 2.5 GB for a
single application.
|
|
|
|
|
In theory, the most an application could get from the heap is 2GB. But since it is highly unliklely that 2GB of contiguous RAM is available, the practical limit will be much lower. Certain OSs support a /3GB startup parameter, but even then there would need to be 2.5GB of contiguous RAM available. Why do you need so much all at once?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
What about virtual memory? Although it would involve heavy thrashing, it is possible to allocate upto 2 GB without having that much RAM with the help of virtual memory. I think the 2 GB limit is because of the size limitation of some internal data structures in the OS.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hopefully these few sites can help to clear this up:
http://blogs.msdn.com/oldnewthing/archive/2004/08/10/211890.aspx
http://www.brianmadden.com/content/content.asp?ID=69
http://blogs.msdn.com/oldnewthing/archive/2004/08/05/208908.aspx
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
You don't need that much contiguous RAM because the OS does distribute the data using the CPU's paging system. That means that e.g. 100MB of virtual contiguous memory doesn't have to be contiguous in physical memory. That is also a problem for hardware (especially DMA hardware)... see Scatter/Gather.
@manirajesh: Use /3GB as parameter for windows startup (boot.ini), that will enlarge the maximum user-mode memory to 3GB and decrease the max. kernel-mode memory to 1GB.
Don't try it, just do it!
|
|
|
|
|
|
Hi can any one tell me why raw_Login is returning error code to HRESUKT handle.
virtual HRESULT __stdcall raw_Login (
BSTR strUID,
BSTR strPassword,
BSTR strEnviornment,
BSTR strRole,
long * accessNumber ) = 0;
|
|
|
|
|
|
The com component has been initalised and raw_login function in part of IConnector : IDispatch interface
|
|
|
|
|
|
HI ,
I was just trying to create a tool box application but suddenly realised that i have no ideahow to go about doing it.
If somebody could guide me how i can go about implementing it I would be very happy to learn and try it out.
I also wanted to know...
supposing i have a dialogue based application where when i click on a particular choice it should exute some exe.
something like if i click on an option from a list it should execute some application.
how can i do tht in MFC
I know how to write the onselect part. wht should i write inside tht func n how is wht i wanted to know.
Thanks.
U get wht u Give
|
|
|
|
|
If you want to start an executable (or open a file) use this
<br />
HINSTANCE nResult = ::ShellExecute(NULL,_T("open"),strPath,strParameters,NULL, SW_SHOW );<br />
where strPath is your document or the path of your executable
and strPath are the parameters you may want to send to your executable.
|
|
|
|
|
Hi , can anybody give me a little explanation on what things like : 0x0001,0x48,0xFF,...... mean?
m0n0
|
|
|
|
|
This means you are in base 16 : it goes like this 1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,10,11,12,...
so A actually means 10
0x10 means: 1 * 16 + 0 = 16
0xFF means: 15*16 + 15 = 255
...
The reason hexadecimal is used is because 16 is a power of 2, so it is extremely easy to transform hexadecimal numbers into binary (and computers kinda like binary)
0 = 0000
1 = 0001
2 = 0010
3 = 0011
4 = 0100
5 = 0101
6 = 0110
7 = 0111
8 = 1000
9 = 1001
A = 1010
B = 1011
C = 1100
D = 1101
E = 1110
F = 1111
Therefore let say the following number 0x9AD has got the following binary value
1001 1010 1100
I hope this helps,
Jerome
|
|
|
|
|
Thanks Jerome for your attention. You know i have written several functions for Adding,Subtracting,Multiplying,....
huge numbers, my functions look like :
CString ADD(CString s1,CString s2)
CString SUB(CString s1,CString s2)
...
CString TO_BINARY(CString s1)
you see i have a function
as shown above TO_BINARY , which means that it does smth like this (just example)
CString g = ToBinary("13");//so g="1101"
and this function is too slow when instead of "31" i enter
number with 100 digits or more, Could you please give me any idea if i can use theses 0x000,... or smth similar to make my algorithm faster
Regards
m0n0
|
|
|
|
|
The simplest algorithm I can think of - and it does not mean it is the most efficient - is the following
Is the number odd, insert a "1" at the beginning of the string, a "0" otherwise
Divide the number by two (integer divide) (or you can substract 1 or 0 before you do the divide so you do not have to bother with floats)
If the result is 0, exit else start again
The division by two is usually very efficient on binary numbers (operator >> ) but if your numbers are stored as strings it is irrelevant.
Let me know! Good luck!
|
|
|
|
|
Hy!
Please someone tell me how can I conrol with a spin control float numbers in C++ .NET? I want to change values from 0 to 1. I attached an edit box as buddy for the spin control, but I can't control float numbers.
|
|
|
|
|
Hi!
Please consider this generic scenario:
Let's say that I have a GUI thread with a main window containing some kind of child list window. I fire off a worker thread, which perform some lengthy operations, to keep the GUI responsive to user interaction. At some stages, which can occur with both high- and low frequnency, the worker thread wants to communicate a textual description of the current stage to the GUI thread.
Today I implement this in a rather, as I feel, unnecessary complicated way.
I wonder if it would be safe to do it this simple instead:
1. The worker thread wants to communicate a new text to the GUI.
2. The worker thread allocates memory for the text character buffer.
3. The worker thread copies the text to the buffer.
4. The worker thread will not access the allocated memory again.
5. The worker thread posts a notification window message to the GUI.
6. The notification window message holds a pointer to the allocated text in its WPARAM.
7. The GUI thread adds the text to the list.
8. The GUI thread frees the allocated memory.
Now, what can go wrong here and what would be the impacts of that?
As I see it, the only possibility of a memory leak is that the GUI thread message queue is filled, so that no more pointers to allocated memory gets through. But this should be "impossible", since the message queue is only limited by the available RAM - or isn't it?
The upside of this method is that it requires no locking or synchronization and minimal efforts in both worker and GUI thread.
Comments?
--
The Blog: Bits and Pieces
|
|
|
|
|
I've used this exact approach. There is nothing wrong with what you are doing.
Johann Gerell wrote:
the only possibility of a memory leak is that the GUI thread message queue is filled
I found the following in the MSDN for PostMessage() [^]. There is a default limit of 10,000 messages that may be posted to a window using PostMessage() . If your call to PostMessage() fails, you should delete the memory allocated for the string yourself.
PostMessage() is nice because access to the message queue is synchronized for you. If the 10,000 message limit is a problem, you will need to create your own communication mechanism between the two threads. Here's a simple example:
CTypedPtrList<CPtrList,char *> Queue;
CCriticalSection QueueCS;
char *string = NULL;
QueueCS.Lock();
if (!Queue.IsEmpty()) string = Queue.RemoveHead();
QueueCS.Unlock();
free(string);
QueueCS.Lock();
Queue.AddTail(strdup("Message string"));
QueueCS.Unlock(); The two threads communicate using a simple queue of pointers to strings. The critical section safeguards access to the queue. The worker thread allocates the strings on the heap using strdup() , and the GUI thread deallocates them using free() .
The only complication with this approach is that you must have the GUI thread poll the queue at intervals to update the screen. For example, using a WM_TIMER handler, you could have the GUI thread update the screen at one second intervals.
Another possibility is to reduce the number of strings sent by the worker thread. If the strings being sent are a simple progress update ("Processing for 5 seconds...", "Processing for 6 seconds...", and so on), you only need to send strings when the time changes.
Software Zen: delete this;
|
|
|
|
|
Hi
In functions like PreTranslateMessage you get a pointer to a MSG structure which includes some UINT message. How can I resolve that number into plaintext (the name of the message) e.x. "WM_KEYDOWN" so that I have an understandable TRACE output?
Thanks & Bye,
T.T.H.
|
|
|
|