|
If you badly want to make it a service, you can use native Winsock instead of the MFC sockwet classes
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
Nish [BusterBoy] wrote:
If you badly want to make it a service, you can use native Winsock instead of the MFC sockwet classes
I will plan to rewrite the classes as soon as I get a running version, I'll just make the service version then.
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
01001001 00100000 01010000 01100001 01100100 00100000 01001101 01111001 00100000 01010000 01101111 01110011 01110100 00100000 01000011 01101111 01110101 01101110 01110100
|
|
|
|
|
How can I close a port progmatically? I want to close port X so when someone tries to access X it doesn't respond (like stealth mode).
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
01001001 00100000 01010000 01100001 01100100 00100000 01001101 01111001 00100000 01010000 01101111 01110011 01110100 00100000 01000011 01101111 01110101 01101110 01110100
|
|
|
|
|
Only if a socket is bound to a port can someone connect to it. If you simply close the listenbing socket, then you disable people from being able to connect to that port.
But then sometimes you want some people to have access to the port and to deny it for others. Thats when you use a firewall.
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
Nish [BusterBoy] wrote:
Thats when you use a firewall.
I was kind of trying to make a simple firewall. I am not sure what the best way to do it is.
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
01001001 00100000 01010000 01100001 01100100 00100000 01001101 01111001 00100000 01010000 01101111 01110011 01110100 00100000 01000011 01101111 01110101 01101110 01110100
|
|
|
|
|
Matt Newman wrote:
I was kind of trying to make a simple firewall.
That's beyond what winsock can do. Firewalls involve packet capturing.
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
How to make a socket listen on a port!?
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Rickard Andersson wrote:
How to make a socket listen on a port!?
I was trying to completely block of access to unused ports.
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
01001001 00100000 01010000 01100001 01100100 00100000 01001101 01111001 00100000 01010000 01101111 01110011 01110100 00100000 01000011 01101111 01110101 01101110 01110100
|
|
|
|
|
I should know how to do this but for the life of me I can't find the answer. How do I convert an __int64 value to a string. TCHAR[XXX] or CString doesn't matter.
|
|
|
|
|
I'd try using an ostringstream. It's a better alternative than CString::format or ( heaven forbid ) sprintf in any case.
I have an article on CP if you don't know how to use it.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Thanks for the feedback.
CString strTemp;
__int64 iValue = ULONG_MAX + ULONG_MAX;
strTemp.Format("%d", iValue);
This does not produce the correct result. It works for 32 bit numbers, but it does not appear to work for 64 bit numbers. I have not tried the STL solution, though. I will try it next time I get a chance.
I have solved the problem, though.
|
|
|
|
|
Just as Chris said, you have a CString str; you can do a str.Format("%d", yourIntData);
|
|
|
|
|
Thanks for the feedback.
CString strTemp;
__int64 iValue = ULONG_MAX + ULONG_MAX;
strTemp.Format("%d", iValue);
This does not produce the correct result. It works for 32 bit numbers, but it does not appear to work for 64 bit numbers.
I have solved the problem, though.
|
|
|
|
|
Use _i64toa .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello.
Could someone please help on how I can tackle this little program using any data structure( a stack, link list or queue).
Having a computer processing one line at at time,whereby each line of input contains an ID#, a starting time,and a sequence of integers representing the duration of each job.If the jobs are in a 1st run 1st come basis.The output of the program should be a list of ID#s, a starting and finishing time for each job, and the average waiting time for each job.
Thanks.
|
|
|
|
|
I'd use a std::deque<job> , where job is a struct defined by you containing the relevant info about a job.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Any help ?
I would like to implement in my own program the Reascan disks of the Disk Administrator of Windows NT/2000/XP.
I can't find any entry in the MSDN...
Anyone knows how to do that ?
Thanks
Zindine
|
|
|
|
|
In order to use the Microsoft Web Browser ActiveX control, I need to call AfxEnableControlContainer() in my App::InitInstance. My application requires that I also call CoInitializeEx(NULL, COINIT_MULTITHREADED).
When I comment out the CoInitializeEx() call, the browser displays. If I let it run, the dialog with the ActiveX control won't initialize.
Any guesses as to what the problem is?
J
"I am wise enough to therefore not spout my ill informed opinion as if it were remotely related to fact." - Christian Graus
|
|
|
|
|
If you're using MFC I believe that you are supposed to use AfxOleInit() instead, though it's been a while so I could be wrong.
--
Andrew.
|
|
|
|
|
Ok, but AfxOleInit doesn't let me set the threading model. And I need a multithreaded environment for my callbacks. When I use it, my callbacks stall out.
Any other ideas?
J
"I am wise enough to therefore not spout my ill informed opinion as if it were remotely related to fact." - Christian Graus
|
|
|
|
|
I have a standard MFC SDI application. I need to generate some simple text reports to be printed, and I thought I could just have few routines spit out HTML into a viewer control.
Can someone recommend a method for doing this? I already have documents and views, so I don't think CHtmlView will do it for me.
Any pointers would be greatly appreciated.
J
"I am wise enough to therefore not spout my ill informed opinion as if it were remotely related to fact." - Christian Graus
|
|
|
|
|
Who knows how to deallocate memory I allocated using something like this: char *x = new char[100000000]; ? I know tha there is a 'delete' command, but it deallocates mem only for the current app and I want to give the memory back to the OS. Any ideas ?
|
|
|
|
|
Take a look at the VirtualAlloc routines.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
I have made a program to make questions for a boardgame i'm making. I use structures and write them to a file with fwrite so there are often long strings of unused data stored. The strange thing is that when I use the Release version of my program the long strings is just random garbage that happend to be in the memory. But when I use the Debug version the long strings are made up of the same characters (which is very very good when I compress the savefiles). Why is this happening?
|
|
|
|
|
the Debug verion of the memory allocators automatically initailize their buffers.
The Release version of memory allocators simply use the memory as it is found.
This is to allow you to find bugs in debug mode, and not slow down your release mode operation. What you may want to do if you are concerned with this is initialize all of the buffers that you use.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|