I am writing a P2P chat application. It allows two persons to communicate with each other over the internet using their IP addresses. The application works fine when both users are directly connected to the internet. but if one user is behind a firewall or proxy, the application does not connect. I understand that I have to bypass the proxy using SOCKS protocol. I want to ask is there some class or other method, that does this for me, that is, any implementation of the SOCKS protocol. I am using Visual C++ 6.0.
hy, i have a virtual function in a class. i must go sure, that every class who is inherited from this class overwrites this function, otherwise a warning shoud occur at runtime, or something like that. is this possible??
yes, but what, if i make a pure virtual function (abstract class) then derive a class from it, and implement this function. now i derive a class from this class, and forget to overwritte this function, how will i know?
Any function has its start address. So you can check whether the start address of the function in the derived class is the same as the address of the function in the super class itself. If so, you could fault on runtime.
It has some difficulties, and some knowledge of vtables seem to be handy here, but I think it is in the direction you should be thinking.
Hey... Got a question about detecting debug vs. release configurations. I am working with an app at work that gave me an assertion error the other day. It included the filename and the line number in the error message. This would mean that the EXE we got from the vendor was compiled with DEBUG flags on. (I'm sort of a newbie (6 months as a convert from VB6).)
My question is... is there any way to tell whether an exe or dll was compiled with Win32 Debug configuration without opening in a hex editor and looking for extra symbols? (I'm trying to see if I can automate the process for a software test team.)
one thing i would do is that open the exe or the dll with dependency walker and find anything that depends on debug dlls like mfc42d.dll or mfc42ud.dll if it does then this binary was build in debug version.
Well if you want, you can search on the net for Windows PE file Specification, and according to it ".exe" file compiled with debug information will have ".debug" section. If you find this section, this means your ".exe" file has dubug information included.
I have still two little questions.
I can restart, stop, pause the application by using the service control manager. Are there somehow some messages sent to the program so i can do some additional work . (for example, reboot a service which is minimised to the task bar .. two icons in the task bar) If you move with your cursor above it, one will disappear. But it is not nice to see two icons
Help me to change the account type of current user in Windows XP dynamically through my application. (ie. Normal user to Administrator or viceversa)
Provide me is there any demo projects to download...
1. You aren't specifying a server, so this will assume that the lpBuffer is an account name on the local machine.
2. Is the executing account sufficiently privileged (see docs on NetUserSertInfo).
3. When you say the value of the last parameter is 997, have you tried testing it against values like USER_PRIV_INFOLEVEL or USER_PRIV_PARM?
(How do you know it's 997, you're passing in NULL, so it doesn't give you the value?)
I've done some work with C# and one of the things I really like was the fact that I could have the same handler for many different controls on a form. For example if I had five buttons and an event handler called OnButtonClick I could setup every button to call that same handler. Is it possible to do something like this in MFC? If so how? I have a bunch of edit controls that all need to do the same processing after losing focus and I'd rather have one function for them all instead of having to have a bunch of handlers that do that exact same thing. Thanks in advance for the help.
I just thought of something...would this be as simple as adding a message map entry to map the edit boxes I want to use the function to that function?
Yeah, you can have one handler handle as many messages as you like. To get the HWND of the caller, you'll need to look at the LPARAM of the message, which for WM_COMMAND is the HWND of the control that sent the message: GetCurrentMessage()->lParam