|
the control won't show up when I execute my program in other computer..
why ??
|
|
|
|
|
Is the ocx in that computer?
Is the ocx registered in that computer?
(When the ocx is not in the computer, o is missing some componnent, or the ocx is not registered, the componnet not appear)
Best Regards
Carlos Antollini.
|
|
|
|
|
please answer the question:
how can i move control with mouse on the dialog but without drag&drop?
|
|
|
|
|
First capture the notifications from the mouse on the desired control, then move the control to the position of the mouse using MoveWindow.
To redraw the movement of the control while the mouse is moving capture the WM_MOUSEMOVE and move the control accordingly.
See:
CWnd::MoveWindow
WM_MOUSEMOVE
WM_LBUTTONDOWN
WM_LBUTTONUP
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
How do I go about displaying Windows Explorer style forlder view without control panel, printers and recycle bin, but only to include drives (hard disks, floppy disks and CD roms) and directories with correct icons. Is there a system property does assosiates icons to device types?
Please help,
Tushar
|
|
|
|
|
Hello,
Sorry if this is a repleat type question.
I have been using this site to learn more about WTL and there is very useful information included. I am trying to develop a FormView type application that has a toolbar + statusbar + dialog type form view. When I create such an application with WTL app-wiz, I do not get scroolbars the way MCF app-wiz does and therefore if I resize the eventual application, I cannot scroll which you can imagine causes a problem.
Next question, it is possible to display menus in MCF application with icons, like WTL apps do? I do not want to incorporate large amounts of code into my app that is not tested. This way I would not have to use/learn WTL.
Please help,
Tushar
|
|
|
|
|
After i compiled my project in the release version and execute my program in other computer, there is an erros msg says "An unsupported operations was attempted".
I think the one causing it is my MFC 2.0 GridControl
What can I do ???
|
|
|
|
|
I don't know where the gridcontrol resides (comctr32?), but it seem like
you either don't have the module on the testcomputer, or it is not registred. Check version for whatever module gridcontrol resides in, and try to (re)register it using regsvr32.
/moliate
|
|
|
|
|
How to get the manufacturer/model of a given cd-rom drive letter?
I know how to get this from registry (HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi) but how to associate a given drive letter and a given scsi port? But if I can associte this information, how about other types of cdrom's (SCSI/EIDE)?
Any help would be apreciated!
Thanks in advance!
Rui Lopes
|
|
|
|
|
I want to print from a document that it contain
text,the text is more than one page,how and where
I should initialaze it and write code for it?
|
|
|
|
|
the code as follow:
bool CDBOperate::CanLoginToDB(CString username,CString userpassword)
{
if(username.GetLength()<=0||userpassword.GetLength()<=0)
return false;
if(!m_db.IsOpen())
ConnectToDB();//this function use to open database
char *sqltext="select * from user";
CDaoRecordset rs(&m_db);
try
{
rs.Open(AFX_DAO_USE_DEFAULT_TYPE,sqltext,0);
}
catch(CDaoException* e)
{
e->Delete();
return false;
}
rs.m_strFilter="user="+username+" and password="+userpassword;
int i=rs.GetRecordCount();
if(i<=0)
{
rs.Close();
//delete rs;
return false;
}
rs.Close();
//delete rs;
return true;
}
but each time I can't get reocrd from datbase(user.mdb).
In fact ,there are 3 record in the database.
|
|
|
|
|
Your problem is in the Filter...
See the following
rs.m_strFilter="user="+username+" and password="+userpassword;
This must be
rs.m_strFilter="user=\""+username+"\" and password=\""+userpassword + " \"";
You forgot the quotes in your sentence.
The Filter is the where in a SQL sentences. User and userpassword fields are char, is for this that the value that are you looking for must be between quotes.
Best Regards....
Puff Today is Monday....
Carlos Antollini.
|
|
|
|
|
I tried it,but I can't get record too.
I don't know why!
help!!
|
|
|
|
|
GetRecordCount() typically doesn't know how many records you have until you're iterated over all of the records. My loops typically look like:
while (!rs.IsEOF())
{
...
rs.MoveNext();
}
Joel Lucsy (jjlucsy@concentric.net)
|
|
|
|
|
Hi all,
I'm trying to create some exported functions in a DLL; these functions are called from my main application(the main application is a console application). When a user type 'X' and enter, I want launch my Doc/View usign a DLL.
Therefore I've to create a window supporting MFC doc/view architecture.
Problem is that I don't know how create this window????
Thks for you help,
HES
|
|
|
|
|
You could look at this http://www.codeproject.com/docview/docviewfromdll.asp
Cathy
|
|
|
|
|
Is there a simple method to draw anti-alias'ed circles or lines? For example, if I use the code:
pdc->Ellipse( ARect );
It draw an ellipse. Is there a simple method to define a pen type that will perform anti-aliasing for me?
Thanks in advance..
|
|
|
|
|
Use the new GDI+.
Search for GDI+ or GDI plus on CodeProject
Bys,
Rui Lopes
|
|
|
|
|
How to display different icons for a tree control item when it is expanded and colapsed?
Nitesh
|
|
|
|
|
You need to set an imagelist for the state: SetImageList( &il, TVSIL_STATE );
Beyond that, I'm not quite sure.
Joel Lucsy (jjlucsy@concentric.net)
|
|
|
|
|
This will work nicely (apart from the typos ):
void CWindowWithTreeCtrlInIt::OnTreeItemExpanding( NMHDR* pNMHDR, LRESULT* pResult)
{
*pResult = 0;
NMTREEVIEW* pNMTreeView = (NMTREEVIEW*)pNMHDR;
HTREEITEM hCurrent = pNMTreeView->itemNew.hItem;
BOOL bExpanded = TVIS_EXPANDED & m_wndTree.GetItemState(hCurrent, TVIS_EXPANDED);
if ( m_wndTree.ItemHasChildren(hCurrent) )
{
int nNewImage = bExpanded ? 0 : 1;
m_wndTree.SetItemImage(hCurrent, nImage, nImage);
}
}
Important bits: use TVN_ITEMEXPANDING, not TVN_ITEMEXPANDED; TVN_ITEMEXPANDED is only called the first time an item is expanded, or after TVE_COLLAPSERESET has been called on it.
|
|
|
|
|
Hello guru's. I've experienced pretty strange OS specific bug or something using SDI app with database support (ODBC), using microsoft access database. I wrote the program under Win2K and it worked perfectly untill I tested it under Win98. It seemed that neither m_pSet->Edit();m_pSet->Update();m_pSet->Delete() work as they are supposed to. It gives me the following error "Query is too complex". I dug really deep in the MFC documentation and did not found any solution. Any workarounds, or ideas of fixing that eror and making my program work?
PS: After the error it doesen't allow me to save changes - the error occurs when I edit some fields and i try to move to the next record (that's the way it saves modifications). It only let's me create new records and edit the key field.
|
|
|
|
|
Hmmm, it's been a while since I've done anything with ODBC in MFC, but I do remember a few things. First, MFC internally composes the SQL commands to do your inserts, updates, and deletes. Use the debugger to do some more digging into the MFC code, until you get to the part where the command is fully composed and ready to be executed. Then grab it, open up the MSQuery tool, and try to execute it there. In theory you should get the same error message, which would probably indicate a driver issue.
Search for "Query is too complex" in MSDN and you may get some feedback.
Good luck,
Alvaro
|
|
|
|
|
Thanks for the reply, I found a fix, and I do think that the error was because of some Win98 specific code. In the MSDN you can't find any information on that error - I found it in some header file - with no explanation on when it occures and why. The fix was simple - I changed the parameter in the recordset's class from snapshot to dynaset and it started working. Under W2K it works fine, but in win9x it works as a read-only method.
Cheers,
Deian
|
|
|
|
|
I've got a problem while debugging a programm. When exiting the program in debug mode, i've got memory leaks and i would like to analyse them in order to free objects which are not deleted. The code is a bit long and verifying all code would be impossible. Is there a tool I could use? or a method to applicate?
Thanx for your response and excuse me for the errors in text, i'm french...
|
|
|
|