|
Rajesh R Subramanian wrote: In Mumbai, we use the CHiggsParticlesEx* class for that purpose.
You're lucky. The Cern Library 2008 we've (a beta release), is broken here and there, the namespaces being soooo polluted: FindTheDamnedHiggs function, for instance, had collision troubles.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Do you know what MFC is? Why would it care about such a specific thing?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Veandhan wrote: I am developing a chat server.
I need to limit the number of connections from a client.
Immediately after you accept a connection, find out the IP address of the other machine and disconnect it if it is already connected.
Veandhan wrote: Is there any API / Sample code available?
Chat Server sample from MSDN[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks Rajesh....
I have seen that link......
Basically i need a program which is independent one (not belongs to my server application) that should drop the incoming messages before it reaches my server application.
Is it possible?
Thanks,
Veandhan
modified on Wednesday, August 26, 2009 10:31 PM
|
|
|
|
|
I do not understand the need for such a thing. Ideally, the server itself must be doing this.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
The thing is i just want to restrict the number of connections from a IP without server's help. My application should sit between the port and the server application. As for as i know, there is some windows driver level functions are there to do this. But i am not able to find out.
|
|
|
|
|
Veandhan wrote: The thing is i just want to restrict the number of connections from a IP without server's help. My application should sit between the port and the server application.
That's even more confusing. Do you need to write a firewall?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
yes. Kind of firewall only i need. But it should allow only 5 connections from a client and deny the connection request if it exceeds 5 connections.
|
|
|
|
|
Veandhan wrote: yes. Kind of firewall only i need. But it should allow only 5 connections from a client and deny the connection request if it exceeds 5 connections.
Limiting connections and building up rules are not going to be difficult for you. Writing the firewall is what is more difficult and I do not think that this is a question that can be answered in forum posts such as this.
Take a look at the following open source firewall projects, which might be of help to you:
http://sourceforge.net/projects/firewallpapi/[^]
http://sourceforge.net/projects/tdifw/[^]
http://wipfw.sourceforge.net/index.html[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
ya... you are correct. Writing firewall is difficult and building up rules are not difficult.
Those open source firewalls drops entire packet from a given ip but what i need is to allow 5 sessions from a IP and deny after that.
|
|
|
|
|
Veandhan wrote: but what i need is to allow 5 sessions from a IP and deny after that.
Well you need it, so you build it. I've given you links to open source projects, so go ahead and modify any of those to suit your requirements. Where is the problem?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
The problem is that they are blocking the given IP using a "RULE". But no rule is available to allow upto given number of connections and block afterwards.
It seems IpFltDrv.sys file is accessed to block/unblock ip using some IOCTL codes. But codes are there for full blocking.
Is there any IOCTL code available to block partial blocking?
|
|
|
|
|
Veandhan wrote: The thing is i just want to restrict the number of connections from a IP without server's help.
Not possible since the server is the only thing that disparate connections have in common. For example, if you were limiting the connections to just one and you connected from where you are, how would my computer know to deny my connection to the server?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hello everyone!
When i'm typing in a richedit 1/2 and than space i want to get the horizontal fraction . is it possible ?
Thank you.
Doina.
|
|
|
|
|
Probably, if you add suitable event handlers that look at the text that's just been entered and perform the same activities as AutoCorrect in Word.
But it's likely to be a fair amount of work.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
ok now i have another 2 problems
1.I want to set the space between characters, so, i can save the value in the sSpace from the CHARFORMAT2 struct but "sSpacing
Horizontal space between letters, in twips. This value has no effect on the text displayed by a rich edit control; it is included for compatibility with Microsoft WindowsText Object Model (TOM) interfaces. To use this member, set the CFM_SPACING flag in the dwMask member. "
what can i do to display the text in the richedit with different space between letters(like in word).
2.how to display overlined characters.
is there a method to do all this o should i use something else then rich edit to implement all this?
thank you
Doina.
|
|
|
|
|
If you wanting to do richer typography (as it seems you are), then the richedit control is probably not the thing to use.
In Windows 7, DirectWrite[^] is probably what you'd want to use.
I know WPF gives you pretty good text layout capabilities (but that's .NET, of course).
Otherwise, I think you're left with working out where all the characters should be positioned yourself and outputting them yourself.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
thanks for the reply....
i think i'll have to change my entire application
so i have a lot of work to do
|
|
|
|
|
tell me one thing if we use like
int a=045;
and print these value of variable then output is 37 why?
|
|
|
|
|
kumarashoka wrote: and print these value of variable then output is 37 why?
Without seing your code, it is impossible to tell...
|
|
|
|
|
i've done
int i=045;
TRACE("i=%i");
and it display i=37 in the output window; it's probably a conversion, but I cannot find any reference to why, but I'm certain I've seen this already here on this forum.
found it it's an OCTAL conversion : http://msdn.microsoft.com/en-us/library/00a1awxf%28VS.80%29.aspx[^]
This signature was proudly tested on animals.
|
|
|
|
|
Because in C and C++ (and maybe Java and C# - I don't know), starting a literal number with zero tells the compiler you're using base-8 (a.k.a. Octal).
But printf outputs (by the way you've used it) in base-10 (decimal).
Now 045 (to the compiler) == (4 * 8) + 5, which is 37 in decimal. That's why 37 is printed out.
To set a to the value 45 (decimal), use this code:
int a = 45;
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
in c language we can run the program without including the header file but in c++ we can not run the program without header files,why?
|
|
|
|
|
kumarashoka wrote: in c language we can run the program without including the header file but in c++ we can not run the program without header files,why?
Which header file, which program ?
Your question is very unclear...
|
|
|
|