|
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
|
|
|
|
|
|
Hi.
I am a C++ programmer.
I began learning 16-bit ASM and practice 16-bit ASM programming under DOS and MASM 6.x three weeks ago. I am very impressed with ASM and the control and simplicity ASM brings to programming. 16-bit ASM is so simple. Programmers have the most flexibility in terms of program design. I enjoy ASM programming and will definitely continue learning and practicing 16-bit ASM.
I have some basic, but essential, questions on implementing 16-bit, 32-bit, and 64-bit assembly in C++ programs.
1) Under what circumstances in additional to device drivers development do programmers use 16-bit and 32-bit ASM? I am most interested in 16-bit ASM when using ASM only.
2) Under what circumstances do C++ programmers incorporate 16-bit and/or 32-bit ASM in C++ programs? Please be as specific as possible. For example, under what conditions do 16-bit and 32-bit ASM out-perform C++? I am most interested in the Windows environment when using C++ and ASM.
Is it possible to apply 16-bit ASM in C++ Windows programs? Again, C++ does all the messaging. I want to incorporate ASM it is called for.
Thanks,
Kuphryn
|
|
|
|
|
kuphryn wrote:
Under what circumstances in additional to device drivers development do programmers use 16-bit and 32-bit ASM?
IA16 assembler is used mostly for writing bootsector code.
IA32 assembler is used whenever the compiler can't provide the speed, or instructions, needed to perform a given task at a given speed. F.ex. compilers usually don't (never?) generate e.g. MMX code for plain C/C++.
Is it possible to apply 16-bit ASM in C++ Windows programs?
Yes. Ever version of windows up to (not including) Windows 4.0 (Windows 95) was completely 16-bit. Win9x uses a lot of 16-bit code internally, and is actually more of a 32-bit shell on top of a 16-bit OS than anything else. For Windows version based on the NT kernel the only trace of 16-bit code you'll find is AFAIK the boot loader.
Tweaking your question a bit to read "Is it even remotely useful to apply 16-bit ASM ...", the answer becomes: No. Why on earth would anyone want to punish themselves with that horror?
|
|
|
|
|
Okay.
You made a very good point about how recent versions of Windows make little use of 16-bit ASM. I believe 16-bit ASM is good for use in pure DOS and to communicate directly with hardware in pure DOS mode. In that case, how does 16-bit ASM come into effect? Can you use 32-bit or 64-bit ASM to communicate with hardware?
Kuphryn
|
|
|
|
|
kuphryn wrote:
Can you use 32-bit or 64-bit ASM to communicate with hardware?
Since you can express anything in assembler that you also can do with another language (usually with much more work in assembler though), and any Win32 hardware device driver is written in (combinations of) C/C++/assembler, obviously you can communicate with hardware using assembler.
For 64-bit I feel I have to ask: Do you really know anyone even having seen a live Itanium Windows system, much less owns one?
|
|
|
|
|
I'm learning to buid Xtras for Director
with XtraBuilder (that's a very good
tool for beginners) and Visual C++,
before starting studying XDK.
Simply I ask if somebody know if there
is somewhat similar to XtraBuilder for
Mac and Codewarrior. - Many thanks.
|
|
|
|
|
I use VB.NET or VB6 to call a DLL routine which is written in C (WinPCap). It has "bad calling convention" error. I check the C code and found that it has code for EXPORT in def file but it doesn't has "extern..." or "__stdcall" code in calling function. So, I change
BOOLEAN PacketGetAdapterNames(PTSTR pStr,PULONG BufferSize)
to
extern "C" { __declspec(dllexport) BOOL __stdcall packetfunc(PTSTR s, PULONG BufferSize)
.
.
}
I compile the orginal code ('C' Code) without any error but when I compile the new code (add extern and __stdcall) either in C/C++. I got a lot of error such as "missing string", missing ";". Quite Strange. Anyone has idea ?
Orginal C file is in this link:
http://winpcap.polito.it/install/bin/WPcapSrc_2_3.zip
Many Many Thanks
Danny
|
|
|
|