Click here to Skip to main content
15,910,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: I know absolutely nothing...help, please. Pin
Roger Wright2-Feb-04 4:51
professionalRoger Wright2-Feb-04 4:51 
GeneralGroup several pages or child windows in to one project Pin
swarnamanoo1-Feb-04 17:44
swarnamanoo1-Feb-04 17:44 
GeneralPerformance problem of using listctrl to retrieve data using ADO in VC++ Pin
Dababa1-Feb-04 17:15
Dababa1-Feb-04 17:15 
GeneralRe: Performance problem of retrieve data using ADO in VC++ Pin
Dababa1-Feb-04 17:43
Dababa1-Feb-04 17:43 
GeneralMoving from MFC CList to stl::vector; please help Pin
Cloaca1-Feb-04 17:14
Cloaca1-Feb-04 17:14 
GeneralRe: Moving from MFC CList to stl::vector; please help Pin
Cloaca1-Feb-04 18:02
Cloaca1-Feb-04 18:02 
GeneralRe: Moving from MFC CList to stl::vector; please help Pin
Diddy1-Feb-04 22:21
Diddy1-Feb-04 22:21 
GeneralRe: Moving from MFC CList to stl::vector; please help Pin
Cloaca2-Feb-04 4:49
Cloaca2-Feb-04 4:49 
GeneralRe: Moving from MFC CList to stl::vector; please help Pin
Diddy2-Feb-04 5:41
Diddy2-Feb-04 5:41 
QuestionIs there a function to create sound? Pin
siew hoon1-Feb-04 15:51
siew hoon1-Feb-04 15:51 
AnswerRe: Is there a function to create sound? Pin
Prakash Nadar1-Feb-04 16:26
Prakash Nadar1-Feb-04 16:26 
AnswerRe: Is there a function to create sound? Pin
george ivanov2-Feb-04 2:05
george ivanov2-Feb-04 2:05 
QuestionHow to fix the 2nd dialog from moving? Pin
siew hoon1-Feb-04 15:49
siew hoon1-Feb-04 15:49 
AnswerRe: How to fix the 2nd dialog from moving? Pin
Diddy1-Feb-04 22:40
Diddy1-Feb-04 22:40 
GeneralRe: How to fix the 2nd dialog from moving? Pin
siew hoon21-Feb-04 19:40
siew hoon21-Feb-04 19:40 
GeneralRe: How to fix the 2nd dialog from moving? Pin
Diddy22-Feb-04 10:23
Diddy22-Feb-04 10:23 
GeneralRe: How to fix the 2nd dialog from moving? Pin
Anonymous22-Feb-04 13:33
Anonymous22-Feb-04 13:33 
GeneralRe: How to fix the 2nd dialog from moving? Pin
Diddy23-Feb-04 5:10
Diddy23-Feb-04 5:10 
GeneralRe: How to fix the 2nd dialog from moving? Pin
siew hoon27-Feb-04 16:26
siew hoon27-Feb-04 16:26 
GeneralRe: How to fix the 2nd dialog from moving? Pin
Diddy28-Feb-04 1:21
Diddy28-Feb-04 1:21 
GeneralRe: How to fix the 2nd dialog from moving? Pin
Diddy29-Feb-04 8:52
Diddy29-Feb-04 8:52 
GeneralRe: How to fix the 2nd dialog from moving? Pin
siew hoon2-Mar-04 3:04
siew hoon2-Mar-04 3:04 
GeneralRe: How to fix the 2nd dialog from moving? Pin
Diddy2-Mar-04 8:30
Diddy2-Mar-04 8:30 
GeneralRe: How to fix the 2nd dialog from moving? Pin
siew hoon3-Mar-04 1:45
siew hoon3-Mar-04 1:45 
GeneralRe: How to fix the 2nd dialog from moving? Pin
Diddy3-Mar-04 2:53
Diddy3-Mar-04 2:53 
No problem Blush | :O ) Glad it fixed it.

Your other questions:-

1. All you do is declare an array of CEdit's as an array in the class' header:

CEdit m_arrEditCtrls[10];

Then in your DoDataExchange method you wire up your controls in the normal way, just using the array rather than the individual CEdit's:

DDX_Text(pDX, IDC_EDIT1, m_arrEditCtrls[0]);
DDX_Text(pDX, IDC_EDIT2, m_arrEditCtrls[1]);
DDX_Text(pDX, IDC_EDIT3, m_arrEditCtrls[2]);
DDX_Text(pDX, IDC_EDIT4, m_arrEditCtrls[3]);

etc.

2. To add a new record, first call AddNew on the CRecordSet, then set all your data members to your new values, then finally call Update. If you are using snapshot record sets you then need to call Requery.

I just saw you other post - and guess you have got that far. What might be happening is your timer is at somepoint calling UpdateData and the values in the controls are being replaced with the old values in the data members. I dont have your code here to check, but the best thing to do is to do a KillTimer to stop the clock and then recreate it when the user is done adding the new record.

3. This is tricky. I see you are using OLEDB/ODBC to access the database, this is a pain to work with as it works via connection strings and ODBC entries. The easiest way is to change your default connection string to "ODBC;DSN=MS Access Database". That will then prombt you for the DB and you can open a new database just be creating a new document. Personally, I hate ODBC for this reason and use ADO instead.

4. Look up the ::PlaySound function. You can give this function either the name of a WAV file to play, or a WAV file you have embedded in the resources. You could use MessageBeep for a simple beep.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.