Basic port scanner code .. pls help ???

This is a discussion on Basic port scanner code .. pls help ??? within the C Programming forums, part of the General Programming Boards category; Threads are insanely easy.. Code: #include <process.h> #include <windows.h> #include <conio.h> #include <iostream> using namespace std; bool flag=false; void DoSomething(PVOID) ...

  1. #16
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    Threads are insanely easy..
    Code:
    #include <process.h>
    #include <windows.h>
    #include <conio.h>
    #include <iostream>
    
    using namespace std;
    
    bool flag=false;
    
    void DoSomething(PVOID)
    {
    	while(!kbhit());
    	
    	flag = true;
    }
    int main(void)
    {	
    	_beginthread(DoSomething, 0, NULL);
    
    	while(!flag)
    		cout<<"Threads..."<<endl;
    
    	return 0;
    }
    [snip_from_other_one_of_my_posts]
    You're going to need to enable Mutli-Threading for this to work...
    In MSVC (Visual Studio), go to Project->Settings->Click the C++ tab. Change the "Category" dropdown box to "Code Generation", and then change the "Use run-time library" dropdown box to "Multithreaded" or "Debug Mutithreaded".[/snip]

  2. #17
    Registered User intruder's Avatar
    Join Date
    Nov 2002
    Posts
    48
    hey many many thanks for the sample code ken but i am using DevC++ 4.0 , so in that what should i change so that i can compile the above sample code and test , to see the results .. pls help .. i will be very thankful to u ..

    waiting..

  3. #18
    Registered User
    Join Date
    Feb 2002
    Posts
    329
    You just have to link to the right lib, From MSDN:

    LIBCMT.LIB Multithread static library, retail version
    MSVCRT.LIB Import library for MSVCRT.DLL, retail version

  4. #19
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Wow, this threads a bit old....

    Please don't drag up old threads.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Visual Basic Code Help
    By Slinger137 in forum Windows Programming
    Replies: 9
    Last Post: 01-04-2009, 09:26 AM
  2. FTP program
    By jakemott in forum Linux Programming
    Replies: 14
    Last Post: 10-06-2008, 01:58 PM
  3. Newbie needing help with basic code!
    By TeZ258 in forum C++ Programming
    Replies: 4
    Last Post: 11-03-2007, 08:35 PM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  5. Pls help me to do this project in C I need source code
    By sureshmenon74 in forum C Programming
    Replies: 4
    Last Post: 10-04-2001, 06:57 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21