|
//Let string be
char string[]="acsd";
for(int i=0;i
|
|
|
|
|
plz tell me how to convert a char to ascii using vc++?
|
|
|
|
|
you can easily assign the ascii value to an integer variable....
int i;
char c='A';
i=c; // i is now 65.
|
|
|
|
|
Hi,
I would like to create an ActiveX and I would like to resize the window to an specific size when the user tries to resize it. Someone has told me I have to use WM_SIZE adding all the code required inside it.
Which is this code? I have to use GetWindow?
Help please
Thanks a lot
|
|
|
|
|
javi_jmc wrote:
Someone has told me I have to use WM_SIZE adding all the code required inside it.
this can't be TRUE as MSDN state that the application must not send WM_SIZE message to it's WINDOW
javi_jmc wrote:
to resize the window to an specific size
better use api's like [MoveWindow] and [SetWindowPos]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Thanks
But how can i do it? because i want to fix the initial window size of the ActiveX before adding it to the application
|
|
|
|
|
Hi All,
I want to write software modems(VC++/MFC/SDK).
Please let me know if any algorithm or links are available with you.
Thanks
|
|
|
|
|
I have a situation similar to following:
int b;<br />
<br />
int afunction() {<br />
int b = 0;<br />
...<br />
}<br />
I need to access global b in afunction?? C does not have :: operator. I cannot change the identifier of both local and global variable b. Is there a way around??
ARSALAN MALIK
|
|
|
|
|
Arsalan Malik wrote:
I need to access global b in afunction??
No, there is no such operator in C language.
Arsalan Malik wrote:
Is there a way around??
May be you can write a getter function for the global b.
suhredayan There is no spoon.
|
|
|
|
|
Arsalan Malik wrote:
Is there a way around??
Yes, don't use b in both spots.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Try this:-
int b;
int afunction() {
extern int b = 0;
...
}
|
|
|
|
|
Try this
int b;
int afunction()
{
int *ptr= &b;
int b = 0;
.....
}
|
|
|
|
|
could anyone plz tell me as soon as possible how to convert an unsigned char to const char using vc++ code?
|
|
|
|
|
nehathoma wrote:
could anyone plz tell me as soon as possible how to convert an unsigned char to const char using vc++ code?
I believe we can do it that by using normal C++ code.
I think you are looking for conversion of unsigned char string to signed char string instead of unsigned char to signed char.
Here anyways, this Task can be accomplish by using typecasting! (if you don't know what exactly the type casting is? please refer to your TEXT book!)
unsigned char *unChar=(unsigned char*) "unsigned string";
char sigString[100];
strcpy(sigString,(const char*)unChar);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
ThatsAlok wrote:
I believe we can do it that by using normal C++ code.
I think you are looking for conversion of unsigned char string to signed char string instead of unsigned char to signed char.
Here anyways, this Task can be accomplish by using typecasting! (if you don't know what exactly the type casting is? please refer to your TEXT book!)
//typecasting By direct initialization
unsigned char *unChar=(unsigned char*) "unsigned string";
//second Unsigned char string to signed char string
char sigString[100];
strcpy(sigString,(const char*)unChar);
Which C++ book did you see the type casting as above ?
suhredayan There is no spoon.
|
|
|
|
|
I asked her to get concept of Typecasting by reading the Book.
Anyways some books taught you typecasting by using macro like static_cast , reinterpret_cast and dyanamic_cast
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
ThatsAlok wrote:
Anyways some books taught you typecasting by using macro like static_cast, reinterpret_cast and dyanamic_cast
Dear Alok,
static_cast, reinterpret_cast etc are not macros. They are casting operators in C++ language.
suhredayan There is no spoon.
|
|
|
|
|
suhredayan® wrote:
static_cast, reinterpret_cast etc are not macros. They are casting operators in C++ language.
then i am really sorry!, I take back my words !, Now i have to refer TEXT BOOK
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
but thats not working for me Alok!!!!!!!!!1
|
|
|
|
|
Hi Neha,
Could you please post some code snippet excatly where u facing problem!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
CString tr=m_edit1.Left (m);
tr.Delete (0,m-1);
tr.Format("%d",ch);(this is where i am stuck)
c i want to convert the string "tr" to char.is there any problem with the format string i have used.....
the data type used for 'ch' is unsigned char......
data =(double)ch;
|
|
|
|
|
nehathoma wrote:
CString tr=m_edit1.Left (m);
i smell some problem here!
//i don't understand use delete and format here!
tr.Delete (0,m-1);
tr.Format("%d",ch);(this is where i am stuck)
First you delete whole string except last character from tr then you copy a new string from CString::Format
please clarify what exactly you want to do here!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
u know why i used the stmt:
CString tr=m_edit1.left(m)
to retrieve th charachters in the string one by one....
tr.delete("%d",ch)
is used to convert the retrieved characters one by one to ch.....
|
|
|
|
|
nehathoma wrote:
c i want to convert the string "tr" to char.is there any problem with the format string i have used.....
CString::Format() function is used to write something into CSting object. From your post I feel you want to convert tr to character. With the assumption tr will have only one character at that time.
try this then:
ch = tr.GetAt(0);
suhredayan There is no spoon.
|
|
|
|
|
thank u i got that with what u said
|
|
|
|