|
How to change rectangle backround of tooltip window to other shape?
|
|
|
|
|
Have a look at TTS_BALLOON.
Beyonf that, do a search here on codeproject for all sorts of tooltip replacements. The built in class is handy, but it runs out of unsefulness VERY rapidly.
Iain,
|
|
|
|
|
ok. Thanks for your reply.
|
|
|
|
|
System: Windows XP / Vista / 32 / 64
Language: C++
I need information about all network controllers
of the PC my application is running on.
(Usually 1 onBoard and 1 additional network card)
And I need their maximum transfer rate
(10MBit, 100MBit or 1GBit)
I already know how to get their IP-addresses
with gethostbyname() and the h_addr_list.
But on that way I don't get any info about their
maximum speed. (maybe the card is a 1GBit controller,
but it is connected with a 100MBit switch...
then the current max. speed should be 100MBit)
Thanks for your help
|
|
|
|
|
Pasy_m wrote: Hardware info about the network controllers
Did you see Computer System Hardware Classes (Windows)[^]?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
The MIB_IFROW Structure[^] can tell you the network speed for each device.
Sample usage:
#include "Iphlpapi.h"
#pragma comment(lib, "iphlpapi.lib")
VOID CNetworkToolBox::EnumNetworkSpeeds()
{
BYTE *pBuf=NULL;
DWORD dwSize=0;
DWORD dwResult=0;
PMIB_IFTABLE pMIBTable;
GetIfTable(NULL,&dwSize,FALSE);
pBuf=new BYTE[dwSize];
pMIBTable=reinterpret_cast <PMIB_IFTABLE >(pBuf);
CString szBuf;
if(NO_ERROR == GetIfTable(pMIBTable,&dwSize,FALSE))
{
for(UINT i=0; i < pMIBTable->dwNumEntries; ++i)
{
if(MIB_IF_TYPE_LOOPBACK != pMIBTable->table[i].dwType)
{
if(MIB_IF_OPER_STATUS_CONNECTED == pMIBTable->table[i].dwOperStatus
|| MIB_IF_OPER_STATUS_OPERATIONAL == pMIBTable->table[i].dwOperStatus)
{
szBuf.Format("%d@%s",pMIBTable->table[i].dwIndex,pMIBTable->table[i].bDescr);
TRACE2(_T("%s network speed in bits per second: %ld\n"),szBuf,pMIBTable->table[i].dwSpeed);
}
}
}
}
delete []pBuf;
}
Best Wishes,
-David Delaune
|
|
|
|
|
Pasy_m wrote: (maybe the card is a 1GBit controller,
but it is connected with a 100MBit switch...
then the current max. speed should be 100MBit)
The overall throughput will be 100M, but the NIC itself will be 1G to the switch.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
This Code gives output as Access violation ...Can anybody tell me what is wrong there....
#include <windows.h>
#include <stdio.h>
void main()
{
char * szTemp, *cmdline;
cmdline = (char *)malloc(sizeof (char) * 1000);
if(cmdline)
{
strcpy(cmdline, "skdjofhdsjfodhfjdhgkjfhgkjdfhgkfhgkjdfhgk");
int len = strlen(cmdline);
szTemp = (char *)malloc(sizeof (len) + 1);
if(szTemp)
{
strcpy(szTemp, cmdline);
puts(szTemp);
}
}
if(cmdline)
{
free(cmdline);
cmdline = NULL;
}
if(szTemp)
{
//Access Violation When We Free szTemp
free(szTemp);
szTemp = NULL;
}
return;
}
|
|
|
|
|
Oh, yes, it is veeeeery interesting.
BTW: The error is in the line below, can you spot it?
Aabid wrote: szTemp = (char *)malloc(sizeof (len) + 1);
Hint: sizeof(len) is 4!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Aabid wrote: szTemp = (char *)malloc(sizeof (len) + 1);
I believe it should be (char *)malloc(sizeof (char)* len + 1);. actually you need to have buffer copy commandline into szTemp. but instead of allocating proper buffer to it, you are allocating on buffer for 4 character + 1 for NULL.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ThatsAlok believe it should be (char *)malloc(sizeof (char)* len + 1);.
That should be
sizeof(char) * (len+1)
if sizeof(char) was indeed relevant...
Pardon my nitpick attitude.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: if sizeof(char) was indeed relevant...
Yeap i know.. Old programming bad-habit
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Actually it is a good habit and proves helpful when dealing with TCHAR s.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Please check the statement
szTemp = (char *)malloc(sizeof (len) + 1);
check with following
szTemp = (char *)malloc(len + 1);
|
|
|
|
|
sorry I was late..
Please ingnoe
|
|
|
|
|
Hi!
how do i work with
#pragma command, to ignore a warning number in my project? (in Compiling)
please help me
Zo.Naderi-Iran
|
|
|
|
|
What about documentation [^]?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
you....... hummm
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
#pragma warning( disable : 4507 34 )
#pragma warning( once : 4385 )
#pragma warning( error : 164 )
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
thanks
but, where i write this command in my MFC project?
Zo.Naderi-Iran
|
|
|
|
|
you can write this in any header/C/C++ file, above your code!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
oh, ok, thanks
i write this command in first line of Header file.
this is right,
thank you
Zo.Naderi-Iran
|
|
|
|
|
my pleasure!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
How to read Bitmap file using BITMAPFILEHEADER structure. Can any one give some guideline regarding this ?
|
|
|
|
|
All the info you need to parse and load a BMP file is linked to in the
BITMAPFILEHEADER documentation. Here's the link:
Bitmap Storage[^]
There's all kinds of examples around, probably many here on Code Project Dot Com.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|