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
H

HP

@HP
About
Posts
17
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Q. Can I convert a CString value into a hex value? Urgent!!!
    H HP

    Hi, One solution is: CString sHexNumber = "ABC"; DWORD dwDecNumber = 0; sscanf( sHexNumber, _T("%16x"), &dwDecNumber ); Best regards Holger

    C / C++ / MFC question help tutorial

  • Edit Box Problem!!
    H HP

    Hi, I think the solution for both problems is to override the "OnOK" handler of the dialog:

    void MyDialog::OnOK()
    {
    // suppose m_sPassword is bound with DDX to the editbox
    UpdateData( TRUE );

    if( m\_sPassword != "PASSWORD" )
    {
    	AfxMessageBox( "Wrong Password" );
    	return;
    }
    
    CDialog::OnOK();
    

    }

    Best regards Holger

    C / C++ / MFC help tutorial question

  • VB / VC++ question
    H HP

    Hi, I think an easy way is to put the "C++" function into a DLL and export it from there. Then link the DLL to the VB program and import the function. Best Regards Holger

    C / C++ / MFC tutorial question c++ com

  • Get Binary TimeZone Info from Registry
    H HP

    Hi, Why do not use the API function "GetTimeZoneInformation". I think it's much easier to handle. Best Regards Holger

    C / C++ / MFC windows-admin tutorial

  • Launch program when window starts?
    H HP

    Hi, take a look to this CodeGuru article: http://codeguru.earthweb.com/misc/OnBoot.shtml Best regards Holger

    C / C++ / MFC tutorial question

  • How to format source code in discussion board message
    H HP

    Hi all, can anybody tell me how i can format source code in discussion board messages? Thanks in advance Holger Persch

    C / C++ / MFC tutorial question discussion

  • ****** Please HELP! File & SQL ******
    H HP

    Hi, try this:

    CString BuildSQL( const CString& sStringFromFile )
    {
    CString sSQL, sTemp1, sTemp2;

    sSQL = \_T("CREATE TABLE ");
    
    // string at position 0 is the table name
    if( AfxExtractSubString( sTemp1, sStringFromFile, 0, ',' ) )
    {
    	sSQL += sTemp1;
    	sSQL += "( ";
    
    	// now add the column names and the column types
    	for( int i = 1; ; i +=2 )
    	{
    		if( AfxExtractSubString( sTemp1, sStringFromFile, i, ',' ) &&
    			AfxExtractSubString( sTemp2, sStringFromFile, i + 1, ',' ) )
    		{
    			sSQL += sTemp1;
    			sSQL += sTemp2;
    			sSQL += \_T(", ");
    		}
    		else
    		{
    			break;
    		}
    	}
    
    	// remove the last ", "
    	sSQL.ReleaseBuffer( sSQL.GetLength() - 2 );
    	sSQL += \_T(" )");
    }
    
    return sSQL;
    

    }

    Regards Holger Persch

    C / C++ / MFC c++ help database tutorial question

  • Catching a Keystroke
    H HP

    I think it will be better to subclass an edit control and give it the custom formatting capabilities you want. You can handle the "WM_CHAR" message to control the edit's input. Then use the subclassed control instead of the regular edit control in your formview. Regards Holger Persch

    C / C++ / MFC question

  • Calling NT Service
    H HP

    If "to call" means to start a service, just use PJ Naughter's great "CNTService" classes (located in the "System -> Services" section) to get access to NT services. These classes will allow you to control (e.g. start, stop, install, uninstall,...) services in any way you want. Regards Holger Persch

    C / C++ / MFC question tutorial

  • Creating 2 documents instead of one.
    H HP

    #1 First create two new data members in your application class. for example: CMultiDocTemplate* m_pDocTemplate1; CMultiDocTemplate* m_pDocTemplate2; #2 Change the document template registering to something like this. m_pDocTemplate1 = new CMultiDocTemplate( IDR_MYDOC1, RUNTIME_CLASS( CMyDocument1 ), RUNTIME_CLASS( CChildFrame ), RUNTIME_CLASS( CMyView1 ) ); AddDocTemplate( m_pDocTemplate1 ); m_pDocTemplate2 = new CMultiDocTemplate( IDR_MYDOC2, RUNTIME_CLASS( CMyDocument2 ), RUNTIME_CLASS( CChildFrame ), RUNTIME_CLASS( CMyView2 ) ); AddDocTemplate( m_pDocTemplate2 ); #3 Overwrite the "OnFileNew" command handler in your application class. void CMyApp::OnFileNew() { // don't call CWinApp::OnFileNew() // Create a new document from template 1 m_pDocTemplate1->OpenDocumentFile( NULL ); // Create a new document from template 2 m_pDocTemplate2->OpenDocumentFile( NULL ); } That's it. Best regards Holger Persch

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

  • Writing Windows NT Service
    H HP

    Another good workaround is Joerg Koenig's article "A Class For Building An NT Service " at CodeGuru. You can find it at: http://codeguru.earthweb.com/system/nt\_service.shtml Best regards Holger Persch

    C / C++ / MFC tutorial question

  • CTreeCtrl check state
    H HP

    A suggestion. Try to use the "ptDrag" member of the NM_TREEVIEW structure instead of GetCurrentMessage()->pt. There is no need to convert ptDrag to client coordinates, because it is already in client coords. If this doesn't work, using the OnLButtonDown handler instead of OnClick is a second chance. HTH Holger Persch

    C / C++ / MFC question

  • Writing Windows NT Service
    H HP

    Hi. Take a look at PJ Naughter's "CNTService" framework, that is located in the "System" section. It's a great advice in creating NT services. HTH Holger Persch

    C / C++ / MFC tutorial question

  • Print Preview, Zoom and font size?
    H HP

    Hi, try using CFont::CreatePointFont(...) for initalising the font. HTH Holger Persch

    C / C++ / MFC help question

  • sizeof(CString)
    H HP

    Hi, a Suggestion for this behavior. The debugger will show you only 255 (or 256?) characters, even when CString contains more than this amount. HTH Holger Persch

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

  • a newbie-ish question about windows programming
    H HP

    Hi! Put the following function into your dialog class and call it in the file i/o loop. This will ensure that the window messages are correctly disptached. void CYourDialog::PumpMessages() { static MSG msg; if( GetSafeHwnd() != NULL ) { while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) { if( !IsDialogMessage( &msg ) ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } } } } HTH Holger Persch

    C / C++ / MFC question help tutorial announcement learning

  • Handling the OK button in CPropertySheet
    H HP

    Hi, if you like i can send you a CPropertySheet derived class that exactly does what you asked for. Best regards Holger

    C / C++ / MFC hardware 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