|
Thanks for the docs
it's very detailed, which is hard for me, but i work on it
|
|
|
|
|
Am set a icon on button by
m_Clean.SetIcon(IDI_CLEAN_NO,(int)BTNST_AUTO_DARKER);
when the click event of other button is called am disable this button by
m_Clean.EnableWindow(FALSE)
Button is disabled but icon is disappered.how to display button with icon when that is in disable state.
|
|
|
|
|
janpoo wrote: m_Clean.SetIcon(IDI_CLEAN_NO,(int)BTNST_AUTO_DARKER);
CButton::SetIcon takes one paramter, isn't it?
|
|
|
|
|
SetIcon has a Hicon that you cal use of LoadIcon
|
|
|
|
|
janpoo wrote: Button is disabled but icon is disappered.how to display button with icon when that is in disable state.
have a look at CBitmapButton class in MSDN!
|
|
|
|
|
Well first of all thanks for telling me to buy "Charles Petzold" (Hats off to the author)but im little bit confused that the book was written in 1998 and will it hold true for todays OSs like XP & vista(I hav 5th edition) or is there any latest edition of that.
Further, I wnna know wat to use VC++6.0 or VS2005.
Although the answer would be VS2005 but wont i be illiterate about VC6 or will it cover that too.
Spread wat u Know!
|
|
|
|
|
IMHO you should start with VC++6.0. While MS provides compatibility with the earlier API's many of the API's are deprecated, and are replaced with the new ones. But in your case it won't make a lot of difference and you should be able to run the applications in Charles Petzold on the OS's like XP. On Vista however there could be some administrative privileges etc that would need some tweaking.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: you should start with VC++6.0
AnShUmAn, VC6 compiler is far from being compliant to the Standard C++.
i really don't get the point in advising a beginner into this direction rather that VS2003 or even better VS2005 !
|
|
|
|
|
Are you aware this was your 7000th Message??
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
|
Even I knew it from his link[^]
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
toxcct wrote: Yes[^] :->
:->
|
|
|
|
|
YES! Read the book a few times and LEARN IT. There's alot of new stuff in Windows but the
basics still very much apply. The number of things that have changed or been deprecated is so
small compared to the pain of writing Windows software without understanding the basics.
IMO there's no reason not to use the latest VS/compiler for new application development.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
|
Cmania wrote: Although the answer would be VS2005 but wont i be illiterate about VC6 or will it cover that too.
tryhttp://codeproject.com/cpp[^]
|
|
|
|
|
Hello
I want to allocate memory for a void* pointer inside a function;
i tried to do that by using malloc to the pointer passed as an argument ;
the memory space was not kept after function return;
how kan i do that
thanks
|
|
|
|
|
please show a brief piece of the code you wrote for that...
|
|
|
|
|
the code is too long but :
#define STRUCT struct mystruct
void function (void *input){
....
pointer = (STRUCT*) malloc (sizeof(STRUCT));
//filling in input attributes...
input = pointer;
}
main(){
void *ptr;
function (ptr);
printf("%...", ptr->..........);
}
this work only if i allocate the memory for ptr in the main program
|
|
|
|
|
fx9200 wrote: pointer = (STRUCT*) malloc (sizeof(STRUCT));
why don't you directly write into input ?
input = (STRUCT*) malloc (sizeof(STRUCT));
|
|
|
|
|
i tried it
i had the same result in all cases
|
|
|
|
|
Change this to,
void function (void **input){
....
*pointer = (STRUCT*) malloc (sizeof(STRUCT));
input = pointer;
}
main(){
void *ptr;
function (&ptr);
printf("%...", ptr->..........);
}
|
|
|
|
|
fx9200 wrote: the memory space was not kept after function return;
You need to pass your pointer by reference. Otherwise it will still point at the previous memory location.
|
|
|
|
|
how to pass reference(pointer) by reference ?
please give example
|
|
|
|
|
fx9200 wrote: how to pass reference(pointer) by reference ?
please give example
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
he seems to doing C, not C++... so no reference available (in the sense of C++ understands it). but pointers remain good
|
|
|
|