|
Hello, everyone!
I have tried this sample on both Windows 2000 Professional and Windows 2000 Server, both works perfectly when monitering:
Network Interface --> Bytes Total/sec of [My network adapter]
But it does not run properly on Windows XP system. When monitering the above performance parameter of my XP machine, I can not get the bandwidth value output.
Here is the URL link of this sample,
URL Link:
----------
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/perfmon/base/browsing_performance_counters.asp
----------
Can anyone help?
Thanks in advance,
Geo
|
|
|
|
|
Hi, everybody, there is a article at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/creating_a_child_process_with_redirected_input_and_output.asp
I built the sample code into two programs: a parent process and a child process named child.exe. When I test it, it is sure the child process's output can write to the parent process's console. However, I seemed to be impossible for the child to read from the parent. Anyone who is interested can try it. Since it is put on the Ms's website......, I can not imagine there is a bug so prominent!
any advice by Gurus?
|
|
|
|
|
u need to create 2 pipes.
the pipe from parent to child is OK according to ur question.
create another one similar to this one from child to parent.
includeh10
|
|
|
|
|
Hi,
I have a button, which on clicking pops up a new dialog box. When I click the button once more the dialog box is created once more. i want to avoid this. I want the dialog box to be created only once, and if the button is clicked while its popped up , i dont want to be created. I just want only one instance of it .what should I do,
Thanks in advance
Deepak Samuel
|
|
|
|
|
Hi there,
there are several ways to avoid this
1 Can keep a Flag and check if it is set dont open the dialog box again,
2.If u can make ur dialog box class singleton it will solve ur prob !!
3. u Can also use Mutex to avoid this .
4. And dear u can also achieve this by making ur dialog box Modal instead of modeless...then no one can ever be able to click that dam'n button again
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
Thanks a lot four your kind suggestions..
Deepak Samuel.
|
|
|
|
|
I have a edit box, where i need to type in comments.There is also a ok button. my problem is that when i want to go to the next line in the edit box,I press enter (which is the usual procedure in MS word or applications like that) but it does not go to the next line , rather it reacts as if I pressed the ok button.What should I do in order to go to the next line in the edit box as soon as i press enter?
Thanks
Deepak Samuel
|
|
|
|
|
Hi ,
open the property dialog of ur edit box check the style of edit box -MultiLine,
it will solve ur prob !!
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
Edit the properties in the resource editor.
Select the Styles tab.
Ensure that "multiline" and "want return" are selected.
Then Enter will work as desired.
Kevin
|
|
|
|
|
a, b = 0;
Is the above assignment ONE statement in sense of C++ semantics?
(Under which name is this documented?)
|
|
|
|
|
|
Thanx, Michael. My example did not have any sense for itself; the point is, that it will be regarded as ONE statement. This is important for example in a FOR or IF etc. statement, if there is no bracket:
for (i=0; i<10; i++)
a=i, b=i*5;
I tested it and I found that BOTH will be executed in the loop, and I wanted to hear that this is ok. (Although I find this is a messy way to do it, but that's another issue.)
|
|
|
|
|
Vancouver wrote:
a, b = 0;
What should this do? It evaluates a and sets b to zero... If you want to set both variables a and b to zero, do this:
a = b = 0;
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
It should do nothing; it was the simplest example. Pls read my comment above to Michael Dunn.
Thanx anyway.
|
|
|
|
|
Hello, everyone!
One of my homework is to list all the ways (API functions or methods) which can be used to get the machine name of localhost. The value of machine name should be the same as the console output value when we run "hostname" command on Windows platform.
Can anyone help? Think as far as possible.
Thanks in advance,
Geo
|
|
|
|
|
I guess you can use getHostName(...) function
not very sure about syntax but try searching in msdn
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Thanks, sohailkadiwala buddy!
Geo
|
|
|
|
|
hi,
i am using crystal report 6.0. i need to take setup(package) to my application for distribution. after taking setup. crystal report is not working. what are all files are need to include while taking setup. any one help to me.
thanks in advance.
Murali.M
|
|
|
|
|
In Display Properties; Setting; Advanced, a "magnification factor" appears (dot per inch). It's normal setting is 96 dpi, large is 120 dpi, and there are custom settings as well.
Anyway, where does one find the actual value of this setting? If possible, NOT in the registry...
|
|
|
|
|
HI All ,
I am a VC++ programmer,and some time My Acumen ask Microsofts VC++ (Visual Studio VC++ 6.0 )complier to complile my senseless programs !
See what I have asked this time to compile !!..
This is console based program, in which i am trying to call Member function of My class With a NULL pointer .
And it is working fine....
Please some one explain this to me ....is this happening of coz Compiler is fed up with my programs !!
#include "stdafx.h"
#include <iostream.h>
class A
{
public :
int var;
A()
{
cout<<"In Consrtuctor !!";
}
~A()
{
cout<<"\nClass destroyed !!\n";
}
void EvenNullPointerCanCallme(int a);
};
void A::EvenNullPointerCanCallme(int a)
{
int *aa=new int[100];
cout<<"\nHow is that possible !!\n";
delete []aa;
}
int main(int argc, char* argv[])
{
A *nullPtr=NULL;//see i made it NULL
nullPtr->EvenNullPointerCanCallme(2);//How daring i am
delete nullPtr;//I cannot call destructor !
return 0;
}
Are member functions statically linked with the Object name !!
Actually i never found any concept of accessing Class member function with NULL pointers in Any of C++ books Which I have read (Plz let me know if u people have found it in any book !).
I am grateful to all u peoples who had a look at my program !!
Now see i am getting famous or what
Abhishek Srivastava
1.5 Year Old Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
It's perfectly fine to call a method through a null pointer, because all the pointer does is establish the value of this in the function. If you were to access any member variables in the function though, you would then be dereferencing the null pointer, which would be Bad.
--Mike--
Ericahist [updated Oct 26] | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Actual sign at the laundromat I go to: "No tinting or dying."
|
|
|
|
|
In code-wise, what you create is a type 'pointer-to-class-A', which doesn't point anywhere (initialized to NULL). You can place a call to the member function through this pointer in the code, and the code compiles just fine.
However, when you run this program, you'll get either an Access Violation, a complete machine crash or nothing, depending on your luck
Pointer calls, as far as I know, are evaluated at run-time. The compiler is not aware whether the call is possible or not, it can only decide whether it is legal or not. Illegal calls it will detect and promptly state '<method xyz=""> is not a member of <class xyz="">'. Because the method you specified is a member of Class A, the compiler doesn't warn you. If you removed the NULL setting, it would warn you that you've used a pointer without initializing it.
Try running it, and see what happens ^^
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
What Mike says is right. The member function is not called through the pointer unless its virtual (in which case it de-references the pointer to lookup the vtable pointer). As it knows that your pointer is of type X, it can call any non virtual function on it directly, its just that in C++ the first hidden parameters passed is the this pointer.
Dereferencing the pointer in any way would cause the access violation. As the example given only had code accessing variables declared on the stack, there would not be any problems.
Roger Allen
Sonork 100.10016
Death come early, death come late,
It takes us all, there is no reason.
For every purpose under heaven,
To each a turn, to each a season.
A time to weep and a time to sigh,
A time to laugh and a time to cry,
A time to be born and a time to die.
Dust to dust and ashes to ashes,
And so I end my song.
|
|
|
|
|
Friends i need to draw few bitmaps on my window. I used traditional BitBlt method to draw them, and images are drawn normally.
But instead of using BitBlt technique, i want to use CImageList, as such bitmaps appear on screen correctly, but the problem is that the original colors of bitmap gets lost. I think i am giving wrong values to CImageList functions. Please check what i am doing and help me finding the solution:
For creating CImageList:
m_imageList.Create(19,19,CLR_NONE ,0,3);
m_imageList.SetBkColor(CLR_NONE);
HBITMAP hBmp;
CBitmap *pBitmap;
for(int i=0; i < m_countBitmaps; ++i)
{
HBITMAP hBmp = GetNextBitmapHandle();
pBitmap = new CBitmap();
pBitmap->Attach(hBmp);
m_imageList.Add(pBitmap,RGB(0,0,0));
}
For drawing CImageList:
m_imageList.Draw (
pDC,
index,
CPoint(rect.left,rect.top),
ILD_NORMAL);
|
|
|
|
|
I think u r not using correct flags in Create method
try this
m_imageList.Create(19,19,ILC_COLOR24|ILC_MASK)
i am assuming that u r using 24 bit bitmaps otherwise u can use
ILC_COLOR8 etc....
ILC_MASK is for masking the background color.
|
|
|
|