|
Im querying the counter
"\\Processor(_Total)\\% Processor Time" using Pdh functions. But during the first query (PdhCollectQueryData, and PdhCollectQueryData) I am getting the value fmtValue.longValue (Query result) as 99 always. But during the consecutive calls it returns the appropriate CPU usage values. I susected this as the CPU used during the call - But windows Taskmanager doesnt show that (99). Can someone explain this - Thks in advance! Wilson
|
|
|
|
|
What are you expecting the value to be?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Im expecting the CPU usage % on my machine, which is not 99% actually (verified using TaskManager). But it returns 99 only in the first call. It returns the actual CPU usage (normallu 1-10 on my machine) in the consecutinve calls.
|
|
|
|
|
hey i have a program with several edit boxes that are numeric only my problem is i also need to enter negative values but i dont want to allow people to write text in there is there a way around it so itll allow users to input a - sign before thier number?
|
|
|
|
|
you can use edit->SetWindowLong
and use style as ES_NUMBER
|
|
|
|
|
Anonymous wrote:
use style as ES_NUMBER
Which limits the control to numbers only.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
You can go through my article Numeric Edit Control[^] to find an answer to your problem. You can also download the complete source code with the article and use it as it is to save your time (of course only if you are working with MFC).
Regards,
Gurmeet BTW, can Google help me find my lost pyjamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
|
|
|
|
|
i tried SMTP samples for sending email, but the samples display error "can not find SMTP mail server".
how to fix the problem?
thx
includeh10
|
|
|
|
|
includeh10 wrote:
how to fix the problem?
Does the SMTP server exist that you are referencing? If so, is it using port 25 for the SMTP service?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
DavidCrow,
welcome to come back ....
how to know if "SMTP server exists"?
MS outlook works well on my PC.
cheers
includeh10
|
|
|
|
|
includeh10 wrote:
welcome to come back ....
Welcome back? Had I gone someplace?
includeh10 wrote:
how to know if "SMTP server exists"?
I would be inclined to ask my ISP about their SMTP server. If you are doing this from within a company, then ask the network administrator.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
thx,
i did this (ask ISP - but haven't get feedback).
must port number be 25 for SMTP?
i am testing a SMTP program, the program changes port from 25 to 6400 if connection failed
it looks strange.
cheers
includeh10
|
|
|
|
|
includeh10 wrote:
must port number be 25 for SMTP?
No. There are 216-1 ports, but port 25 is the most common.
includeh10 wrote:
i am testing a SMTP program, the program changes port from 25 to 6400 if connection failed
If your program is using port 6400, that means that the SMTP server must also be using port 6400. If the ports do not match, your program will not work.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
port 6400 comes from this function:
SERVENT*pServer = getservbyname( "mail", 0);
pserver->s_port is 6400
i wait for my ISP.
thanks, i will post new thread if need help
cheers
by the way, do u know if there is a sample similar to outlook? my outlook works well, if i have the sample, it sounds easier.
includeh10
|
|
|
|
|
includeh10 wrote:
by the way, do u know if there is a sample similar to outlook? my outlook works well, if i have the sample, it sounds easier.
Outlook uses CDO, which is a COM wrapper around MAPI. Search MSDN, or Google for, Outlook automation. Here are some MAPI examples.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
The value from 'getservbyname' is in network byte order. If you 'ntohs' 6400 you get 25. Curious that.
Paul
|
|
|
|
|
now a days i am developing a voice chat software , using DirectPlay voice , it has quite satisfactory results on broadband connection like 128kbits and above , but as far as dialup and low internet connection concerns , its performence is not very good, although i have used 3.kbps codecs , so can anybody tell me how to improve directplay performence on low data rate connections.
Unmanaged in a .NET world
|
|
|
|
|
plz can any one help in getting a code which writes and reads data into excel sheet using c++ or vc++..
|
|
|
|
|
use utilities for office. mso97.dll exports the required class to manipulate with office documents from your C++ application, get necessary classes from mso97.dll as a part of your application.
|
|
|
|
|
Just a tip.
If you create a text file, even a HTML page with colors and tables, and name it as .XLS, it will be read by Excel converting the HTML formatting to Excel as close as possible...I have got good results using this approach
GuimaSun
www.nexsun.com.br
NEXSUN TechZone
|
|
|
|
|
See if the MSDN article Q178749 is of any help.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi Shiva,
You have some options, but I would say the easiest is using Automation, but the drawback is Excel has to be installed on the client machine. The other option is using ADO and accessing Excel files as if they were databases, in this case Excel doesn't have to be installed, but you are limited on what you can do.
Anyways, to use Excel automation, check this article on the MSDN
Office Automation Using Visual C++
Fabian
|
|
|
|
|
Hi Friends,
I want to find out MAC address. I am using following method
GUID uuid;
CoCreateGuid(&uuid);
char mac_addr[18];
sprintf(mac_addr,"%02X:%02X:%02X:%02X:%02X:%02X",
uuid.Data4[2],uuid.Data4[3],uuid.Data4[4],
uuid.Data4[5],uuid.Data4[6],uuid.Data4[7]);
OutputDebugString(mac_addr);
But Every time it's giving the different address...
VikramS
|
|
|
|
|
First of all, you need to understand the difference between a MAC address and a GUID. If you really don't know the difference, may be this can help:
MAC Address: A 12-byte hexadecimal address used by the media access control layer of an 802.2 connection. It is an identifier of a network node that differentiates one node from another on a network.
GUID (Globally Unique Identifier): A 16-byte (128-bit) value that uniquely identifies some entity, such as a COM class, or COM interface. Examples of GUIDs are the CLSID and the IID. A GUID is also referred to as a Universally Unique Identifier (UUID).
To learn how to get the MAC address of an ethernet adapter, fire your MSDN and search for the keywords "MAC Address". Among your search resuls, you'll find an HOWTO article regarding your query. That is the solution to your problem.
Regards
Gurmeet BTW, can Google help me find my lost pyjamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
|
|
|
|
|
If your NIC is bound to NetBIOS, you can use this.
There's also the Win32_NetworkAdapterConfiguration WMI class.
GetAdaptersInfo() and GetIpNetTable() can also be used.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|