|
ULONG mode = 0;
WSAIoctl(m_socket, FIONBIO, (LPVOID) &mode, sizeof(ULONG), NULL, 0, NULL, NULL, NULL);
|
|
|
|
|
I was on Unix, so that wouldn't work, but I was able to make it work another way.
Thanks for the answer, though.
Jon Sagara
"Oh Lisa, you and your lies. Bart's a vampire, beer kills brain cells. Let's go back to that building... thingy... where our beds... is."
|
|
|
|
|
Got it. It was a small misunderstanding on my part.
Jon Sagara
"Oh Lisa, you and your lies. Bart's a vampire, beer kills brain cells. Let's go back to that building... thingy... where our beds... is."
|
|
|
|
|
Hello,
I have an idea from my work that use computer for process something in realtime. But Windows9x or WindowsNT does not support all access to hardware and OS kernel get all time for its works.
Could I use MS-DOS for real time problem?
Or write new own OS simply like MS-DOS. But writing new OS kernel is very difficult. If it is rather than, where does it start? how does it start?
Please help me. Thank you very much!
Nguyen Le Nam
|
|
|
|
|
Realtime processing within MSDOS was always a tricky thing, less so in Windows.
The solution depends on what size of time you need to be within. For example a realtime process that only has to react per minute would be fine in any OS, since the time slice is much less than a minute.
In DOS you are not in timeslices. Your program is called, and that is the only program running until your program ends. Except of cause drivers (TSRs - transient-stay-resident) running on interrupts. So, in this case you would want a driver that triggers a call in your program. A typical one would be on receiving data at a serial port. You would write software to buffer incoming data and trigger a software interrupt which calls a callback function in your main code. This is realtime with loss of driver-time, your programs reaction time and your own process-time (about as real as it gets in DOS). Direct access to the IRQ (interrupt controller) is no longer available in Windows, though it is not so much needed.
In Windows (after Win3.x that is since 3.x was still a DOS machine), 98/NT/2000, you actually have it better since the port stream is for the most part handled for you. You only need to capture it then set a callback. As you are in timeslices your main program can carry on working on its data, then on a call from incoming data you collect and process.
How real the time is depends on how much processing you need to do on the data and the speed of your machine. If the processing is longer than the time between receiving new data then obviously you are not in realtime and have to account for this in the processing itself. Carefull use of threading can increase your programs response time. But the speed of modern machines are generally fast enough to give you 'effective' realtime.
On a worst case instance with Win95, I had to effectively crash Windows. I let my code take all time from the machine in order to keep up with the incoming data. The same project on a proper timeslice OS runs without problem (other than the standard bugs we all write).
We do it for the joy of seeing the users struggle.
|
|
|
|
|
I am trying to write a client app that can monitor IP ports. Like which ports are taken and what are they being used for. I have done some work with WinSock and Win32 networking API, but can't find anything about this. I would prefer a means to set a message if on a single port or multiple ports that fire when the port becomes active, but will settle for a port listener that will check the ports and tell me what is going on with them. Has anyone tried this before?
Thanks.
Leo T. Smith
Senior Programmer/Analyst
Hartwick College
|
|
|
|
|
What operating system?
Norm Almond
Chief Technical Architect
FS Walker Hughes Limited
|
|
|
|
|
The OS is Actually any of the Win32 Platforms. I will use the Win32 API's to detect OS, and the whichever code is necessary (UniCode conversion also is not an issue). I would prefer API calls or direct TCP/IP functions over MFC Wrappers.
Leo T. Smith
Senior Programmer/Analyst
Hartwick College
|
|
|
|
|
Look at the "IP Helper" stuff on MSDN! There's a whole section on it.
Norm Almond
Chief Technical Architect
FS Walker Hughes Limited
|
|
|
|
|
Try look at the open Source project WinDump (for Windows) or TcpDump (for unix). It sniffs all network trafic based on filters! But you have the source and can make your own filters.....
http://www.tcpdump.org/
http://netgroup-serv.polito.it/windump/
Cheers, Frank
|
|
|
|
|
Hello Leo,
There is a very good article by Ton Plooy in the February 1998 edition of the Windows Developers' Journal. The title is : "Scanning Internet Ports". A sample program with full source codes is also given. The following is the link to the article :
http://www.wdj.com/articles/1998/9802/9802b/9802b.htm?topic=articles
I believe the sample program will be perfect for you. Best of luck.
Regards,
Bio.
|
|
|
|
|
I posted this in the C++ area, then found this place.
I have a service that I'm writing. It is actually a part of a program being ported over. It needs to bind to a socket, which works fine in the app, but now as the service, CSocket::Create(port) fails.
Does anyone have a clue?
Thanks!
|
|
|
|
|
I'm not sure if you can use CSocket within a service (this is just a comment, i really don't remember if it uses Windows Messages or something)
Make sure you call AfxSocketInit() before any MFC socket operation.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
Service in NT normally run in the local system account. Take the service properties and provide an administrator account and password.
Clark
|
|
|
|
|
Hello all,
Can anyone help me on how to get notified on files and folders being changed on Wince 2.12 and later?
Thank you,
Firas
|
|
|
|
|
I have DLL, when some independent processes sharing some informations. I need create in this DLL primary thread, which will modified these information. When I use DLL entry point for first time, thread is depend on process, which create it. When this process quit thread quit too.
Can be created some thread which running for example in system memory space? And how to do it. Thanks a lot
Zbynek
|
|
|
|
|
Hello Zbynek,
First of all, I assume your DLL has some shared data (using a technique like the one described in How to share a data segment in a DLL, for instance) --otherwise, your question makes little sense.
That said, maybe the following technique will work: Have a shared global variable (with proper CRITICAL_SECTION -controlled access) that keeps track of how many processes are currently attached to the DLL. When this count is one (i.e., upon launching of the first process) make your entry point launch a special process (with CreateProcess ) that in turn loads the DLL and creates the service thread (or does the required job at its primary thread). This "service" process can then quit when all other "normal" processes abandon the DLL. Make the service process a non-GUI one and the scheme will go unnoticed.
I hope I made myself clear enough. Let me know it this did help.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Does anyone exactly know the kind of data which is stored in USER memory. We have a resource problem under Win98.
Christian Probst
|
|
|
|
|
There's an extenssion to win32API that comes with Win2000/XP
that allows to impose some restrictions on single process or
process group. The flags that are used to define constraints
allow to achiewe a lot , but I couldnt find how to force
process /group of processes to use not more than some amount
of procesor computing power, measured in % (percentage).
For example: I want a media player which decodes some
video file (ie divx format) to use not more than 50% of
computing power of my CPU. If the program wants to consume more
CPU procesing power (than the specyfied amount)it would simply not receive it. When viewing the performance tab of task manager , the upper graf (of the cpu) shouldn't exceed 50% (provided that no other applications use processor).
I know that it is possible , since the IIS (that comes with
Win2000) allows to specify whether or not to use 'process throttling' , and to specify how many CPU computing power a web application (running some executable code / scripts) within the server may consume
Thanx in advance
Michal Januszczyk
|
|
|
|
|
Hi
How can I get the Info. of Windows XP security architecture?
|
|
|
|
|
I think XP has the same security architecture as Win2k, although I have not looked further into it. I dont know how detailed information you need, but the book "Inside Windows 2000, 3d ed" has a chapter on security. If you don´t want to buy the book for one chapter, an introduction to NT security can be found below.
http://www.windowsitlibrary.com/Content/121/03/toc.html
|
|
|
|
|
Hi there, it's my first post at Code Project. I'm a short time surfer there but I find it the greatest VC site I ever found.
I'm currently making an (HP) pcl2tiff converter for my company. This converter is designed to run on both PC and Unix.
I develop under MSVC 6.0 and I write portable code so that I've little or no modification when I'll do the port to Unix (HP-UX 11).
I've read somewhere - I'm not sure - it is possible to generate Unix compatible exe directly from Visual C++, that is I wouldn't have to compile under Unix and that would be so great.
Can someone confirm this - or is it just a silly idea ?
btw When finished this converter will read HPGL/PCL5 printer files and generate output to TIFF or Bitmaps.
Yarp
|
|
|
|
|
I've heard of one virus that can run on both Intel based Linux and Windows machines, but I think you have to go down to the assembler level to do this, and you would really need to know what you are doing. Effectively you would still need to include support for both systems in the exe as they are different API's. As well as that VC6 is for 32bit Win apps, and to get this working it would have to be half dos based - 16bit app, as all the Win32 exe headers would get in the way. I would say this is really not something you would want to attempt. Are the HP-UX machines Alpha based, in which case it nails the coffin shut.
Giles
|
|
|
|
|
In fact I need not include support to either system. All I do with this PCL decoder is to read the file and ouptput the result to another file - a bitmap for example. These are just file ios, that's the reason why I thought there was a little possibility.
The dream as gone but anyway thank for the answer.
Yarp
|
|
|
|
|
Hello, is there somebody to help me solve my problem? I did following:
1. I have back-up of computer' HDD with english W2000 instalation.
2. After damage of disk at this computer, I installed there german version of W2000
3. German version was installed successfully - I continued with unpacking HDD backup of previous - english version. Backup program was working OK, after
unpacking backup propmted for computer restart.
4. After restart english Win2000 login dialog appeared on screen.
5. I tried to log-in as administrator - win2000 prompt "Local security policy does not allow this user to log in". All other users of previous instalation are now unknown, noone can log in.
What to do now? In backup of previous - english instalation was backed up all the HDD content, including system directory, documents ... everything except backup directory.
What can man do, when administrator has no right to log on?
Gnimelf
|
|
|
|