|
I want a wrap class for parse regular expression ,can u help me?
Thank in advance!
Please pardon my weak English!
|
|
|
|
|
You might want to take a look at the very C++-oriented John Maddock's Regex++ library
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Depends on the compiler you're using.
If it's a 32-bit compiler (MSVC++ 2 or up for instance),
it would probably be 4.
It if were a 16-bit compiler, it would be 2.
Check it yourself:
printf("Size of UINT is %d BYTES\n", sizeof (UINT));
|
|
|
|
|
|
If I use Microsoft Agent 2.0 ActiveX or com Interface for programming,
(Microsoft Visual C++6.0)
how can I add a button or CheckList on WordBalloon like Microsoft Office Assistants?
if you know,please mail to:liuchuan2901@sina.com.
Thank you !
|
|
|
|
|
I’m writing an MFC Doc/View (SDI) application with database support (DAO).
In CMyDoc class I put a member variable CmyDaoDB* m_MyDaoDB and some function to add/delete data to/from Database.
On the view I build a listbox control in wich I need to put the entire recordset (say Customers).
I’d like to buil a member function in the CmyDoc class that return the list of Customer to view. But how?
I think that the only solution is to access directly to CmyDaoDB from the view to get the customers:
while (!m_MyDaoDb->IsEOF())
{
/* Put the record in the list control */
m_MyDaoDb->MoveNext()
}
Is there a better way to get that list? (I mean more OO)
|
|
|
|
|
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.
|
|
|
|
|
Is there a better way to get that list? (I mean more OO)
"More OO" solution is to create a public member in your doc class which takes CListBox reference as an argument and fills the window with database contents:
void CYourDoc::FillListBox(CListBox &lbx)
{
while (!m_MyDaoDb->IsEOF())
{
int idx = lbx.AddString(...);
lbx.SetItemData(idx, ...);
m_MyDaoDb->MoveNext();
}
}
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
How can I set CRichEditCtrl not to make automatic wrap (word break)?
|
|
|
|
|
Enable Auto HScroll.
/Per
|
|
|
|
|
Enable Auto HScroll.
/Per
|
|
|
|
|
I want to save in file the system time in format of:
____________
DWORD year
DWORD month
DWORD day
DWORD hour
DWORD minute
DWORD second
______________
Which func would give me this or how can I to extract only this data from the func: GetSystemTime() ??????????
|
|
|
|
|
Have you tried it yourself yet? GetSystemTime() will give you WORDs. If you're stuck, post your code so we can see what you've tried.
--Mike--
http://home.inreach.com/mdunn/
"Make sure that if you are using a blow torch that you don't set anything on fire."
-- Chris Maunder
|
|
|
|
|
|
What is the difficulty?
Just copy the values you need and convert them to DWORDs.
I would have understand it if GetSystemTime gave you 6 WORDs and you wanted 8.
|
|
|
|
|
OK, I have made an app that parses a bunch of files and I have all the data
stored into various arrays.
I would like to be able to store this information into an Access database.
I have no clue where to start on accessing Access and writing information to
a database though. If anyone could help me out and point me in the right
direction I'd be greatful!
Adam
cabadam@houston.rr.com
|
|
|
|
|
If you use MFC, CDaoDatabase and CDaoRecordset may help you. With the class wizard add a new CMyDaoRecordset and map the database fields into class members. You find examples on MSDN.
|
|
|
|
|
OK, but it gives me 'unrecognized database format' when creating the class and selecting which database I want to use... I am using Access 2000. Will that not work?
Adam
cabadam@houston.rr.com
|
|
|
|
|
If you use Access 2000 you have to add an instruction in the CYourApp::Initinstance()
The instruction is:
AfxGetModuleState()->m_dwVersion = 0x0601;
This work if you are linking with the MFC DLL.
You can take a look at the Q236991 on MSDN for further details.
|
|
|
|
|
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.
|
|
|
|
|
[snip]
There is another way to do this and use the generic recordset that is posted in the Database section.
[/snip]
What do you mean?
This is my first venture into doing anythign with databases (at least programatically, I HAVE used Access before )
I tried to look into the Enroll MFC sample, but it requires some database that you can't download from online (and I can't find my VStudio stuff right now...)
Adam
cabadam@houston.rr.com
|
|
|
|
|
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.
|
|
|
|
|
Visual Studio 6.0 Wizard don't support Access 2000. You must convert to Access 97 or use ODBC instead (Use CRecordset instead of CDaoRecordset)
|
|
|
|
|
How do I "paint" text/CString in an ActiveX window? A sample code will be helpful...Thanks!
|
|
|
|