|
Hi !!
i want to determine the %CPU usage of my system at any given time. i have examined the PDH counters but i think they are NT Specific and i need a solution that can run on 95 & 98 as well.
any suggestion??
|
|
|
|
|
In fact I do not have any solution but I've read a little bit on that and the windows function who do that are undocumented function... so it's may be hard for us to find how to do this...
Remi Morin
Rmorin@Operamail.com
Remi.Morin@Lyrtech.com
Windows 3.1 était à un pied du précipice, Windows NT & 95 furent un gras pas vers l'avant
|
|
|
|
|
i know that one can find this data under HKEY_DYN_DATA on 95 & 98. on NT one can use PDH counters.
i was wondering whether there is *one* way of doing it on all machines.
|
|
|
|
|
How to get Hwnd and DeviceContext of a splitter window ?
|
|
|
|
|
A very simple ISAPI Extension Program used to data submited by a Form. I tried with two submit style.when i use , everything is ok. but when i use , there is error saying "Can't find the page". Why? Desperatly need help! Thank you in advance for your time!
|
|
|
|
|
from ISAPI's point of view there is no difference. But think of what happens from a CGI point of view, and i think this will answer your question:
picture this simple html form:
<form action=.... method=post>
<input type=text name=PhoneNumber>
<input type=submit name=submit value="Send">
</form>
when that form is submitted the Post data will be this:
PhoneNumber=4535435&submit=Send
Now picture this form:
<form action=.... method=post>
<input type=text name=PhoneNumber>
<input type=image src="images/button.gif" name=submit>
</form>
when this form is submitted, the post data will be this:
PhoneNumber=4535435&submit.x=45&submit.y=122
When you use an input type=image, their are two more form values entered, name.x and name.y which are the coordinates in which the image was submitted.
Therefore, my guess it that your page is doing wierd stuff in decoding this input.
|
|
|
|
|
Thanks a lot. I got the right result immediatly. And i found myself not understand sth enough. Because of you, i will have a better weekend.
Thank you once more!
|
|
|
|
|
Hi all,
the exe I've just coded is used by an ASP page running on IIS to generate a zip file containing some XML goo, for download by a client
problem being, the file I create is not public... so it looks like I need to use SetFileSecurity() or SetNamedSecurityInfo() to make it visible
the trouble is, i'm totally lost trying to use these functions- can anyone point me towards a good, quick example ?
thanks
peace
|
|
|
|
|
Hi
iam a newbee in Vc++
now i completed one project and facing some problems regarding
memory leakage .
i tried with CMemoryState class
but still some memoryleak is remaining
so iam planning to use some tools like bounds checker
but i dunno how effective these kinda tools .
pls give me your suggestions and some alternatives if any
thanx in advance
software Engineer
|
|
|
|
|
I'd suggest unless you're making money programming ( which is scary if you're completing your first ever project ) you can't afford Bounds Checker.
It would help if you posted some code/symptoms. How do you know it's leaking ?
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.
|
|
|
|
|
Check to make sure that all your new and deletes match up. Make sure that if you are allocting arrays with new that you use the delete [] syntax.
Visual C++ is fairly good at tracking the memory leaks of objects. Does it give you memory leak information in the debug output window when your app exits. It usually shows the data that hasn't been freed. This will give you a starting point where to look.
hope this helps,
Michael
|
|
|
|
|
Hello all,
I am trying to build a dialog type app that uses a irregular shaped bmp for the dialog box.. I download the source code from http://www.codeguru.com/dialog/IrrBmpDlg.html The source code works very well it really makes your app look very nice. The only problem I see is if you change your desktop settings to "Large Fonts" the bitmap is displayed the regular size while the Dialog box is enlarged. You end up with a bunch of controls that don't appear to be part of the application they look like they are out in the open.. Would anyone be willing to check out his source code and help me come up with a solution to this? I have emailed the author but I haven't received any replies. I thought maybe someone else might have run across a similar type situation.
Thanks in advance,
Rob
|
|
|
|
|
How can I create a multidimensional array of int's (or whatever) when I don't know the dimensions at compile time? I've tried alot of stuff, but the compiler still hasn't accepted any of my desperate tries. Please help me...
In my case, I want the user to decide at runtime the lenght and width of a labyrint, that should be generated afterwards. I'm aware that there are other alternatives to multidimensional arrays, and I'm open to other good suggestions too.
Sprudling
|
|
|
|
|
This is the best I've managed to do so far...
#include "iostream.h"
int main(int argc, char* argv[])
{
int nA = 5;
int nB = 4;
int** a = new int*[nA];
for (int i1 = 0; i1 < nA; i1++)
{
a[i1] = new int[nB];
}
for (i1 = 0; i1 < nA; i1++)
{
for (int i2 = 0; i2 < nB; i2++)
{
a[i1][i2] = (i1 * nB) + i2;
}
}
for (i1 = 0; i1 < nA; i1++)
{
for (int i2 = 0; i2 < nB; i2++)
{
cout << "[" << i1 << "][" << i2 << "] : " << a[i1][i2] << endl;
}
}
for (i1 = 0; i1 < nA; i1++)
{
delete[] a[i1];
}
delete[] a;
return 0;
}
It seems to work ok, but there is alot of code just for creating an array, and I'll have to keep track of the size of the 1. dimension of the array, and that's not always simple.
Isn't there a better way?
Sprudling
|
|
|
|
|
The way you're doing it is the correct way.
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
this is the perfect place for some cool template code
any takers?
|
|
|
|
|
What if I want like 10 different arrays with 10 or more dimensions? That would be alot of code. And are you telling me that C++ hasn't support for dynamic multidimensional arrays?! If so, I'm sure this has been a "problem" for a long time, and someone must have come up with something... A quick and easy general way to create arrays of N dimensions. If there exist one, I really want to know
Sprudling
|
|
|
|
|
here you go man i think it is the best way to do that
int main()
{
double (* pX)[4];
pX = new double [3][4];
delete [] pX;
return 0;
}
|
|
|
|
|
I'm looking to write some custom controls that have a "Timeline" type control with a tree-list view controlling content held within a timeline.
ie
http://www.adobe.com/products/premiere/keyfeature07.html
http://moppi.inside.org/demopaja/screenshot_02.gif
Basically, I am having troubles with the tree-list view portion of the appliccation. It seems that there is a tree-list control controlling the timeline content which holds time markers and information.
Am I off base here, or what? Any resources on the web or ideas?
Thanks
-JT
|
|
|
|
|
Wow. I'm just about to start coding something almost exactly similar, and was wondering the same thing. My guess is that the tree list portion is custom coded, and not really derived from treectrl.
Let me know if you find out anything... I'll start lookin around too.
|
|
|
|
|
How do I Terminate a process that is already running ?
In Short....
if(ProcessNotRunning)
{
CreateProcess(..);
}
else
{
// Process is already running
// Now to terminate it later I require a handle how do I get tht ???
}
......
......
TerminateProcess(prInfo.hProcess,0);
HELPPP!!!!!
|
|
|
|
|
The last parameter of the CreateProcess() will provide you with all the handles and information you need.
BOOL CreateProcess(
LPCTSTR lpApplicationName,
LPTSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCTSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation
);
...
...
.....
lpProcessInformation
Pointer to a PROCESS_INFORMATION structure that receives identification information about the new process.
cheers
It is Illogical to define an inventor by his invention
|
|
|
|
|
But in case the Process is already running .. m not goin to use createProcess .. then ????
|
|
|
|
|
I'm having trouble while trying to share my string resources defined in an extension DLL when it gets used within a MFC client app. It appears to work if the string resources are assigned some specific values!!
Here's the concrete illustration of the problem :-
static AFX_EXTENSION_MODULE GOLDLL = { NULL, NULL };
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason) {
case DLL_PROCESS_ATTACH:
TRACE(_T("GOL.dll is initializing\n"));
// Extension DLL one-time initialization
if (!AfxInitExtensionModule(GOLDLL, hInstance))
return 0;
// Insert this DLL in the resource chain
//new CDynLinkLibrary(GOLDLL);
break;
//...
}
GOLInit creates a new CDynLinkLibrary object to add it to the library chain & this function gets called within the client app.
extern "C" void WINAPI
GOLInit()
{
static bool firstTime = true;
// Insert this DLL into the resource chain
if (firstTime) {
new CDynLinkLibrary(GOLDLL);
firstTime = false;
}
}
// This is from the resource file in the extension DLL & is the string resource that
// i'm interested in sharing with the client app.
#define IDS_XXX_CTRL 61500
The funny thing is that if i renumber the IDS_XXX_CTRL as 61440, the client app finds the resource but if it is defined as 61500 it doesn't find it. I stepped thru AfxLoadString & noticed that the GOLDLL module is part of the chain & yet the FindResource call fails. Any ideas what else i should check?? i've ran out of ideas & steam!
TIA
Chen Venkataraman
|
|
|
|
|
Why do you have GOLInit function? Did you have any problems with CDynLinkLibrary created in DllMain?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|