|
i use ms access 2000 to create my own address book which contain first name, last name and phone number. Very stupid address book
Now i want to try to use Visual C++ to map the correspond table field on the visual C++ form on each edit box to allow me to look through the record, add and delete record which i already done it using ODBC database method. It is very easy to follow the tutorial in the MSDN in Student Registration tutorial.
Next, i wish to synchronize the address book by pressing a button on the form. I have one address book in school and one address book at home. I wish to synchronize them. Of course, not through the network. Anyone have any idea?
|
|
|
|
|
Here is some pseudo timer code which calls ProcessData() twice per minute.
MyClass::OnTimer(UINT TimerID)
{
if(TimerID == MyTimer) {
KillTimer(MyTimer);
if (new_data) {
ProcessData();
} } }
If ProcessData() is written as follows then after approximately three hours
it will no longer be able to Open() the database.
MyClass::ProcessData()
{
CDatabase myDB;
if (myDB.Open()) {
do something
}
myDB.Close();
}
If it is written this way it appears to work fine.
MyClass::ProcessData()
{
CDatabase *myDB = new CDatabase;
if (myDB->Open()) {
do something
}
myDB->Close();
delete myDB;
}
The CDatabase class I am using is the CADODatabase class from a database article here on CodeProject. The class destructor appears to be correctly written. Also, a colleague of mine wrote his own database class a few years ago and it exhibited the same problem.
Could running it in debug mode be part of the problem?
Any thoughts as to what is happening here would be appreciated...
>>>-----> MikeO
|
|
|
|
|
A possibility is that the do something part is corrupting the stack (maybe going out of bounds on a built-in array?) so that the myDB memory space results affected.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
If you are doing something as time consuming as opening/changing/closing a database every 30 seconds, wouldn't it save you processor time to have one constant connection to the datasource?
|
|
|
|
|
User helfen Usern - http://codingforum.dyns.cx
|
|
|
|
|
|
How do i change the IP address?
|
|
|
|
|
Can you be more specific? On which platform are you trying to do this?
Jon Sagara
"Oh Lisa, you and your lies. Bart's a vampire, beer kills brain cells. Let's go back to that building... thingy... where our beds... is."
|
|
|
|
|
|
Hello, the codegurus around the world.;)
On Windows 9x, we can use Winipcfg.exe /release and then /renew.
So, use CreateProcess function to run winipcfg.exe at the background.
I'm still looking for how we can do these by our own program.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
hi !!
i have a directory structure which i monitor using a File-Hook. now i don't want to allow creations or copying of directories in this directory structure. i can detect these events using the file hook.
now my question is:
HOW DO I UNDO THESE EVENTS??
i don't wanna delete these newly created/moved diretories coz user may have some data in it.
does anyone know how to do this??? then plz do help me...
|
|
|
|
|
Is it possible to find out the serial numbers of motherboard, graphic device, hard disk, RAM, and the others?
|
|
|
|
|
Yeah, unscrew them, take them out and hold them under a light.
Seriously, I don't think that info is electronically coded to the peripherals. Imagine how much more video cards would cost to make if they were also unique. The only peripheral I know like that is a Network card, that's why they used to be used to build GUID's.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Hard disks have a serial number, but I don't know any WinAPI call to read it. The ATA command IDENTIFY DEVICE or SCSI INQUIRY command will return the serial number information (among other info).
|
|
|
|
|
I know i make a fool of myself but i never heard of ATA
|
|
|
|
|
ATA = AT Attachment is the official name of the interface commonly called "IDE". The ATA standards are developed by NCITS T13
|
|
|
|
|
i have created 5 pages in a propertysheet.when the second page appears a LogonDialog wil come.if the user clicks on the cancel button of LogonDlg,that page should call the next page.i created that LogonDlg in the InitDialog function of that page.if antbody helps me in this will be praised.
thanx and regards
Thomas
Thomas Kennedy
|
|
|
|
|
i have created 5 pages in a propertysheet.when the second page appears a LogonDialog wil come.if the user clicks on the cancel button of LogonDlg,that page should call the next page.i created that LogonDlg in the InitDialog function of that page.if antbody helps me in this will be praised.
thanx and regards
Thomas
|
|
|
|
|
i have created 5 pages in a propertysheet.when the second page appears a LogonDialog wil come.if the user clicks on the cancel button of LogonDlg,that page should call the next page.i created that LogonDlg in the InitDialog function of that page.if antbody helps me in this will be praised.
thsnx and regards
Thomas
|
|
|
|
|
Hi,
I have a strange problem using SQL API from Visual C++ 6.
I'm not working directly with the SQL API , instead I'm using MFC CRecordset
and CDatabase. Of course, I had to subclass these to modify general
behaviour (and , what a task!). One of the (many) things that
CRecordset doesn't support is asynchronous query processing. And that's
where I have a strange problem that I can't find a solution for.
After allocating the statement (::SQLAllocStmt) and setting the option for
asynchronous processing
(::SQLSetStmtOption(m_hstmt, SQL_ASYNC_ENABLE, SQL_ASYNC_ENABLE_ON)) the
query is executed
(::SQLExecDirect(m_hstmt, query_nts_string, SQL_NTS)). This last SQL
function returns SQL_STILL_EXECUTING as long as the query isn't finished.
The SQL documentation states that when processing asynchronously, only the
same SQL function with the same arguments or SQLCancel or some other
diagnostic functions can be called on the statement, as long as the original
SQL function is still executing (check MSDN).
I modified CRecordset (Visual C++) through subclassing to support
asynchronous processing using these rules. I added a method IsStillExecuting
to check whether the query is still executing, and a method CancelQuery
which cancels the query if it is still executing (CRecordset's method Cancel
doesn't work). These methods work fine following the rules I mentioned.
Also, reading the records from the resultset (recordset) works fine, *but*,
only for the first number of rows (around 20). The records in CRecordset are
read using SQLExtendedFetch, but I modified this in my subclass to use
SQLFetchScroll because I read in SQL docu that SQLExtendedFetch cannot be
used on asynchronous statements. After some number of rows the
SQLFetchScroll function returns SQL_STILL_EXECUTING.
Ok , I thought, I'll just have to call SQLFetchScroll until it no longer
returns SQL_STILL_EXECUTING, but that does *not* work , contrary to what the
SQL API docu states. The second time SQLFetchScroll is called it returns -1
(an error code). The exception that is thrown states "HY010 Function
sequence error". I checked SQL API docu and didn't find why this is
happening. The statement is processed from one thread only, no other SQL
functions are executed on the statement when it is still executing, and I
didn't mix SQLExtendedFetch calls with SQLFetchScroll calls.
So what can I be doing wrong?
Tnx
PS: OS specifics are: NT4/SP5, Visual C++6SP4(?), ODBC driver for MS SQL
Server version: 3.70.08.20 (SQLSRV32.DLL).
TiTi (Tom Tempelaere)
Upsilon S.A. - Financial and Computer Engineering
Luxembourg
|
|
|
|
|
- first i use navigate2 to load a web page
- then i want to fill in an edit box and then to press a submit button
(of course i dont want to do it manually, but code pls)
|
|
|
|
|
You need to get a pointer the the IHTMLDocument2 interface which can be done like so:
IDispatch* pDisp = GetHtmlDocument();
IHTMLDocument2* pDoc = NULL;
pDisp->QueryInterface(IID_IHTMLDocument2, (void**)&pDoc);
IHTMLElementCollection* pColl = NULL;
pDoc->get_forms(&pColl);
Then you can browse through all the objects on the form (document) by using the methods of the IHTMLElementCollection interface. Hope this helps.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
I would Like to create a window that essentially looks like a toolbar but is independent can any one help how to do it
thanks in advance
|
|
|
|
|
you could try using the WS_EX_TOOLWINDOW style
Nish
|
|
|
|
|
I try now to convert all my project (that I writed as MFC dll) to ATL type
I opened by the wizars ATL class Dialog with mfc support and I fill its method with my code that I copies from my project.
Maybe someone can tell me if is it possible that the ATL will contain code of MFC as mfc functions , types and objects like CString.
I trys it and this is works with mfc client program but the question if is it will be match for Delphi and another .
What do you say ?
With manny thanks !!!
|
|
|
|