|
Hi,
I want a custome button in which the top left and right border are visible i.e (non transparent)
but the bottom border border should be transparent not visible so that it can look like a tab control
Can any one give me code for this.
Thanks & Regards.
Dhiraj Kumar Saini
|
|
|
|
|
Use an owner-drawn button. You can make it look any way you want.
|
|
|
|
|
hi,
Can u just help me out how use an owner draw button.
Thanks and regards.
Dhiraj Kumar Saini
|
|
|
|
|
|
Did you see Button section on the codeproject?
|
|
|
|
|
Hi,
Yes I hace seen button section on the codeproject.
There are severla custome button codes available but not the kind which i want where the side and upper border is visible and the bottom border is not visible.
Kindly help me.
Thanks & Regards.
Dhiraj Kumar Saini
|
|
|
|
|
Actually i want to know that How can i Make a setup of MFC(VC++) in visual studio 6?
Also I want to add a flash screen at the beggning. Can any one help.
|
|
|
|
|
Sk Mohiuddin wrote: ...How can i Make a setup of MFC(VC++)...
Please explain.
Sk Mohiuddin wrote: Also I want to add a flash screen...
Are you referring to a "splash screen?"
"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 question has only just been asked, and I suspect by you.
Search for "Splash Screen" && !FlashScreen...
The answers were clearly given. You do realise that it's not a picture of a search button that we have here?? It is in fact a fully functional bells-n-whistles Search Button, that strangely enough lets you search for things.
|
|
|
|
|
|
What is wrong in this strcpy()?
I tried this function call, no compile time errors, but results in error during runtime.
What could be the problem in that function call?
char *s= "TEST";
char *s1= NULL;
char * s_cpy(char * s,char * s1)
{
char * p=(char*) malloc(strlen(s));
p=s;
printf("%s\n",p); // prints TEST
printf("%s\n",s1); // prints <null>
printf("%s\n",s); // prints TEST
strcpy(s1,p); //error, test.exe has encountered a problem
return s1;
}
|
|
|
|
|
Member 5502879 wrote: printf("%s\n",s1); // prints
Prints what? Junk? Zero? Null?
Member 5502879 wrote: strcpy(s1,p); //error, test.exe has encountered a problem
You never allocated memory to s1, but are trying to write to something to it.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
I am sorry for tat.
Since i have already set
char *s1=NULL;
printf("%s\n",s1); // prints NULL
|
|
|
|
|
If you're calling s_cpy() function with s, s1 (global variables i.e.
char *s= "TEST";
char *s1= NULL; ) the formal parameter s1 will hold NULL (invalid pointer) which makes strcpy() crash.
The prototype for strcpy() is
char *strcpy( char *strDestination, const char *strSource);
Passing invalid pointer at any of the parameter to strcpy (or any string function taking char *) will crash the program.
|
|
|
|
|
Even when i change s1 to
char *s1="TEMP";
strcpy(s1,p); // resulting in error.
|
|
|
|
|
char *s1 = "TEMP" defines the char pointer to constant "TEMP", of which you cann't change the value. which makes strcpy() fail.
|
|
|
|
|
Member 5502879 wrote: char *s= "TEST";
char *s1= NULL;
char * s_cpy(char * s,char * s1)
{
char * p=(char*) malloc(strlen(s));
p=s;
printf("%s\n",p); // prints TEST
printf("%s\n",s1); // prints
printf("%s\n",s); // prints TEST
strcpy(s1,p); //error, test.exe has encountered a problem
return s1;
}
Good C tutorial needed.
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]
|
|
|
|
|
One suggestion
Member 5502879 wrote: char * p=(char*) malloc(strlen(s));
p=s;
you allocating buffer and assigning some other pointer to p again.
this will cause memory leak.
Regards,
Sandip.
|
|
|
|
|
Even if do not create 'p' and directly copy s to s1,
strcpy(s1,s);
im still getting the same error.
|
|
|
|
|
Try allocating memory to s1 before you copy stuff into it and then tell if it crashes. If it doesn't, well, guess why.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
I did not answer you why it crashes..
others have already told you the reason.
I just pointed the mistake.
Regards,
Sandip.
|
|
|
|
|
try allocate memory like this:
char * s_cpy(char * s,char * s1)
{
char * p =(char*) malloc(strlen(s)+1);
s1 = (char*) malloc(10); //use this!!!!
p=s;
printf("%s\n",p); // prints TEST
printf("%s\n",s1); // prints
printf("%s\n",s); // prints TEST
strcpy(s1,p); //error, test.exe has encountered a problem
return s1;
}
don forget to free them up later or you will encounter memory leak...
|
|
|
|
|
auralius wrote: char * p =(char*) malloc(strlen(s)+1);
s1 = (char*) malloc(10); //use this!!!!
p=s;
And what's the point of doing the above?
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]
|
|
|
|
|
allocating memory so i won't be a NULL pointer anymore...
|
|
|
|
|
char * p =(char*) malloc(strlen(s)+1);
s1 = (char*) malloc(10);
p=s;
allocating memory for p and then setting p=s; make no sense to me.
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]
|
|
|
|