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
D

Doug Garno

@Doug Garno
About
Posts
11
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Access Database Help
    D Doug Garno

    In the Code Project's General section - Database area, there is an artical called "The CGeneric Database class". What this does is allow you to use the CGeneric recordset without binding the columns the way Class Wizard does. You can either set/get the column data via the calls like GetBool( "Column Name" ); or GetBool( column number ); This is a Dynamic way to use DAO vs the static way that Class Wizard does it. Also if you add new fields to the table, you don't have to rework the code, just add the new Get/Set routines.

    C / C++ / MFC database com help

  • Access Database Help
    D Doug Garno

    Your right, ClassWizard doesn't support Jet 4.0 formatted files. Either create the file in Access 97 or you will have to create the record sets and bind them manually. There is another way to do this and use the generic recordset that is posted in the Database section. That is the way I go because I don't like all the recordset files that are required for each table within the file, source code can get quite large.

    C / C++ / MFC database com help

  • CString to CTime
    D Doug Garno

    You can use COleDateTime::ParseDateTime( string ) to convert the string into the underlying DATE object. If you don't like to use COleDateTime objects and need the CTime object, you would have to convert between the two. Create a tm structure and populate the structure from the COleDateTime object and then using mktime( tm ) assign the result to the CTime object.

    C / C++ / MFC json tutorial question

  • Converting Jet 3.0 file to Jet 4.0
    D Doug Garno

    That worked: CDaoWorkspace::CompactDatabase( csOld, csNew, dbLangGeneral, 64 ); I was leaning that way but I thought I would just ask the experts here and save me some time. Thanks for your help.

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

  • Converting Jet 3.0 file to Jet 4.0
    D Doug Garno

    Yes you are correct, that is what is required to Open a Jet 4.0 file, but that doesn't convert the file from 3.0 format to 4.0.

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

  • Converting Jet 3.0 file to Jet 4.0
    D Doug Garno

    Does anyone know how to convert the Jet 3.0 file into Jet 4.0 format? The CDaoDatabase::CompactDatabase() can only specify dbVersion30 option. Looking at the available options it appears that MFC and DAO hasn't a option for dbVersion40.

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

  • Making A CStatics Text Go Bold
    D Doug Garno

    The problem is in the GetFont() call. MFC wrapps the HFONT in a temporary CFont object and when you call the CreateFontIndirect() a new HFONT is created in the temporary object and never gets back to the control. All you have to do is tell the control to use the new font, GetDlgItem( IDC_TITLE )->SetFont( m_titleFont );

    C / C++ / MFC

  • Design issue
    D Doug Garno

    You have the basic idea. The way that I do it is to pass the list control to the Doc and have the doc populate the list, that way the View doesn't need to know anything about the database. Something like this: CDoc::AddCustomers( CListCtrl* pList ) { // Reset the list control content pList->DeleteAllItems(); // I'm assuming that you somehow get a CDaoRecordset for the Customer table // and not accessing the database object directly. m_MyDaoDB->MoveFirst(); while( m_MyDaoDB->IsEOF() != 0 ) { // Add the record to the list m_MyDaoDB->MoveNext(); } } Don't know if this is a better OO way, but the Doc should know about the data, and the view handles the UI. I like to keep access to the data in the Doc and the View handles the display and user interaction.

    C / C++ / MFC c++ database design sales help

  • How to populate a tree control
    D Doug Garno

    Ah, the basic problem of the parent doesn't know that it has any children attached. Change your tvInsert.mask to include TVIF_CHILDREN and set the tvInsert.cChildren either true or false depending on if the parent has any children. Another way is to create parents with no children, then when you add children to a parent, tell the parent that it now has children. When you add a child to a parent, call a function like UpdateParentItem( HTREEITEM hParent ); void UpdateParentItem( HTREEITEM hParent ) { // Can't use ItemHasChildren() because it will always return // the value of the item.cChildren variable. // Need to get the first child and update the parent as needed. // Getting the first child of a parent will always return either // NULL if no children exist or the handle to the first child // regardless of the item.cChildren variable. HTREEITEM hChild = m_pTree->GetChildItem( hParent ); // Set up the item structure TV_ITEM item; ZeroMemory( &item, sizeof(TV_ITEM) ); item.hItem = hParent; item.mask = TVIF_CHILDREN; item.cChildren = hChild != NULL; // Update the parent node to reflect the children state. m_pTree->SetItem( &item ); } Also make sure that when the tree control is created you set the TVS_HASBUTTONS or you will not see the plus/minus button on the parent. You would have to double click the parent to see if there is any children.

    C / C++ / MFC question data-structures performance tutorial

  • CDaoIndex
    D Doug Garno

    You do not add an Index to a field, but rather add the index to the CDaoTableDef using the field information. Use CDaoIndexInfo, CDaoIndexFieldInfo to define the index and then use CDaoTableDef::CreateIndex() to create the index in the table definition.

    C / C++ / MFC database tutorial question

  • Saving and restoring rebar control
    D Doug Garno

    Does anyone know how to save the state of the CReBarCtrl and restore the state of the bands? I've tried to get the band count and then call the CReBarCtrl::GetBandInfo( ... ) but the REBARBANDINFO structure that is returned is no help. Anyone have any ideas?

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