|
Thanks for the info, that was another solution I was given from someone in one of microsofts newsgroups.
|
|
|
|
|
I am currently looking for a sample code in visual c++ mfc based that will do a simple image frame animation using worker thread. Can anyone point me out where can I get it?
thank you.
p/s what i mean by image frame animation is that the canvas will continuos display difference image file continuously once it recived message from worker thread. This will look like the image is animating
|
|
|
|
|
Consider the following code. I'm trying to use path to create a region.
I cant understand why RgnRect dos not reflect what I have drawn and
so the region I obain is smaller than the rectangle I have drawn.
Is there anyone that can help me ?
Thankyou in advance.
Ezio Endrigo
Venezia - Italy
CMyView::OnDraw( CDC* pDC)
{
RECT client;
pDC->GetClientRect( &client);
pDC->CSetMapMode( hDC, MM_ISOTROPIC);
int winExtX=1000;
int winExtY=1500;
pDC->SetWindowExt( winExtX, winExtY);
int viewPortExtX=client.right-client.right/5;
int viewPortExtY=-client.bottom+client.bottom/5;
pDC->SetViewportExt( viewPortExtX, viewPortExtY);
POINT point;
point.x=winExtX;
point.y=winExtY;
pDC->LPtoDP( &point);
int viewPortOrgX=(client.right/2)-(point.x/2);
int viewPortOrgY=(client.bottom-client.bottom/5);
pDC->SetViewportOrgEx( viewPortOrgX, viewPortOrgY);
pDC->BeginPath();
pDC->MoveToEx( 0, 0);
pDC->LineTo( 0, 1500);
pDC->LineTo( 1000, 1500);
pDC->LineTo( 1000, 0);
pDC->LineTo( 0, 0);
pDC->CloseFigure();
pDC->EndPath();
CRgn Rgn;
Rgn.CreateFromPath( pDC );
RECT RgnRect;
Rgn.GetRgnBox( &RgnRect);
Rgn.DeleteObject();
}
|
|
|
|
|
Hi - I need urgent help. I need some Visual C++ code that will allow me to export a screen image as a BMP/GIF and to save the file. I would greatly appreciate anyone's help. I am a newbie and need to do this somewhat urgently. Thanks everybody!
Imran
|
|
|
|
|
Search for CXImage on this site
its was added in the last few days
CxImage is a C++ class to load, save, display, transform BMP, JPEG, GIF, PNG, TIFF, MNG, and ICO images.
|
|
|
|
|
I'm writing an USB camera-capture program using DirectShow. I've succeeded previewing and writing the captured stream to an AVI file. But the written file is very slow because it isn't compressed. I don't know how to add a compression filter into the capture graph.
Please show me any code about capture program.
|
|
|
|
|
Web-cams generally use compression over the USB connection, but the drivers do the decompression for you. When you send video to another person through Netmeeting (or any other video conferencing program) it compresses the video stream in another format.
As you would like to do something similar yourself, you will need to obtain a pointer to the IFilterGraph or IGraphBuilder interface exposed by the graph doing the capture, then insert and connect the "Infinite Tee Filter" just before the render filter to get a copy of the video stream. Then, connect the "ASF Writer Filter" to the Tee, which will generate the output file for you.
Read through the DirectShow section of the Platform SDK, and look at the sample files. A lot of the code is already there for you to use.
--
Paul
"I drank... WHAT?"
|
|
|
|
|
I will appreciate that someone can seng me a Email client software source code that can send Email in HTML format.
thanks a lot!
my email :stoney@263.net
happy to see everyone
|
|
|
|
|
Can anybody tell me how to work out which program is used to open a file, ie .doc files are opened by Word. I think there is an article on this site but I have had no luck finding it yet.
|
|
|
|
|
You can look for this info in the registr under HKCR.
This is a two step process.
First get de default value from the key of the desired file extension(\\HKCR\.xls, in my instalation "Exell.Sheet.8",the name asigned to this file type )
Second. Get the default value of \\HKCR\Exell.Sheet.8\Shell\Open\command.
For more detail, look at this link.
http://download.microsoft.com/download/platformsdk/sample19/1/W9XNT4/EN-US/FileAsso.exe
|
|
|
|
|
Does someone knows where to find algorithms to estimate remainding time that will adjust the estimation if the speed varies (something like Internet Explorer would do - the estimate time would adjust with the connection speed (for eg. if it slow downs...).
The simple way is to divide elapsed time by the current estimation of the progress to get the mean speed... but it does not adjust well to speed change.
I think that I should uses more of the recent time information than older one...
We want an algorithm that will self-adjust estimated remainding time for general use in our applications.
Philippe Mori
|
|
|
|
|
Simple... Use "moving averages", wich are largely used in stock trading.
for eg., use avg(avg(total download) + avg(last 10%))
|
|
|
|
|
16/03/2003 - i will have posted an article on estimations !
A class that does this !
CPrg prg;
prg.SetRange(0,1000);
int i=0;
while(1)
{
prg.SetPos(i);
i++;
printf("%d\r\n",prg.ElapsedSeconds());
printf("%d\r\n",prg.LeftSeconds());
}
it`s all you need ! for transfers ... for example !
// be cool !
I am the mighty keeper of the book on knowledge . Contact me to get your copy .
|
|
|
|
|
how to design a graph by taking time on x-axis and pressure on y-axis by taking these x,y co-ordinates from a file/database in vc++ using mfc
datla anjaneya raju
|
|
|
|
|
HELLO EVERY BODY.DID ANY BODY KNOW HOW TO RETRIEVE HARDWARE INFORMATION LIKE PROCESSOR SERIAL NUMBER,MOTHERBOARD SERIAL NUMBER....ETC
OR ANY SITE INCLUDE SUCH SORT OF INFORMATION (IN C/C++/ASSEMBLY/VISUALC API/VISUAL BASIC)
THANK YOU ALL
MAHMOUD
|
|
|
|
|
I want to register a system keyboardhook in my own winlogon notification package.But I try,the hook didn't
work.
I didn't want to replace gina.dll,just use winlogon
notification package.Who know that,please tell me.
|
|
|
|
|
Hello all,
Has anybody got a working sample/example of how the insertBefore (IHTMLDOMNode) method works?
I am currently working with MSHTML in C++, and have a IHTMLDocument2 object.
I am trying to insert a IHTMLMetaElement object into this object so that it will appear towards the top of the HTML page (when it's saved out)
My problem is that the call to insertBefore always fails, mainly due to my lack of understanding of the MSDN documentation.
I am currently trying to insert the IHTMLMetaElement object above the body of the HTML document (pHTMLPageBody)
Heres what I am doing at the moment...
VARIANT vTemp;
vTemp.vt = VT_DISPATCH;
vTemp.pdispVal = pHTMLPageBody;
hr = pDOMObject->insertBefore((IHTMLDOMNode*)pMetaTag, vTemp, &pNewNode);
I tend to get an error code back in the hr value, and no meta tag in my output html doc...
Any help would be appreciated.
THanks
|
|
|
|
|
What is the HRESULT error? I suspect it is because of the IHTMLMetaElement.
|
|
|
|
|
Thanks for replying Mark,
The hr is "-2147024809". Had a quick look in MSDN for the number, and it did seem to hint at an invalid parameter.
I have to say I wasn't confident at how I initialised the VARIANT param
vTemp.vt = VT_DISPATCH;
vTemp.pdispVal = pHTMLPageBody;
The question is, what is the correct initialisation for a IHTMLMetaElement?
Roy
|
|
|
|
|
Here is a hint. In the debugger watch window you can format HRESULTS into a more readable form. hr,hr will give something like E_POINTER instead of -2178934234234.
|
|
|
|
|
Hi Mark,
Well, according to MSDN, the HRESULT is "E_INVALIDARG" surprise surprise.
The IHTMLMetaElement seems to be OK.
When using these calls, I can amend the element and output to a file.
hr = pDOMObject->replaceNode((IHTMLDOMNode*)pMetaTag,&pNewNode);
or
hr = pNewElem->insertAdjacentElement(bstrDes,(IHTMLElement*)pMeta,&pOut);
So I think the Meta element is OK,
I tried passing a Null pointer instead, (but keeping the Variant + output IHTMLDOMNode)
And I got the E_POINTER return instead, I assume this means the other two params are OK or
at least the debugger is falling over the first param (Meta Element) for sure.
I know the Meta Element is a valid object, and I've tried casting it to a IHTMLDOMNode*
in different ways before/as part of the call to insertBefore, but i'm still stumped
What am I missing?
|
|
|
|
|
Take a look here. It may be helpful. Sorry but right now I don't have the time to be of more help.
|
|
|
|
|
Hi Mark,
THanks for the help, I finally solved the problem!
The important bit was ensuring that the pDOMObject points to the HTML tag, and then the vTemp points to the body tag.
Both were pointing to the body tag, hence I was trying to insert the meta tag in the body before itself...if you know what I mean...
hr = pDOMObject->insertBefore((IHTMLDOMNode*)pElement, vTemp, &pNewNode);
Ironically, it was eventually inserted between the HEAD and Body tags, and then I realised it had to be within the the actual head tag, so I ended up using the appendChild method instead.....Doh!
Was a usefull exercise to go through anyway,
THanks again
|
|
|
|
|
I'm looking for some inputs on how to create a simple object (ideally an ATL Com object) where one (or more) application(s) may may store some data (text, numbers, structures, etc..).
Another application may read the data, not only on one machine but on several machines - connected via network and/or serial ports or whatever..
The main idea is that we have several machines running the same SW, and configuration changes can be made anywhere, and these must be forwarded to all running instances of the same SW.
the main concern is that the "SynchronisedData" object must be very easy to implement...
basically only "write some stuff" and "read some stuff"
|
|
|
|
|
You must have a Lock/UnLock method pairs, or you can have multiple changes occuring at same time...
Derive a class from CMutex and add you read/write methods...
|
|
|
|