|
I just did a google search and found this right off the bat...
The macro h_addr is defined to be h_addr_list[0] for compatibility with older software.
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I have a tree control inserted, in which I assigned an imagelist.
When I insert some items, some of them have images assigned to them, even if I don't assign one to them.
This is how I insert my Item in the tree :
TVINSERTSTRUCT tv;
tv.hParent = m_hRootItem;
tv.hInsertAfter = TVI_SORT;
tv.item.mask = TVIF_TEXT | TVIF_PARAM;
CString sText;
sText.LoadString ( IDS_OBJECT_CONSTRUCTED );
tv.item.pszText = (LPTSTR)(LPCTSTR)sText;
tv.item.lParam = NULL;
m_hMyItem = InsertItem( &tv );
but this item use the an image ( index 0 ) from the image list, even if the item does not have the TVIF_IMAGE and TVIF_SELECTEDIMAGE ...
any insights ?
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Try fully initializing tv by doing this:
TVINSERTSTRUCT tv;
ZeroMemory (&tv, sizeof (tv));
...
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thanks, I always forget about that, but, it doesn't seem to do anything special, the item will use the first image in the image list; maybe the tree doesn't like to have items with images and items without.
anyway, I created an "empty" image in the imagelist for those items .
Thanks!
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hi Maximilien, when your tree control has an associated image list (as your does), you need to specify -1 for the image index of items that aren't supposed to show an image.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
during execution of the debug build of my .exe I keep getting this in the debug window ( a lot of them):
Warning: no message line prompt for ID 0x800B.
I removed some edit boxes from my dialog, but I also deleted the message map entries for these controls and their variables. Does anyone know what this might be, or how I can find out? Thanks in advance!!!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
It is likely that you have missed the prompt for menu item(s) that you have added (in the resource editor).
These prompts show in the status bar at the bottom of the application when you hover over the menu item(s).
Note: Toolbar items will have the same prompt as their corresponding menu items.
Ant.
|
|
|
|
|
and how do we do to display such promt in the status bar ?
(i know, get the string into the string table, then write it in the correct statusBar Pane...)
But how, could you give me some short code lines (mt problem is more to get smth in the string table actually)
thanks
TOXCCT >>> GEII power
|
|
|
|
|
CString::LoadString
Be sure that resource exist in the string table
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
thanks! that helped a lot!!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
I want to modify the net-data pacekts before they are passed to the applications. can raw socket or winpcap do?
someone said that SPI can do. but it is only for winsock 2. i hope it also work for the lower version winsock such as winsock 1.1.
Thanks.
|
|
|
|
|
Hi There!. I am a newcommer in MFC programming.
How does one parse parameters passed as command line arguments in the Win32 environment? I know i can use lpCmdLine, but how do i do that? Can someone show me an example. By the way I am useing Embedded Visual c++
|
|
|
|
|
The lpCmdLine parameter is an exact copy of the command line passed to your program, including all spaces, quote marks, etc. If you want to treat this as separate arguments, you must split it.
MFC supplies its own WinMain by default; however, you can override this if you wish. If you do so, call AfxWinInit to initialize MFC, and AfxWinTerm before returning. The MFC WinMain is implemented in winmain.cpp .
It's rare to do this. Typically, you instead override InitInstance in your class derived from CWinApp . You can then access the command line from CWinApp 's m_lpCmdLine parameter.
MFC offers the CCommandLineInfo class and the ParseCommandLine function for helping with command lines. To add support for your own options, create a new class which inherits CCommandLineInfo . Then override ParseParam .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thanks.
lpCmdLine is a unsigned short *.
The value i passed in the command line is just a BYTE (0-15). How can i convert lpCmdLine to a BYTE?
Gunnar
|
|
|
|
|
Whether the command line contained one byte or several dozen, lpCmdLine is accessed in the same manner for each. It's simply a pointer to the command-line arguments.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
How should the following be declared
class A
{
public:
B test;
};
class B
{
public:
A test;
};
I thought you just pre-declared class B before class A using the following line:
class B;
What am I doing wrong?
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
You are declaring class A, that contains a member of class B, that contains a member of class A, that contains.....ad infinitum
Declare the test member as a pointer to class A or B.
Robert-Antonio
"Love without sex is like a fish without antlers"
|
|
|
|
|
Beat me to it.. That's what you get when you are distracted before posting your reply
Ant.
|
|
|
|
|
It isn't the first case, when more people posted the same reply simultaneously. The simpler the question is, the more gurus answer
Robert-Antonio
"Czech Railways discovered, that in case of disaster the most damaged wagons
were the first and the last. So they decided to create trains without them."
|
|
|
|
|
You can only use forward declaration when using pointers.
Ant.
|
|
|
|
|
u can do it as:
class B;
class A
{
public:
B &test;
//or B *test;
};
class B
{
public:
A test;
};
|
|
|
|
|
hello all,
how shall i create a entry in registry using VC++.
i mean i need to add a key such that my application name shouldnt appear there. i mean there is an entry named "Extensions" in the registry and i need to create an entry {"Demo App"} in that. and then i need to add entries in the newly created.
but the problem with SetRegistryKey() is that it is creating the application name too. but i dont need it. how shall i do so.
ComputerNewton
|
|
|
|
|
int RegWriteKeyValue(HKEY hKeyParent,CString strPath,CString strKey,CString strVal)
{
CRegKey regKey;
DWORD dwKeyCreateMode=REG_OPENED_EXISTING_KEY;
long lRes;
lRes=regKey.Create(hKeyParent,strPath,REG_NONE,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&dwKeyCreateMode);
if (lRes != ERROR_SUCCESS)
return 0;
lRes=regKey.SetValue(strVal,strKey);
if (lRes != ERROR_SUCCESS)
return 0;
// close the registry key
regKey.Close();
return 1;
}
RegWriteKeyValue(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce","Name","value");
It's not a bug, it's an undocumented feature. suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
Thank u very much for ur help.
But it is in ATL. i dont want to use this in ATL.
once again thanks a lot. b'coz of ur reply i got an idea and i did it in SDK mixed with MFC to get my requirement.
Once again thank u very much.
ComputerNewton
|
|
|
|