You can always use memset(...)
Chad Koehler
Posts
-
MFC Printing Question -
get default printer nameLook up the ::PrintDlg Win 32 API Function. There is a flag you can set to retrieve the default information. If you are using MFC, CPrintDlg offers the same functionality. You can get the information without displaying the dialog in either case.
-
how to lock PC?Sounds fishy.... How exactly would you restore the computer so that 'you could start working again'?:~
-
What color is gray?You can user the GetSystemColor() function to get any of the Windows system colors. You can use GetRValue() GetGValue() and GetBValue() to get the actual values (that you may or may not still need).
-
Another map questionYou can still use CString.
CString csWrite(_T("Hello World")); CFile cFile; cFile.Open(...); cFile.Write((void*)(LPCTSTR)csWrite, csWrite.GetLength());
-
Holy Dense... Codeguru Guru'sIf you are using the document/view architecture, look up CDocument::SaveModified() in MSDN.
-
CListView is evil?take off the Auto-Arrange feature?
-
WINAPI Function - NT Only!?try adding the following to your code (before including windows.h and winuser.h) #define _WIN32_WINNT 0x0500 I needed it for the function InitializeCriticalSectionAndSpinCount()
-
Beginner question: Limit number of MDI pages open at one time...Do you have multiple document templates? Or multiple views off of the same document... Either way what you are asking is possible. Just two different ways to do it.
-
how do I derive a class from a template class?hmmm....I don't know if there is anything wrong with what you are trying to do. My only thought would be that the CFlash is relying on the constructor of CFlash and for some reason, it is not accpeting that. FYI, this is how we do it. template class foo_template { }; class foo { }; class foo2 : public foo_template { };
-
How do i delete a record set???:confused: What do you mean by recordset? Do you mean you want to delete all of the data that is contained in your recordset? Or do you want to delete an entire table or view? CRecordset (which ODBCRecordset is based on) has a Delete() function, which will delete the currently selected record. You could just loop through each record and delete it from the database. If you want to drop an entire table or view, you should use the CDatabase class. Look at the ExecuteSQL() function.
-
Debug assertion failed:confused: Are you just trying to iterate through the list? If so, there are easier ways, I will elaborate if needed. Otherwise, just remove the line that says 'delete pos;'. As was stated this is a variable declared on the stack. Trying to delete it will cause debug assertion errors. (Worse yet in release mode)
-
Opening a CRecordset derived class problemI think the problem may be in your DoFieldExchange() function...I can't think of anywhere else that the problem could be.
-
Border Width of a ControlLook at ::GetSystemMetrics() in MSDN... int xBorder = GetSystemMetrics(SM_CXBORDER); int yBorder = GetSystemMetrics(SM_CYBORDER);
-
Programmatically Run a Remote ProcessI have a system that runs multiple services on multiple servers. I have a program that will shutdown and restart a server. I need to know how I can run this program on each server programmatically from one of the servers? AKA: Remote Process