Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
G

G_S

@G_S
About
Posts
28
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • TCP/IP question
    G G_S

    Thank you

    G_S

    C / C++ / MFC help question sysadmin data-structures security

  • TCP/IP question
    G G_S

    Zac Howland wrote:

    There is no OS-level APIs to set up this kind of security

    This is what I was looking for to block incoming IPs at the OS level.

    Zac Howland wrote:

    Why is the list of "bad" IPs shared with multiple threads?

    The list is shared to minimize connection time the connection is accepted a new thread is fired up and the resulting thread checks the “bad” List and also serves the connection. The number of threads is limited but you get the idea. thank you for the advice

    G_S

    C / C++ / MFC help question sysadmin data-structures security

  • TCP/IP question
    G G_S

    Is there any API to block IP’s from connecting to the server? Problem details I have developed client/server application. For security it is Username/password protected. To prevent or “minimize” brute force attacks and Denial Of Service it check for failed logins and logs IP from failed attempts for x min, if 3 failed attempts are reached in the x minutes it blocks the IP for y minutes. It uses a global linked list to log the IPs and this is where the problem is. The global List is like a bottleneck since it is shared among other threads. First: To minimize code execution is there any way to block the IP in the operating system level to minimize code execution since if the attacking IP is allowed to re-connect to the server again it can easily cause a DOS. Second: I could only come up with a globally linked list to hold the IP is there any better way to do this. Thanks for any help

    G_S

    C / C++ / MFC help question sysadmin data-structures security

  • Crazy fgets stuff [modified]
    G G_S

    stevelam wrote:

    fgets (filename , 100 , pFile);

    chage that to if( fgets (filename , 100 , pFile) == NULL ) { //ERROR } this prevent your prog from crashing. there is nothing wrong with that part of your code the file could have been created in binary mode. the buffer in this case filename could be currupted after the read op.

    G_S

    C / C++ / MFC help

  • to find the width and height of an rectangular object Image
    G G_S

    Well it is doable but not only with 1 cam and no other equipment or reference points from 3d. But this is actually interesting to try to solve

    G_S

    C / C++ / MFC help tutorial

  • to find the width and height of an rectangular object Image
    G G_S

    when you have finished this project the Nobel Prize is garanteed to be awarded to you. good luck :)

    G_S

    C / C++ / MFC help tutorial

  • System Sutdown and Start time
    G G_S

    Start time DWORD GetTickCount(VOID); return the time in mili seconds since the system has been started from that you can calculate the time when it has been started and how long shut down ?

    G_S

    C / C++ / MFC

  • Calculate Folder size
    G G_S

    As far as i know there is no API for that I did need the same thing what I did was I created a recursive function enumerated all the file and added their size. Ex BOOL GetFolderSize(TCHAR* szRoot,__int64* i64Size) { FindFirstFile(...); do{ //IF FOLDER GetFolderSize( szSubPath,i64Size) //ELSE IF FILE Add its value }while(FindNextFile(hFind,&FindFileData)); FindClose(...); return(TRUE) } but keep in mind that the FindFile.. returns 2 unneeded values the "." and ".." that you should ignore otherwise you will enumerate forever i think

    G_S

    C / C++ / MFC tutorial question

  • How do I Locate a Text box in a Big project based on the display of it at runtime?
    G G_S

    Locate the control id using Spy++ then open up resource.h find the corresponding name with that ID then find all instances of that name this will greatly narrow the search. does this help

    G_S

    C / C++ / MFC question design help tutorial workspace

  • How to convert a movie/video file into an exe?
    G G_S

    When you hear this what first comes to mind is RAT delivery. I don't see any other purpose for that.

    G_S

    C / C++ / MFC tutorial question

  • Windows Directory
    G G_S

    UINT GetWindowsDirectory( LPTSTR lpBuffer, // buffer for Windows directory UINT uSize // size of directory buffer );

    G_S

    C / C++ / MFC

  • Using Spy++ in Visual Studio 2003
    G G_S

    Spy++ is a great tool First of all start the application directly meaning not executing it through VC++. Second a better approach is to list processes it is simply easier to find your exes name then open up the tree you'll see all the threads if mulitple scan the threads for the window/control your looking for right click the window/control you want and click messages you'll see messages that window/control receives to isolate messages click on logging options on the toolbar or just click CTL+O there you have what kind of message tracing you want.

    G_S

    C / C++ / MFC tutorial csharp c++ visual-studio hardware

  • Combo Box problem
    G G_S

    If your using CreateWindow(Ex) you have to set the hight to the hight you want your dropdown window to go because a ComboBox has it's integral hight so setting the hight just afects the dropdown not the ComboBox. ex: hComboBox=CreateWindow("ComboBox",NULL,dwStyle,0,0,400,200,hWnd,(HMENU)iIdCB,hInst,0); else if it is on a dialogbox just drag the middel point as far as you want the dropdown to go i hope this helped

    G_S

    C / C++ / MFC help c++ question

  • Common Dialog Box'es
    G G_S

    hello I'm looking for a common dialog box to choose folders an exaple of files is GetOpenFileName(...) is there a common dialog box for directories. Thank you

    G_S

    C / C++ / MFC

  • stack question?
    G G_S

    Normally stack overflow is not a problem unless you have a lot of recursive functions within threads. I'm looking for any kind of suggestion,articles, methodes,api to detect and prevent stack overflow on releases. None MFC if possible but even MFC is fine. Thanks G_S

    C / C++ / MFC question c++ data-structures json help

  • Large Character Text
    G G_S

    I would create a font the size you need it this steps i hope will help you The bellow is only if not on multiple monitors hdc = GetDC(NULL); nHeight = GetDeviceCaps(hdc, LOGPIXELSY); // returns the number of pixels per logical inch along the screen height. ReleaseDC(NULL,hdc); so you can create a font with the result of it wich should be exactly 1 in. hFont=CreateFont(nHeight,0,0,0,/*FW_BOLD*/0,0,0,0,0,0,0,0,0,"Georgia"); and then to draw it in a window use DrawText(.....); G_S

    C / C++ / MFC c++ question

  • Templates Help?
    G G_S

    The following code is a very simple linked list it seems to work fine it compiles it runs and the output is the desierd output but the problem i'm having is in this line of code if(m_cNext) { delete( m_cNext ); m_cNext = NULL; } of the Reset member of the template. It Gives me an error on debug but not on release. Access violation writing location 0x00030fd4. I'm simply not seeing the problem any suggestions help would be helpful.

    #include< windows.h >
    #include< iostream.h >
    /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
       Linked List
    
       
       
       
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
    template < typename xType > 
    class CLinked
    {
    public:
    	CLinked();
    	~CLinked();
    
    	void SetCallDelete(BOOL b) {
    		                         m_bCallDelete = b; 
    								 if( m_Next )
    									 m_Next->SetCallDelete(b);
    	                           }
    
    
    	xType* GetObject()    { return(m_ObjData); }
    	CLinked* GetNext()    { return(m_cNext);   }
    	CLinked* GetPrev()    { return(m_cPrev);   }
    	CLinked* AddObject(xType* pvPtr,CLinked* prev=NULL);
    
    	void ReplaseObject(xType* obj) { m_ObjData = obj; }
    	void Reset();
    
    private:
    	xType* m_ObjData;
    	CLinked* m_cPrev;
    	CLinked* m_cNext;
    	BOOL m_bCallDelete;
    };
    
    template < typename xType > 
    CLinked< xType >::CLinked()
    {
    	m_bCallDelete = TRUE;
    	m_cPrev = NULL;
    	m_cNext = NULL;
    	m_ObjData = NULL;
    }
    
    template < typename xType >  
    CLinked< xType >::~CLinked()
    {
    	if( m_bCallDelete )
    	{
    		if( m_ObjData )
                delete( m_ObjData );
    		m_ObjData = NULL;
    	}
    	if(m_cNext)
    	{
    		delete( m_cNext );
    		m_cNext = NULL;
    	}
    }
    
    
    template < typename xType >  
    void CLinked< xType >::Reset()
    {
    	if( m_bCallDelete )
    	{
    		if( m_ObjData )
                delete( m_ObjData );
    		m_ObjData = NULL;
    	}
    	if(m_cNext)
    	{
    		delete( m_cNext );
    		m_cNext = NULL;
    	}
    	m_cPrev = NULL;
    	m_cNext = NULL;
    	m_ObjData = NULL;
    
    
    }
    
    
    template < typename xType >  
    CLinked< xType >* CLinked< xType >::AddObject(xType* pvPtr, CLinked* cpPrev)
    {
    	// if NULL fail
    	if( pvPtr == NULL )
    		return( NULL );
    
    	// if current has no obj store it
    	if( m_ObjData == NULL )
    	{
    		m_ObjData = pvPtr;
    		m_cPrev = cpPrev;
    		return( this );
    	}
    
    	if( m_cNext )
    	{
    		return( m_cNext->AddObject(pvPtr,this) );        	
    	}
    
    	m_cNext = new CLinked();
    	if( m_cNext == NULL )
    		return(NULL);
    
    	return( m_cNext->AddObject(pvPtr,this) );
    }
    
    
    
    typedef CLin
    
    C / C++ / MFC help wpf data-structures debugging question

  • MultiThread question?
    G G_S

    Thanks for the quick response. G_S

    C / C++ / MFC question help

  • MultiThread question?
    G G_S

    The problem i'm having is this CreateThread returns a handle to the thread the handle is not needed but even after the thread dies the handle seams still to exist so i did the folowing. CloseHandle ( CreateThread(....) ); could this become a problem now in future and past verions of windows? Simply to ignore it is not an options since houerly there might be 100's of trheads. G_S

    C / C++ / MFC question help

  • ULARGE_INTEGER
    G G_S

    How do you convert a ULARGE_INTEGER in to a string and back? No MFC Pleas. Thanks in advance G_S

    C / C++ / MFC c++ question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups