|
Hi,
In a dialog box I am having two sets of radio buttons, in separate group boxes, but then they are all behaving the same...How do I make them behave separately.
I am a beginer and this is a big doubt for me. Pls help
Arthi
|
|
|
|
|
In resource editor set Group flag to first radio button in each group (make sure that they are in in good order in tab order)
Pavel
Sonork 100.15206
|
|
|
|
|
You need to set up group flags. You can do this programatically or if your using the resource editor you can set it in the properties. Just set the first radio button in each set of two with a WS_GROUP attribute.
Regards,
Brian Dela
|
|
|
|
|
Hi!
currently I'm programming an app that sends packets to (game)servers. Some packets look like this:
"\x12\x02trb2" , which means that they contain hexadecimal values.
If I define them in my program like this:
LPCTSTR PACKETS[NUMPACKETS] =
{
(...)
"\x12\x02trb2"
};
they get sent correctly. But I want my program to be more dynamic and let the user specify own packets that he wants to send to a server.
Of course, when the user types "\x12\x02trb2" into an edit box the packet will not be sent hexadecimal but as a complete string.
So I tried to replace the most important escape sequences in the edit box like this:
string.Replace("\\0", "\0");
string.Replace("\\t", "\t");
string.Replace("\\x", "\x");
string.Replace("\\n", "\n");
string.Replace("\\r", "\r");
All lines conpile fine, except the 3rd one. The compiler error is (translated from german):
error C2153: Hexadecimal constants need to contain at least one hexadecimal number
Does anybody know how I can get this to work?
thanks in advance
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|
|
\x means nothing, \x12 is a character encoded with 12. You need to replace "\\x12" with '\x12'.
Pavel
Sonork 100.15206
|
|
|
|
|
thanks...how many numbers may follow after \x?
I will write my own parsing routine then
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Two. I'm not sure how's with it in UNICODE strings, but if I remeber it good, it's done using two following \x with two digits.
Pavel
Sonork 100.15206
|
|
|
|
|
Currently I'm writing a parser, but I have one problem:
if(d1 != -1 && d2 != -1)
{
numbers.Format("%i%i",d1,d2);
replacechar.Format("\\x%i%i",d1,d2);
CString digits = string.Mid(findx+2,2);
int iDigits = atoi(digits);
newchar.Format("%x",iDigits);
string.Replace(replacechar, newchar);
}
replacechar is \x12 , this is correct.
But now I need to convert it to hexadecimal:
iDigits is 12 , this is correct as well.
But newchar.Format("%x",iDigits); doesn't convert it correct into hexadecimal, since I don't get any answer from the server.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
You are treating the hex number like a decimal one in atoi.
You need to convert it to decimal instead - then you get the needed character code.
Pavel
Sonork 100.15206
|
|
|
|
|
Could you tell me how to do it? I've never done it before
thanks
modified 12-Sep-18 21:01pm.
|
|
|
|
|
int res;
sscanf("12","%x",&res);
Pavel
Sonork 100.15206
|
|
|
|
|
well ok, I have converted it to my needs:
<br />
int res;<br />
sscanf(digits,"%x",&res);
Where do I put this line in my sourcecode and what shall I do with the result "res"?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
str.Replace(replacedstring,CString(TCHAR(res));
Pavel
Sonork 100.15206
|
|
|
|
|
|
My pleasure. Killing time during some boring backup and install job at CP
Pavel
Sonork 100.15206
|
|
|
|
|
Gregor S. wrote:
string.Replace("\\x", "\x");
The problem is that "\x" by itself in code is illegal since it is meaningless. You'll need to use Find("\\x") to get the location of a "\x" sequence, then parse the following characters (I think it's 2 chars max, check MSDN to be sure), then replace the whole lot with one byte. So the four byte sequence "\\x12" would become one 0x12 byte.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
For WNDCLASS STRUCTURE if i want my window to have blue color.what should i do.
Can i use colorref to pass value to getstock object.
wndclass.hbrbackground=Getstockobject()
|
|
|
|
|
If you want a blue background use this:
wndclass.hbrBackground = RGB(0,0,255);
-Dominik
|
|
|
|
|
Sir, I am in a big problem. I have made chat application using SOCKET. Now what is the situation is my application runs well when both the side have direct IP address. But if one of the side is running under PROXY server then connection is not established. So help me to make these type of connection.
C.R.Naik
|
|
|
|
|
Maybe you can take advantage of a technique called HTTP tunneling. Alex Turc describes it in his article HTTP Tunneling[^].
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I found two CP classes for memory mapping but no description or background. Basicallly I have a VC client and a VB COM dll. The dll will be writing to shared memory and the VC client should read it instantly. What informs the process that the memory is ready for reading? There wont be any atual file on disk or anything. I just want to send an integer over from the dll tothe client. I tried sendmessage but it didnt work for some reason. So I'd appreciate it if you can point me to some links where they do what I want.....
|
|
|
|
|
Shared memory is a memory, that can be mapped to many processes adress space, thats all. Synchronization between processes using it is in your hands.
nss wrote:
I just want to send an integer over from the dll tothe client
That's really not optimal to use shared memory to do it. If you can't use sendmessage for it, try to send an COM event from your COM object.
Pavel
Sonork 100.15206
|
|
|
|
|
You can use named events (see CreateEvent ): When data is written the DLL can just set it and all the app has to do is WaitForSIngleBoject for the event.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello everybody
I want to use Internet Authentication Service But AuthIf.h header file is not in my VS 6 package,where can I find it & its libery files?
tnX alot
Iman Ghasrfakhri
|
|
|
|
|