|
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...
|
|
|
|
|
When will this latest version of the codeproject discussion forum be available for download, in the form of the ActiveX dll version.
I have noticed a lot of new features, including the keywork filter and would like to have this latest version.
Thanks.
Jason
|
|
|
|
|
Hi,
I seem to remember a programme (like WinZip) which
presented its contents as folders and files in Explorer,
without the archive actually being opened.
Is there a WIN32 API function for showing dirs and file
in the WIN file system that don't _really_ exist as files
on the disk ??
Thanks
Gerry
|
|
|
|
|
That was Zip-It or Zip Magic or something, WinZip doesn't do that. But anyway, what you're thinking of is namespace extensions. I'm working on an article on that topic right now, as a matter of fact.
--Mike--
http://home.inreach.com/mdunn/
A recent survey reports that 1/4 of all internet users in England surf for porn.
The other 3/4 just didn't want to admit it.
|
|
|
|
|
Mike,
Thanks heaps. Let us know when you're done. I look fwd to it.
Gerry
|
|
|
|
|
Me, too. We are developing a server/client application with a file repository on the server. I would like to present these files with such a namespace extension on the client-side.
|
|
|
|
|
Attracted to the instantaneous display of selected messages, I was quite disappointed to discover that the "use DHTML" view option is not implemented in the archive distribution.
Are the archives out of date, or does someone have a fix for this?
Django
ClassicsOnline Webmaster - Download Your Favourite Classic Cartoons, Comedy, and Feature Films Online! Point your browser to www.classicsonline.net
|
|
|
|
|
Attracted to the instantaneous display of selected messages, I was quite disappointed to discover that the "use DHTML" view option is not implemented in the archive distribution.
Are the archives out of date, or does someone have a fix for this?
Django
ClassicsOnline Webmaster - Download Your Favourite Classic Cartoons, Comedy, and Feature Films Online! Point your browser to www.classicsonline.net
|
|
|
|
|
I am developing a program in which the users will need to run programs. I would like to use the Windows Run dialog to do this. I know that you can call the Windows Run dialog using an API in Shell32.dll in Visual Basic, but I haven't the faintest idea of how to do it in C/C++. How can I?
Thanks in advance,
A.C. Newbie
|
|
|
|
|
Here is how you do it in C++
#include "windows.h"
#include "atlbase.h"
#include "shldisp.h"
...
class UseCOM
{
public:
UseCOM(){::CoInitialize(NULL);}
~UseCOM(){::CoUninitialize();}
};
...
MyFunctionToCallRun()
{
UseCOM com;
{
CComPtr<IShellDispatch> spShell;
HRESULT hr = spShell.CoCreateInstance(CLSID_Shell);
if(SUCCEEDED(hr))
spShell->FileRun();
}
}
HTH
Jignesh
|
|
|
|
|
I have written my own control to which I would like to add drop support. I have managed to produce a simple example that uses the IDropTarget interface to detect a drop and display the filename. The problem I have is that it doesn't always work. It seems to depend on the type of parent window the control is embedded into or the number of parent windows above it in the hierarchy. RegisterDragDrop() always returns S_OK but all I get is the 'no entry/drop not allowed' cursor when I drag a file over the control. Does anybody have any suggestions as to how to find out what is causing the block. I have tried using Spy to look at the messages but there don't seem to be any until the drop occurs. The control is written using Win32 API in C/C++ (no MFC).
Any help you can provide will be greatly appreciated as this problem has really got me stumped and, as per usual, the project this is for had to be finished yesterday!
Steve.
|
|
|
|
|
I have a question regarding a api commonly used in active debug tools, ect. My question is, i was wondering if anyone knows how i could have program A detect if program B is trying to use the WriteProcessMemory or ReadProcessMemory api on program A, and if program B is doing that, i would like program A to beable to terimate program b or what ever program is trying to hack it; the reson i say hack is becasue those api's are commonly used in cheat programs that write a games memory so certain values at the given address are written, hence the "game trainer". If anyone has the slightest clue as to what im talking about, please help me, i need some example code very badly.
- thanks for your time
|
|
|
|