|
|
Christian Graus wrote:
Easy - go to Code Guru.
ROTFLMAO. You are so cruel. Keep it up.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
Whatever you are drinking... Can I have some?
"was wir auch tun, wohin wir gehen
die illuminaten sind im system
sie kontrollieren überall
und 23 ist ihre zahl!"
23, welle: erdball
|
|
|
|
|
"The EM_SETCUEBANNER message sets the textual cue, or tip, that is displayed by the edit control to prompt the user for information. For more discussion of this, see the Remarks section.
Syntax:
To send this message, call the SendMessage function as follows.
SendMessage((HWND) hWndControl,(UINT) EM_SETCUEBANNER,(WPARAM) wParam,(LPARAM)lParam);
wParam:
Not used; must be zero.
lParam:
Pointer to a Unicode string that contains the text to display as the textual cue.
Used for:
An edit control that is used to begin a search may display "Enter search here" in gray text as a textual cue. When the user clicks the text, the text goes away and the user can type.
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Using Windows XP Visual Styles.
Message Information:
Header Declared in Commctrl.h
Minimum operating systems Windows XP "
This was taken from the MSDN website. I am trying to implement this into my program but whenever I try to compile my program I get an error "C2065: 'EM_SETCUEBANNER' : undeclared identifier"
I tried to #include "commctrl.h" but it didnt help.
Im using Visual Studio .Net, Windows XP & a MFC7 Dialog Application.
VS automaticly creates a manifest file so that could not be a problem. When I hover the mouse pointer over the 'EM_SETCUEBANNER' text I get a tooltip that says "EM_SETCUEBANNER (ECM_FIRST + 1)"- so it looks like its defined. Realy hope someone can help.
|
|
|
|
|
Look for the 'EM_SETCUEBANNER' in the header file.
Look above it for a #ifdef or #if defined line.
You must define that 'definition' in your C or C++ files before including the header.
Define it before the header is included by stdafx.h if necessary.
Then I think your problem will go away.
C++/MFC/InstallShield since 1993
|
|
|
|
|
Hey all,
Suppose I have a LAN, and I want to run a server application on a machine INSIDE the LAN, behind the gateway machine.
mIRC is an application that does something like that. Without configuring it in any special way, it is possible to send a file to someone through the DCC protocol (according to that protocol, the machine that SENDS the file is the server, and the receiving end is the client that connects to the server).
So - it works for mIRC, but it doesn't work in my application.
I found the description of the DCC protocol online, and I am implementing a similar protocol:
1. I create the listening socket, and bind it with port 0.
2. I check what port the socket was associated with (Windows decides that for me, because I binded it with port 0)
3. I send the port number to the client
4. The client attempts to connect to my machine using the port number I sent it - and it fails, if my machine is not the gateway. BTW - the IP that the client attempts to connect to is the IP of the gateway.
Do you know how it can be done?
Thanks in advance!
Oz
|
|
|
|
|
obe wrote:
3. I send the port number to the client
4. The client attempts to connect to my machine using the port number I sent it - and it fails, if my machine is not the gateway. BTW - the IP that the client attempts to connect to is the IP of the gateway.
Usually all Peer-2-Peer applications do have problems with SNATed/filtered networks.
a) You need a static forwarding on your gateway (for each client inside LAN, yes not really handy and highly unsecure too)
b) Or your gateway is a Linux box which has an IRC module loaded. Then it translates intranet IP:port to external IP:port on-the-fly and back. This must be specific for each protocl, e.g. for DCC protocol (you also might need to adjust your IRC client settings to make use of it).
If somebody tries to connect to your PC your router/packetfilter/firewall receives an 'incoming connection' from internet. One you did NOT establish. Your router doesn't know to which internal host the data should be routed. How should your router know? The data could be assigned to any host/port combination in intranet or meant for nobody at all. If you make an explicit static forwarding for a port your router will be happy. Otherwise your router says "Don't know it, don't like it, good bye!" and the connection is rejected. So far what happens usually.
The IRC module (or iptable module) will AFAIK assign a few special highports and changes outgoing IP:port combinations inside a IRC DCC data stream to IP_external:port_special. Incoming traffic on a "special" highport is then detected and routed to the corresponding client inside the LAN. Please correct me if I'm wrong and this behaviour has changed meanwhile.
Btw, this problem is not IRC specific... that's why there are modules for known protocols, e.g. IRC and FTP.
Gnutella has a neat solution too, so called "pushs" which use already established connections instead of creating new ones (so avoiding the described 'incoming traffic' problem in handshake). However, if two filtered peers hit each other this "push" solution won't work in the end (and most peers are such refering to Gnutella host statistics).
Solutions... many are possible: e.g. IRC module, "pushs", special proxy or a friendly forwarding man in the middle, etc.
|
|
|
|
|
Thanks for the elaborate reply!
I'm not sure I completely understood what you meant, though.
I understand why this issue is problematic (the router not knowing how to handle an incoming connection to a port that it did not create) - but still - this seems to work on mIRC - without doing special configuration to the gateway, or to the mIRC application.
So I figured that maybe when I bind a socket to 0 on an internal machine, the underlying network components realize that it's an internal machine, and notify the gateway of the port number that is given to the socket at the end, so it can play along.
Do you know of a programmatic and general way to work around this issue? Without knowing what gateway software is being used, and without asking the user to configure anything?
Thank you very much,
Oz
|
|
|
|
|
hmmm I'm suprised!
I didn't know that mIRC works reliable with DCCs (on SNATed/MASQed gateways) without having an IRC module or forwarding rules on the gateway. Are you sure that you not rely on the other side to handle incoming connections (one of two envolved peers has to be able to handle incoming connections *)? Are you sure you have no Linux or BSD as gateway (the IRC module is per default installed on most Unix distributions)?
Honestly, I have no idea how you could forward incoming TCP/IP traffic without special treatment. I did run into the same problems when learning about P2P network programming. That's why I tried to understand & explain what happens on a gateway, and which solutions exist IMHO. I would be very gratefull about any additional solutions!
Well, there is one thing left I did forget to mention. Contrary to IRC most (all) games do use UDP as transportation instead of TCP and many gateways have a so called "lose UDP patch". I don't know any details about the underlying mechanism... but somehow the gateway routes incoming UDP datagramms into the LAN and to the appropriate game client. Anyone with more experience here?
As far as I know IRC protocol uses TCP only, RFC 1459 etc[^]. ATM there is no general way (or simple sockets call) to work around this 'incoming traffic' issue.
Hope it helps, Moak
* = If the other peer handles incoming connections, then the problem is omitted. It doesnt matter who creates the connection, once it is established it can be used. If your opponent can't too, your DCC will fail. Relying on the other is always bad, sometimes it works, sometimes it fails.... well you know what I mean, if you have some unreliable friends. *g*
|
|
|
|
|
What do you mean by "IRC module"?
And anyway - the listening port is always different, it's not a predefined port number that can be somehow "enabled" on the gateway machine...
|
|
|
|
|
|
Hello everyone,
I have an MFC MDI app that I am trying to override some of the printing and I am have lots of trouble. I want to not show the printer dialog box and also set the printer (I have access to the HDC). I'm sure this is a relatively easy thing to do, but can't figure it out. I tried searching through old posts, but wasn't able to find anything. Thanks!
|
|
|
|
|
|
Ahh, you beat me to it!
Yes, it should do exactly what he needs.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
I have some number of static global objects,
of which there is one that I want to be
constructed first. Within a translation unit,
it is simply the order in which the objects
appear that determines their order of
construction. But across translation units,
it seems arbitrary.
Is there a practical way to get the linker to
accept a desired order of initialization
in this case? (I use Visual Studio 6)
|
|
|
|
|
As far as I remember the C++ specs say that order of initialization of static objects
is arbitrary. Easiest solution is to create ONE static object that acts as a "factory"
for the others (which gives you control of the order).
"was wir auch tun, wohin wir gehen
die illuminaten sind im system
sie kontrollieren überall
und 23 ist ihre zahl!"
23, welle: erdball
|
|
|
|
|
|
I am trying to decode a TCP stream (from a game). The game works like this:
First you log on with your username and password
Then you choose a lobby (so its kind of more like a chat)
In this lobby you can chat and join games
Now all the text that is sent and received for the chat in that lobby is encrypted, so this is what i did: I went into that lobby while i captured all packets being sent over my network, then i said a line in the lobby and stopped packet capturing, now i have the exact packet containing the data, and the length matches, i said a sentence of exactly 53 bytes and that is the amount of data thats in the packet. But... how do i decrypt this? I don't think its any well-known protocol, and i dont know much about the encryption of tcp connections. Is this impossible (even though i dont believe in impossible things) or could it be worth a shot trying if i knew how encryption worked? Can anyone recommend anything i should read about encryption that might be usefull for my problem? Or can someone even tell me how to do it exactly (lol that would be the best of course :P)?
Anyways thanks for any help you may offer, and if i ever get it decoded i'll write an article about it on CP ;P
Kuniva
--------------------------------------------
|
|
|
|
|
Note: This isn't simple and I will not answer any questions about it...
Goto www.openssl.org[^], download and compile.
Write small app (or use of the test-tools in openssl) and try to connect.
If you are real lucky, client-side authentication is turned off and you should
be able to get the clear-text. If not... well you tried
"was wir auch tun, wohin wir gehen
die illuminaten sind im system
sie kontrollieren überall
und 23 ist ihre zahl!"
23, welle: erdball
|
|
|
|
|
http://ih.esuhsd.org/staff/aielloj/ascii_ebcdic_table.htm
Try looking up the hex values on this chart and see if they make sense.
|
|
|
|
|
errr... no offense but i said it was encrypted not some kindergarten a becomes z, b becomes y encryption scheme.. lol
i actually searched in the data where the same letters were in my sentence and the hexadecimal values weren't the same... so its some kind of variable encryption thingy... lol sorry i dont know anything about encryption
Kuniva
--------------------------------------------
|
|
|
|
|
cool, thanks
Kuniva
--------------------------------------------
|
|
|
|
|
Download etherel, a Protocol Analyzer from sourceforge.net (source and binary)
A. Riazi
|
|
|
|
|
Ethereal IS what i'm using to filter the network traffic... It just marks it as TCP
Thanks anyways
Kuniva
--------------------------------------------
|
|
|
|
|
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window. I want my own GUI or at least no DOS window. The code my friend gave me looks ok but I'w wonderiong if someone could post and example of a "Hello World" with a window\/GUI. Thanks
|
|
|
|