|
How do I develop a solution to enable spell checking on a text box using Win 32 SDK.
Looking for a ideal solution.
Thanks
Siva
|
|
|
|
|
oYou could automate Microsoft Word. Look in MSDN somewhere I think.....
|
|
|
|
|
Following code works well when compiled with Microsoft c-compiler :
j = 0;
j = (j < 1) ? j++ : 0;
--> result j = 1
When compiled with Microsoft c++ compiler
--> result = 0 (wrong)
Can somebody explain this?
|
|
|
|
|
0 is correct, use ++j if you want j to be incremented before being assigned back to itself.
You get 0 because C++ create a temporary (j) variable and increments it (and discards it in this case),
where as C doesn't bother (I think).
|
|
|
|
|
Well, the correct answer is 0. The assignment reduces to:
j = j++;
Since j++ evaluates to 0, 0 gets stuffed in j.
This is really bad programming practice, though. I hope you don't plan on writing production code this way.
|
|
|
|
|
How do I scan a registry folder?
|
|
|
|
|
Take a look at RegEnumKeyEx.
Also check help for 'Registry Functions'
regards,
Louis.
|
|
|
|
|
I am writeing a windows program that runs a file i/o function that takes a while to run, and I can't figure out how to make it update the programs window while it is running the funtion. How do I get it to run the window's window procedure in the middle of the function? (I think that is what I have to do..)
This is probably a really easy thing to fix, but I can't figure it out.
BTW this is a dialog based program (a dialog made in the resource editor) if that makes any difference..
Any help would be greatly appreciated.
Thank You.
|
|
|
|
|
Hi!
Put the following function into your dialog class
and call it in the file i/o loop. This will ensure
that the window messages are correctly disptached.
void CYourDialog::PumpMessages()
{
static MSG msg;
if( GetSafeHwnd() != NULL )
{
while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{
if( !IsDialogMessage( &msg ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
}
}
}
HTH
Holger Persch
|
|
|
|
|
|
Hi.
It looks like I am missing NAFXCWD.LIB and gets some linker errors.
Can anyone be so kind to mail me this file or tell me where to find it.
Email: patrik.andersson@kvarnstrands.se
Regards
Patrik
|
|
|
|
|
That's one of the MFC statically-linked libs. Just grab it off your VC CD and copy it to <vc6 install="" dir="">VC98\MFC\LIB.
|
|
|
|
|
I'm having a weird problem where my CListCtrl doesn't show all the items that I load in it. I'm using
a function to load the control initially using LVITEM with InsertItem() followed by SetItem() for all
subitems, and this part works.
However, as the program is running I have to update the listctrl so I call ResetContent() to clear the rows
and then call the initialize function mentioned above to reload everything. The problem is that when I
do this, only the first item shows up in every row. Usually the subitems are blank in most of the rows.
Some rows do show up correctly, but this is only on a few rows. When I say correctly I mean all
subitems are shown with the main row item. Can someone help me with this?
Thanks in advance,
--Trey
|
|
|
|
|
Hi Trey,
Very weird! Maybe there's a bug in the initializing function... Can you provide some code?
Paolo.
|
|
|
|
|
Ok, I have a database objectthat has two vectors of CStrings. I update the database and then call LoadListData(). Like I said before this is weird!
Here is the code to initialize the data:
void CMyDlg::LoadListData(CDatabase* database)
{
// Delete the current contents
m_cListCtrl.DeleteAllItems();
// Use the LV_ITEM structure to insert the items
LVITEM lvi;
lvi.mask = LVIF_TEXT;
CString strItem;
int numberOfAddresses = database->GetAddressCount();
for (int i = 0; i < numberOfAddresses; i++)
{
//*
CAddress* a = database->GetAddress(i);
// Filter if necessary
if(m_bFilterOn && a->m_csCategory != m_csFilterCategory)
continue;
// Insert the first item - First Name
lvi.iItem = i;
lvi.iSubItem = 0;
lvi.pszText = (LPTSTR)(LPCTSTR)(a->m_csFName);
m_cListCtrl.InsertItem(&lvi);
// Set subitem 1 - Last Name
lvi.iSubItem = 1;
lvi.pszText = (LPTSTR)(LPCTSTR)(a->m_csLName);
m_cListCtrl.SetItem(&lvi);
// Set subitem 2 - Company
lvi.iSubItem = 2;
lvi.pszText = (LPTSTR)(LPCTSTR)(a->m_csCompany);
m_cListCtrl.SetItem(&lvi);
// Set subitem 3 - Address 1
lvi.iSubItem = 3;
lvi.pszText = (LPTSTR)(LPCTSTR)(a->m_csAddress1);
m_cListCtrl.SetItem(&lvi);
// Set subitem 4 - Address 2
lvi.iSubItem = 4;
lvi.pszText = (LPTSTR)(LPCTSTR)(a->m_csAddress2);
m_cListCtrl.SetItem(&lvi);
// Set subitem 5 - City
lvi.iSubItem = 5;
lvi.pszText = (LPTSTR)(LPCTSTR)(a->m_csCity);
m_cListCtrl.SetItem(&lvi);
// Set subitem 6 - State
lvi.iSubItem = 6;
lvi.pszText = (LPTSTR)(LPCTSTR)(a->m_csState);
m_cListCtrl.SetItem(&lvi);
// Set subitem 7 - Zipcode
lvi.iSubItem = 7;
lvi.pszText = (LPTSTR)(LPCTSTR)(a->m_csZipcode);
}
}
|
|
|
|
|
Well, what I can see is: it lacks the last SetItem.
For ther rest it seems OK.
Try doing ASSERTs on the return value of each SetItem and go with the Debug version.
Also, you may try to add:
ZeroMemory(&lvi, sizeof(LVITEM));
just after the definition.
I found that sometimes this could help... or does nothing
Paolo.
|
|
|
|
|
I'm still having problems. Can anyone help me please? I'm only using the report mode and I have added the columns correctly. Like I originally stated, I'm able to load the listctrl successfully once.
|
|
|
|
|
I've created an Edit control as a Child Window of Internet Explorer Band. This gets loaded at the bottom for every instance of IE.
But whenever I type in the Edit control, a few keys are not functioning ( Like Back Space etc.,).
Is there a solution for this?
Looking for your guidance
Siva
|
|
|
|
|
I've created an Edit control as a Child Window of Internet Explorer Band. This gets loaded at the bottom for every instance of IE.
But whenever I type in the Edit control, a few keys are not functioning ( Like Back Space etc.,).
Is there a solution for this?
Looking for your guidance
Siva
|
|
|
|
|
Did you implement IInputObject?
|
|
|
|
|
Hi,
I'm a student working on a project and I'm stuck and running out of time! God please help me!!!!
I'm trying to convert data in text files(i.e data in notepad) into Microsoft Access Tables.
In order to convert data in text files into access tables, the user is to provide 2 text files(usually done with notepad), the first one has a .name extension(i.e. example.name), and the other has a .data extension(i.e. example.data). the file with the .name extension will contain names, or attributes which will be used as the field names for the access table. (i.e cusotmer name, product#, etc). the .data extension file will contain the actual data for each field. (i.e john smith, JK-1345).
My program is suppose to take the data from the 2 text files, read the data from the .name files, create a new table and plug in the names to create the fields for the table. Then the other text file with the .data extension will be read and the values will be plugged into the newly created table.
My problem is that I don't know how to create a new table from VC++6. The books that I've been referring to only shows examples that deal with tables that have already been created. How exactly do I create new tables and insert the values from the two files with VC++6???
If you can provide with some sample codes that would be greatly appreciated. Thank you very much and PLEASE HELP ME!
I'm trying to do this using a option from a menu created in a single document.
Sincerely,
Steve
One more thing, do I have to create an empty project in Microsoft Access first in order for me to create new tables?
|
|
|
|
|
You need to look at CDaoDatabase::Create and CDaoTableDef::Create in the MFC DAO documentation.
Create (database) will create the .mdb. You shoudn't need to create the access .mdb file first.
CDaoTableDef can Open or Create tables in a database.
Then CDaoTableDef::CreateField ...
Just a point here tho - if you have a text file of columns of data, its really easy to open access, open/create a db, and use the File | Import dialog to bring the data in. Optionaly, you can specify that the first line in the file contains the field names.
You'll get finer control over the TableDef and Field attributes doing it programmatically, but its going to be a bit more work.
|
|
|
|
|
Hello, codegurus around the world.
How about using SQL statement directly.
After you create table.txt and insert.txt, you can use
ADO or the other class to execute SQL.
But, in this case, you must create the blank database file of Access first.
(table.txt)
CREATE TABLE Customer (
Name char (15),
Product_name char (15),
primary key(Name));
(insert.txt)
INSERT INTO Customer VALUES ('Masaaki', 'Nike');
.......
You can restore these info to strSQL(CString) by reading the file by each line or buffer, and execute these SQL by class member function like open().
Good luck.
-Masaaki Onishi-
|
|
|
|
|
Just wanted to say thanks!
|
|
|
|
|
Is anybody have the ready made source code for edit control that immitates winword text box. please help.
thank you.
|
|
|
|