|
|
GetTcpStatistics()
GetIPStatisticsEx()
suhredayan There is no spoon.
|
|
|
|
|
These return the number of segments / datagrams and not the number of bytes transmitted / received which is what ISPs quote.
|
|
|
|
|
if i add function sprintf(...), the com can not be compiled with error "unresolved external symbol _main".
if i remove the function (one call in one line), the com is compiled without any problem.
i never change any #include
why the sprintf() causes a main() function error?
confused. how to solve the problem?
thx
includeh10
|
|
|
|
|
have u included following
#include <stdio.h>
char buffer[200], s[] = "computer";
int j;
/* Format and print various data: */
j = sprintf( buffer, "\tString: %s\n", s );
Hope this helps
Jetli
Constant Thing In World Is Change.
|
|
|
|
|
what are u talking about?????????
includeh10
|
|
|
|
|
includeh10 wrote:
if i add function sprintf(...), the com can not be compiled with error "unresolved external symbol _main".
Hello Sir,
here is the solution:-
http://www.codeproject.com/useritems/SimpleATLCom.asp?df=100&forumid=124516&mpp=50&select=1034086#xx1034086xx
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
|
Hello ,2 everyone
I had a problem .
I want to
accept multiple connections on the same port.
Perhaps I could use a master Winsock control and on the DataArrival event,
somehow spawn a child Winsock thread and delegate the event to it. How?
Any hint would be helpful.
Can i have a sample code
Thanks!
Rahul Agarwal
|
|
|
|
|
there are many tcp/ip samples in VC disks, i think the best way is to start from a sample because it is hard to say all you need in a few of lines.
includeh10
|
|
|
|
|
You will fins a lot of help about client server development in this article I am sure and if something is unclear to you just ask me.
http://www.codeproject.com/internet/NetworkAdmin.asp
thanks
gabby
|
|
|
|
|
I want to open a logical drive from one program in write mode and then
I want to open the same drive in read mode from some other program
without closing it from first program.
I tried doing this with CreateFile but it didn't allow me do this. It
allows this on a file but not a logical drive.
Are there any flags available to enable this or is there any other
function available which I can use to accompalish my task.
Thanks in anticipation.
|
|
|
|
|
u want to CreateFile("c:" ,...) ?
i think the function can not be used in this way according to VC help.
includeh10
|
|
|
|
|
includeh10 wrote:
u want to CreateFile("c:" ,...) ?
i think the function can not be used in this way according to VC help.
Sure it can. Read the Disk Devices section. The format is:
CreateFile("\\.\C:", ...);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I know how to open drives using createfile, it surely is possible.
What i want to know is how can i open the same drive in read mode when another program is already having that opened in write mode?
|
|
|
|
|
Since you did not actually post your code, I am guessing that maybe you did not set the sharing permissions correctly?
Your program opening for read must allow at least sharing in open for writing so other program can open the file for writing.
Likewise, the progrma opening the file for writing must allow at least sharing for read, so the program opening for reading can open the file.
At least look into the sharing permissions and try again.
|
|
|
|
|
How do i programmatically create a system restore point and then later restore from that point on
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
|
Thanks a bunch
looked all around couldn't find em
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Hello! Dear friends, I need some help at creating service which will work with serial ports (read information from COM1, save it on HD & write to COM2). If somebody have any sources or any information on this topic, I`ll be glad to any opinions & advises.
Thank you!
Best regards, ILIA.
|
|
|
|
|
Reading and writing to a serial port is the same as reading and writing to a file. Instead of using a file name you use COM1: for reading and COM2: when writing.
Look here at MSDN[^]
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Hi everyone,
I need to know if there is a better way to swap variables values in assembly code. I have a thread that sort some variables and I wanted to make it as fast as possible. Also, I wanted to do it in assembly code just to learn a little about it. It is my first attempt in assembly code so apologize for mistakes. If you know how to do it in a better way, let me know! The code you see below works great but I'm sure we can do that in a more "fancy" way.
This how I call the function :
UltraSwap( &Var1, &Var2 );
Then this is the function in assembly code :
#pragma warning (disable:4035) // disable warning 4035 (function must return something)<br />
<br />
_inline PVOID UltraSwap( LONG* a, LONG* b ) <br />
{ <br />
LONG x = *a;<br />
LONG y = *b;<br />
__asm mov eax, x<br />
__asm mov ebx, y<br />
__asm mov x, ebx<br />
__asm mov y, eax<br />
<br />
*a = x;<br />
*b = y;<br />
}<br />
<br />
#pragma warning (default:4035) // Reenable it
The only thing I don't understand is that I can't move *x or *y into eax and ebx respectively. I had to declare two local variables to achieve that. I think that just declaring that will take some times. I didn't tested what's the difference in time between swapping two variables in C++ code and in assembly because I didn't know how to, since GetTickCount() isn't too much reliable and not so much fast.
Let me know if you guys find something!
Have a nice day!
Stef
Progamming looks like taking drugs...
I think I did an overdose.
|
|
|
|
|
Stephan Poirier wrote:
_inline PVOID UltraSwap( LONG* a, LONG* b )
{
LONG x = *a;
LONG y = *b;
__asm mov eax, x
__asm mov ebx, y
__asm mov x, ebx
__asm mov y, eax
*a = x;
*b = y;
}
Can the local variable be avoided like this ?
_inline PVOID UltraSwap( LONG* a, LONG* b )
{
__asm mov eax, dword ptr [a]
__asm mov ebx, dword ptr [b]
__asm mov dword ptr [a], ebx
__asm mov dword ptr [b], eax
}
suhredayan There is no spoon.
|
|
|
|
|
how about
__asm mov eax, x<br />
__asm mov x, y<br />
__asm mov y, eax ?
For swapping only three variables/memory places are needed.
Hope this helps.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
V. wrote:
__asm mov x, y
That is not a valid assembly language statement. You always require a register for mov instruction AFAMK.
suhredayan There is no spoon.
|
|
|
|