|
Good point!
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.
|
|
|
|
|
Cedric Moonen wrote: // FIRST if (!functionOne())
Sorry ... my bad, forgot to put the "()" in.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
HI,
How can i get IP adress of my system thru a VC++ application,
thanx in advance..
birajendu
CyberG India
Delhi
India
|
|
|
|
|
you can use GetAdaptersInfo function
|
|
|
|
|
birajendu wrote: How can i get IP adress of my system thru a VC++ application,
Use gethostbyname or getaddrinfo .
|
|
|
|
|
use IPM_GETADDRESS Message
Retrieves the address values for all four fields in the IP address control.
Syntax
To send this message, call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) IPM_GETADDRESS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPDWORD) pdwAddr;
);
|
|
|
|
|
How do I enable out-of-bounds memory checking for dynamically allocated memory (new/delete) in VC++ 2003? /RTC options enable stack-based checks, which I've got turned on, but that doesn't cover heap-based allocations.
|
|
|
|
|
Simply you cannot (AFAIK).
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.
|
|
|
|
|
Well, I was hoping for a configurable option. Overloading operator new and delete is my backup plan, which will work because I only use new/delete.
|
|
|
|
|
Can you do that?
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.
|
|
|
|
|
Of course. Overloading new/delete is part of the C++ Standard. Just tack on some extra bytes (on either side) during allocation and check those bytes before deleting the memory. If a match fails, then something overwrote the memory. Poor-man's solution is to use TRACE() at that point. A stack dump would be nicer. Even better would be the compiler offering the option at compile-time to do all of that without writing any code.
|
|
|
|
|
I didn't know that. thank you.
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.
|
|
|
|
|
The debug CRT does it for you (using sentry bytes I believe).
Try this in a debug build:
BYTE *pBytes = new BYTE[10];
pBytes[10] = 255;
delete[] pBytes;
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
hi i have to display files from a specified drive to a list view control. how to display this with the folder icons.
|
|
|
|
|
Use WIN32_FIND_DATA , FindFirstFile(), FindNextFile() to get the files. For showing the folder icons in list control you will have to create a custom list control.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
For two section of your question do you need to SHGetFileInfo
|
|
|
|
|
i can get all the files and folders but i dont know how to list them in the list view control with the icons
|
|
|
|
|
You must try like this
LV_ITEM LItem2 ={0};
m_pImageList2->Add(Bmp,RGB(100,105,0));
m_ListFile2.SetImageList(m_pImageList2, LVSIL_NORMAL);
LItem2 .mask = LVIF_TEXT| LVIF_IMAGE| LVIF_STATE;
LItem2 .iItem =Item;
LItem2 .iSubItem = 0;
LItem2 .pszText = lpt;
LItem2 .iImage = Item;
LItem2 .stateMask = LVIS_STATEIMAGEMASK;
LItem2 .state = INDEXTOSTATEIMAGEMASK(1);
m_ListFile2.InsertItem( &LItem2);
But I suggest see ListControl section on the codeproject for get full information;)
|
|
|
|
|
hmm yes but i cant understand it. i dont know how to display it. please help me. how to set this info in shfileinfo
|
|
|
|
|
WhiteSky has given you the answer, use SHGetFileInfo(). Have you looked this up on MSDN?
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
deeps_cute wrote: yes i read that but how we can display all those files in listbox not in tree structure. i need it like windows explorer
Arise Awake Stop Not Till ur Goal is Reached.
Gee it is annoying when you type up an answer to a post and you can't post it because the original post has been deleted in the meantime. I guess the poster deleted the post above as he did it under a different ID. And I was about to be helpful too...
Checkout the .... (deleted like your post)
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Is this helpfuls?
SHFILEINFO sfi;
SHGetFileInfo(str,0,&sfi, sizeof(SHFILEINFO),SHGFI_ICON|SHGFI_TYPENAME);
|
|
|
|
|
|
I have a C++ Program. In that I used printf_s. The program did not compile.
What should I include for this program to compile? The code is below.
#include <iostream.h>
#include <stdio.h>
class staticTest
{
private:
static int x;
public:
static int count()
{
return x;
}
};
int staticTest::x = 9;
int main()
{
printf_s("%d \n",staticTest::count());
}
|
|
|
|
|
T.RATHA KRISHNAN wrote: What should I include for this program to compile?
Maybe reading the documentation[^] would help, no ? If you go to the bottom of the page, you'll see that you need to include <stdio>
And, btw, use the code tag when you need to post code. Otherwise we cannot see your include directives.
|
|
|
|