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
R

RadioOpa

@RadioOpa
About
Posts
31
Topics
12
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • CListCtrl - Selected Item
    R RadioOpa

    I use a CListCtrl object that, by default, should display Item No. 0 as selected. The Item ist displayed with a light grey background, when I click on an item is is displayed with a much darker background. How can I change the light grey to dark grey ? m_Companies.SetItemState( 0, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED); m_Companies.EnsureVisible( 0, FALSE);

    C / C++ / MFC question

  • CString Mid()
    R RadioOpa

    Many thanks, both ways solving the problem are excellent. I changed code as follows: iFirstSection = csComboBoxText.Find( '$'); // Find first '$' iSecondSection = csComboBoxText.Find( '$', iFirstSection +1); // Find second '$' csFirma = csComboBoxText.Mid( 0, iFirstSection); // Get first string section csFirma.TrimRight( ' '); csOrt = csComboBoxText.Mid( iFirstSection +1, iSecondSection - iFirstSection); // Get second csOrt.TrimRight( ' '); csFirmaID = csComboBoxText.Mid( iSecondSection +1); // Get last section

    C / C++ / MFC question

  • CString Mid()
    R RadioOpa

    I have a CString object loaded with a string like "This is the first section$This is the second section$This is the end" so each section separated by '$'. I try to load the second section as csAnsprech = csComboBoxText.Mid( csComboBoxText.Find( '$') +1, csComboBoxText.ReverseFind( '$')); but this retrieves the second and third section, nut just the second one. What´s wrong here ?

    C / C++ / MFC question

  • ComboBox - More than one Column
    R RadioOpa

    Thanks, but this is not a ListBox but a ComboBox. In a ListBox you can easily create more than one column and select items and it´s columns as m_Liste.InsertColumn( 0, "ID"); m_Liste.SetColumnWidth( 0, 40 ); m_Liste.InsertColumn( 1, "Customer"); m_Liste.SetColumnWidth( 1, 160 ); m_Liste.InsertColumn( 2, "Country"); m_Liste.SetColumnWidth( 2, 40); It appears that ComboBoxes do not support this feature so I need to format the string as suggested. I´ll use CString members as mid... for getting what I´m after.

    C / C++ / MFC tutorial question

  • ComboBox - More than one Column
    R RadioOpa

    All right: a ComboBox keeps al lot of items listed while opened. I used ComboBoxes a lot so far. It´s content could look like this, just one row is keept by ComboBox Element and displayed: Fred Harry Paul Thomas I seen this in ACCESS in a different shape: 1 Fred 2 Harry 3 Paul 4 Thomas ACCESS is capable of holding more than one row in a ComoBox Element.

    C / C++ / MFC tutorial question

  • ComboBox - More than one Column
    R RadioOpa

    Does anyone know whether you can have more than one Column in a CComboBox ? Seen this in an Access App. If yes: how to do ? Modified: Meant Column rather that row ! -- modified at 7:20 Monday 20th March, 2006

    C / C++ / MFC tutorial question

  • Memory Analysis
    R RadioOpa

    Thanks John, it´s clear that new returns 0 if allocation failed. I´m just looking for a way of checking available memory before and after such operations. Due to the dynamic memory model in windows it may be impossible to get exact required data. Purpose is not implemeting it in a commercial application but memory usage demonstration to students. In DOS times ( a century ago ) ;) we had a similar function.

    C / C++ / MFC performance question

  • Memory Analysis
    R RadioOpa

    ? I tried CMemoryState, without success.

    C / C++ / MFC performance question

  • ENTER on Button
    R RadioOpa

    Thanks, that works fine !

    C / C++ / MFC question

  • ENTER on Button
    R RadioOpa

    How can I achieve, that "Enter" works on a certain Button ? I´d like to change this during program. Sometimes Button "A" should work on ENTER, sometimes another one.

    C / C++ / MFC question

  • Select Row in ListView
    R RadioOpa

    All right, I´ve got it. Thanks a lot. m_Liste.SetExtendedStyle( LVS_EX_FULLROWSELECT); POSITION pos; pos = m_Liste.GetFirstSelectedItemPosition(); if( pos == NULL) { *pResult = 0; return; } else { // Use the following to display an entire row as selected // should you need to do so. int nItem = m_Liste.GetNextSelectedItem(pos); m_Liste.SetItemState( nItem, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT | LVIS_FOCUSED); m_Liste.EnsureVisible( nItem, FALSE); }

    C / C++ / MFC help question

  • Select Row in ListView
    R RadioOpa

    Thanks for you response, but it didn´t help: int nItem = m_Liste.GetNextSelectedItem(pos); m_Liste.SetItemState( nItem, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT | LVIS_FOCUSED); m_Liste.EnsureVisible( nItem, FALSE);

    C / C++ / MFC help question

  • Select Row in ListView
    R RadioOpa

    When selecting an item in a listview I can only highlight the first item, not the entire row. Where´s the problem ? int nItem = m_Liste.GetNextSelectedItem(pos); m_Liste.SetItemState( nItem, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED); m_Liste.EnsureVisible( nItem, FALSE);

    C / C++ / MFC help question

  • CString erased without reason ?
    R RadioOpa

    You´re absolutely right ! Thanks again.

    C / C++ / MFC database help question

  • CString erased without reason ?
    R RadioOpa

    Thanks a lot ! Changed it into: // Hole Hostnamen DWORD dwHostLength = MAX_COMPUTERNAME_LENGTH + 1; GetComputerName( csComputerName.GetBuffer( MAX_COMPUTERNAME_LENGTH + 1), &dwHostLength); csComputerName.ReleaseBuffer(); // Hole UserNamen DWORD dwUserLength = UNLEN + 1; GetUserName( csUserName.GetBuffer( UNLEN + 1), &dwUserLength); csUserName.ReleaseBuffer(); and now it works.

    C / C++ / MFC database help question

  • CString erased without reason ?
    R RadioOpa

    csUserName and csComputerName contain valid entries. As soon as the instance of a Recordset Class is created, both are erased. Interesting: The CString Object csSqlStatement is not erased. code sniplet: CString csComputerName; // Speichert den Hostnamen des PCs CString csUserName; // Speichert den UserNamen ( Windows) CString csTimeNow; // Speichert die Uhrzeit CString csConnectionString; // Verbindungs Daten // Hole aktuelle Zeit COleDateTime coTimeNow(COleDateTime::GetCurrentTime()); csTimeNow.Format( "%04d.%02d.%02d %02d:%02d:%02d", coTimeNow.GetYear(), coTimeNow.GetMonth(), coTimeNow.GetDay(), coTimeNow.GetHour(), coTimeNow.GetMinute(), coTimeNow.GetSecond()); // Hole Hostnamen DWORD dwHostLength = MAX_COMPUTERNAME_LENGTH + 1; GetComputerName( csComputerName.GetBuffer( 0), &dwHostLength); // Hole UserNamen DWORD dwUserLength = UNLEN + 1; GetUserName( csUserName.GetBuffer( 0), &dwUserLength); // Instanz zur Datenbank aufbauen csConnectionString = "DSN=ODR_CRM;UID=ODRGMBH;PWD=origin"; m_pDB = new CDatabase(); if( m_pDB->OpenEx(csConnectionString, CDatabase::noOdbcDialog)) { // We´re connected to the database } else { // we have a problem connecting to the database } // !!!!! // ! Next statement will erase csComputerName and csUserName ! // Access to Class Protokoll Table m_pProtocol = new CProtokoll( m_pDB); m_pProtocol->Open(); // ready to use

    C / C++ / MFC database help question

  • Recordset AddNew fails
    R RadioOpa

    I derived a Class "CProtocol" from CRecordset which is linked with but one database table. Everything works fine until I call AddNew(), here I receive a assertion Faile Message, referring to dbcore.cpp Code sniplet ( .cpp file): CString csTimeNow; // Hole Hostnamen DWORD dwHostLength = MAX_COMPUTERNAME_LENGTH + 1; GetComputerName( csComputerName.GetBuffer( 0), &dwHostLength); // Hole UserNamen DWORD dwUserLength = UNLEN + 1; GetUserName( csUserName.GetBuffer( 0), &dwUserLength); // Hole aktuelle Zeit COleDateTime coTimeNow(COleDateTime::GetCurrentTime()); csTimeNow.Format( "%04d%02d%02d%02d%02d%02d00", coTimeNow.GetYear(), coTimeNow.GetMonth(), coTimeNow.GetDay(), coTimeNow.GetHour(), coTimeNow.GetMinute(), coTimeNow.GetSecond()); // Instanz zur Datenbank aufbauen CString csConnectionString; csConnectionString = "DSN=ODR_CRM;UID=ODRGMBH;PWD=origin"; m_pDB = new CDatabase(); if( m_pDB->OpenEx(csConnectionString,CDatabase::noOdbcDialog)) { // We´re connected to the database } else { // we have a problem connecting to the database } // Access to Class Protokoll Table m_pProtocol = new CProtokoll( m_pDB); m_pProtocol->Open(); // ready to use m_pProtocol->m_Timestamp = csTimeNow; m_pProtocol->m_Benutzer = csUserName; m_pProtocol->m_Rechner = csComputerName; m_pProtocol->m_Aktion = csMessage; if( m_pProtocol->IsOpen() ) { m_pProtocol->AddNew(); // Ready to add new records } m_pProtocol->Update(); // Update Table m_pProtocol->Requery(); // .h file CDatabase* m_pDB; // Pointer to CDatabase Class CProtokoll* m_pProtocol; // Pointer to CRecordset Class

    Database c++ database help announcement

  • Windows User Name and HostName
    R RadioOpa

    Many Thanks ! I´ve done it this way: DWORD dwLength = MAX_COMPUTERNAME_LENGTH + 1; CString csComputerName; GetComputerName( csComputerName.GetBuffer( 0), &dwLength);

    C / C++ / MFC tutorial question

  • Dynamic memory allocation of 2-D array
    R RadioOpa

    "malloc" should nowadays be replaced with "new" as my Cpp teacher told me recently

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

  • Windows User Name and HostName
    R RadioOpa

    How to read Windows User Name and the machine Host name in a VC application ?

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