Click here to Skip to main content
15,888,061 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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.
GeneralRe: How to fix the 2nd dialog from moving? Pin
siew hoon6-Mar-04 16:24
siew hoon6-Mar-04 16:24 
GeneralRe: How to fix the 2nd dialog from moving? Pin
Diddy8-Mar-04 8:23
Diddy8-Mar-04 8:23 
GeneralRe: How to fix the 2nd dialog from moving? Pin
siew hoon13-Mar-04 0:55
siew hoon13-Mar-04 0:55 
GeneralRe: How to fix the 2nd dialog from moving? Pin
Diddy14-Mar-04 3:25
Diddy14-Mar-04 3:25 
GeneralRe: How to fix the 2nd dialog from moving? Pin
siew hoon21-Mar-04 0:41
siew hoon21-Mar-04 0:41 
GeneralRe: How to fix the 2nd dialog from moving? Pin
siew hoon21-Mar-04 0:37
siew hoon21-Mar-04 0:37 
GeneralRe: How to fix the 2nd dialog from moving? Pin
Diddy21-Mar-04 8:17
Diddy21-Mar-04 8:17 
GeneralCOM+ Catalog Infomation Pin
kimsangwoo1-Feb-04 15:07
kimsangwoo1-Feb-04 15:07 
GeneralFatal error Pin
Goh Hui Beng1-Feb-04 14:47
Goh Hui Beng1-Feb-04 14:47 
GeneralRe: Fatal error Pin
Cloaca1-Feb-04 17:56
Cloaca1-Feb-04 17:56 
GeneralRe: Fatal error Pin
PengFeidu1-Feb-04 18:10
PengFeidu1-Feb-04 18:10 
GeneralSlider on CDialogBar Pin
Ziban1-Feb-04 14:37
Ziban1-Feb-04 14:37 
GeneralRe: Slider on CDialogBar Pin
Robert A. T. Káldy2-Feb-04 13:31
Robert A. T. Káldy2-Feb-04 13:31 
QuestionAnyone have a simple line drawing program? Pin
getz531-Feb-04 13:36
getz531-Feb-04 13:36 
AnswerRe: Anyone have a simple line drawing program? Pin
Cloaca1-Feb-04 17:34
Cloaca1-Feb-04 17:34 
GeneralRe: Anyone have a simple line drawing program? Pin
getz532-Feb-04 1:31
getz532-Feb-04 1:31 
GeneralRe: Anyone have a simple line drawing program? Pin
Cloaca2-Feb-04 5:42
Cloaca2-Feb-04 5:42 

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.