|
micutzu wrote: but I am trying to find a way to determine if there is a possible to find our which Greek character is assigned to -50 (if there is such a possibility).
That entirely depends on the text encoding. Which charset is the webpage you are working with? If it is Windows CP 1253 (Greek), you can find out by setting the codepage of your console window to 1253 and then printing it out. For -50 (ie 206 in unsigned form) it should be greek capital XI: Ξ
|
|
|
|
|
Naveen R wrote: CString cstext = L"03C5";
naveen, be careful, write this :
CStringW cstext = L"03C5"; or
CString cstext = _T("03C5"); but don't mix the two styles.
apparently, you're using wide characters in all the rest of your code, so i'd say use the former...
|
|
|
|
|
but CString have both constructors
CString(LPCWSTR lpsz)
CString(LPCSTR lpsz)
Any way I did so because he said( in his previous post) his project is UNICODE define...
nave
|
|
|
|
|
Naveen R wrote: but CString have both constructors
this is not acceptable argument, because, if the application is not defining UNICODE macro, even if you initialize your CString with a LPCWSTR, the string will be casted into ANSI string.
BTW, i doubt of this information. actually, CString gets a LPCTSTR, which is transformed into LPCSTR or LPCWSTR depending on unicode definition
Naveen R wrote: Any way I did so because he said( in his previous post) his project is UNICODE define...
yes, but then prefer using CStringW. imagine the case when someone else has to maintain the application, or develop the dual possibility of having the application running both ansi and unicode... your code must be flexible, not only "aware"
|
|
|
|
|
toxcct wrote: if the application is not defining UNICODE macro, even if you initialize your CString with a LPCWSTR, the string will be casted into ANSI string.
Even if UNICODE is defined, I am expecting only ANSI characters in that statement.
toxcct wrote: yes, but then prefer using CStringW
Whats is this CStringW? I didnt find any such class in vc6. I havent worked in later verions of visual studio. Is it a new class added to the MFC in later verions of visual studio?
nave
|
|
|
|
|
char is a signed data type.
You have to use unsigned char in order to get the character values above 127 (decimal) right, such as:
unsigned char v;
for (i=0; i {
v = (unsigned char) buf[i];
}
There is a compiler option (/J ?) that defaults char to be unsigned.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
If you just want char to be unsigned, set the compiler option /J.
|
|
|
|
|
How could i make a Combo box readonly(user can not write in the combo box) in design time? How could i make a Combo box readonly(user can not write in the combo box) in run time?
|
|
|
|
|
|
Thanks
|
|
|
|
|
reza matinnejad wrote: How could i make a Combo box readonly(user can not write in the combo box) in design time?
By using the WS_DISABLED style.
reza matinnejad wrote: How could i make a Combo box readonly(user can not write in the combo box) in run time?
By calling EnableWindow(FALSE) .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
reza matinnejad wrote: How could i make a Combo box readonly(user can not write in the combo box) in design time? How could i make a Combo box readonly(user can not write in the combo box) in run time?
use combo list
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Hey all,
I'm having a problem with an MFC program using CSockets. What i'm trying to do is have a connection to a server (that won't be my own creation) which can reconnect or attempt to reconnect if the connection is ever lost. The problem I have is if the address doesn't exist the application seems to pause and become unresponsive when trying to connect. Which is fair enough, but how do I prevent the connect if the address doesn't exist or isn't ready to connect because the program will be automated and does other stuff between connections.
Thanks in advance,
Chris
|
|
|
|
|
cant you issue an icmp/ping to see if the address is out there before you attempt to connect to it ? .. it seems that this unresponsive behaviour is common in network apps
'g'
|
|
|
|
|
yeah thats what I was thinking, could you point me towards the ping commands please? I had a look yesterday but was unable to find a suitable example.
Thanks
|
|
|
|
|
|
I would suggest looking into non-blocking sockets, or a worker thread to block on the connect (and retry) for you.
Be careful relying on Ping - there are firewalls out there that can be configured to ignore ICMP Ping packets, so relying solely on Ping is not a good idea, IMHO, especially if the server is not yours, implying that you do not have that much control over its connectivity.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
hi,
Can anybody tell me about .aps file like what it is and uses???
Siddharth
|
|
|
|
|
Hi,
I don't know anything about the format but I found this on a Microsoft page :
"The Resource Editor generates and uses a .APS file. This file contains a binary format of the resources. The Resource Editor loads the resources from this file to reduce the time required to load them."
Hope this helps,
Chris
|
|
|
|
|
siddharthsan wrote: Can anybody tell me about .aps file like what it is and uses???
APpStudio
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
siddharthsan wrote: Can anybody tell me about .aps file like what it is and uses???
http://www.wotsit.org/search.asp?s=windows
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Hi,
Can anybody tell about .aps file like what it is and it's use???
|
|
|
|
|
|
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&select=1905445&df=100&mpp=50&fr=58#xx1905445xx
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
I have written a reference class for one of my classes. It implements reference counting for that class and that's pretty much it. I have written a cast operator to the class type it references, but the compiler does not use that operator implicitly, so whenever i want to access the referenced object, i have to do an explicit cast (or call a method like getObject()). How can i prevent that ?
Here some code to illustrate my problem :
class MyClassReference;
class MyClass
{
public:
void doStuff();
static MyClassReference getInstance();
~MyClass();
private:
friend class MyClassReference();
MyClass();
void addReference();
void removeRererence();
int m_referenceCounter;
};
class MyClassReference
{
public:
MyClassReference(MyClass &object);
operator MyClass &();
~MyClassReference();
};
This is just the principle, feel free to comment on it.
wbr
Brainley
|
|
|
|