|
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
|
|
|
|
|
if i have the DWORD for example
DWORD temp;
i want to set the value of each byte seperately how to set it.
i want to get the value of each byte seperately how to get it.
r00d0034@yahoo.com
|
|
|
|
|
to set
DWORD dw = 0;
BYTE a = 2;
BYTE b = 3;
BYTE c = 4;
BYTE d = 8;
dw = a;
dw = dw << 8;
dw |= b;
dw = dw << 8;
dw |= c;
dw = dw << 8;
dw |= d;
to get:
BYTE a,b,c,d;
a = dw & 0x000000ff;
b = (BYTE)((DWORD)(dw & 0x0000ff00) >> 8);
c = (BYTE)((DWORD)(dw & 0x00ff0000) >> 16);
d = (BYTE)((DWORD)(dw & 0xff000000) >> 24);
-c
As always, it's bread and circuses. And while bread is down right now, circuses are way up.
|
|
|
|
|
Nice!
Hey, is it possible to use ASM to get and/or set individual bytes from larger datatype such as WORD, DWORD, etc? Understand this situation, how does ASM performance compared to normal C/C++ solution?
Kuphryn
|
|
|
|
|
Yes, but doing so will not get you anything because the C bitwise operators translate exactly into assmbly instructions like AND, OR, SHL (shift left), etc.
--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
|
|
|
|
|
Okay. Well, ASM concepts and syntax are easier to remember than C/C++. There is not reference required for the most part.
Kuphryn
|
|
|
|
|
|
one question.
when you set the values
a = most significant byte
d = less significan byte
And when you get them
a = less significant byte
d = most significant byte
is this correct?
|
|
|
|
|
|
Just one point (in case Imran is confused)
In Chris L's "set" example, a is the MSByte and d is the LSByte
In his "get" example, he's kinda reversed it so that :-
a is the LSByte and d is the MSByte
Thought I'd mention it here.
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|