|
If you leave off a ; on a class declaration you can end up with very confusing error messages
class MyClass
{
} <--- oops!
And there's very little that will pin-point the actual errors. In cases like these you just have to try changing/removing things until you can narrow down the actual error.
Todd Smith
|
|
|
|
|
Are you including the right fstream header somewhere else ? fstream.h is not standard, you should include fstream instead. The same goes for all other iostream headers such as iosfwd and so on.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Having worked in Boreland Builder for GUI the last 4 years, was forced to use VS and MFC to do a rather complicated GUI. I simply can not believe it is as painful as it seems.
The some of the GUI libs on here are very nice, but on the whole the work has to be a factor more.
Are there any benefits to using VS and MFC over an actual RAD enviroment?
|
|
|
|
|
Anonymous wrote:
Are there any benefits to using VS and MFC over an actual RAD enviroment?
MFC looks good on your resume.
-c
Aiei i ea eio aoa i e eio e aigoa
|
|
|
|
|
Hi,
Yeah, it definitely looks good on your resume and is a must-have. However, having said that I am not a big fan of MFC myself. It really bloats up the software and makes it sluggish. However, companies use it and you are left with no choice. In my personal projects, I make wrapper classes around the WIN API.
Relisoftis a good resource if you want to learn about programming for windows without the use of MFC. Even if you use MFC, it is a site worth looking at. I am not saying, do not use MFC at all. But it sure is a good learning experience, if you know your way around WIN32 API.
My 2 cents
Pankaj
Without struggle, there is no progress
|
|
|
|
|
VS and MFC aren't exactly the best RAD tools available, but I find they have more power and flexibility than Borlands offerings. It depends on what you are trying to develop. MFC is great for building large applications, but you do need to know how and why things work in it.
I love MFC, but it is starting to show its age but for nearly 10 years it has allowed me to develop lots of Windows applications quickly (if not always easily)
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
Hello, where do I get my hour/minute from the computer?
CString mydate;
mydate.Format("%d:%d", xxx );
|
|
|
|
|
Assuming you can use native Win32, see:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/time_functions.asp
Not sure how MFC does things.
|
|
|
|
|
Check CTime::Format and COleDateTime::Format.
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
|
one class :
CTime
usefull member function: Format
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Using MFC, you could use the CTime class.
Kuphryn
|
|
|
|
|
|
Hello and thanks in advance for your help.
I've got an app that's been released into production for a couple years now. Recently I've had reports of an IPF occurring at 01F:004013AB. I have not been able to reproduce this error in my testing environment.
I have tried to set a breakpoint at this memory address, but the IDE shows an error. I've noticed a few things - one is that the memory address maps to different code locations depending on wether I'm running a beta or release version in the IDE. So I've been trying to break at the memory location when in release configuration and checking the disassembly - with no luck. The other thing I've noticed is that this is a very early memory location, seeing that windows loads apps at 00400000.
Does anyone have any insight into this? I'm wondering a few things: is that memory address (004013ab) comparible across OS'es? Is it comparible across machines? Is there a way to figure out what is causing the error without debugging on a machine that is causing the error?
|
|
|
|
|
The adress 0x004000000 is the default base adress in your linker settings. You can (should) change this anyway. I believe there are some articles on MSDN about load adresses of applications that explain the why and how. Basically, windows tries to load you application into this adress space. If there is already another application loaded (most probably is -> default base adress of VC) then it will 'relocate' you application to another adress.
The adress you mentioned 0x004013AB is just 0x13ab bytes into the start of your application (0x00400000). If you take a look at the assembly listing of your app, or set a breakpoint onto this adress (depending on the load adress on your debuggin environment) you will find the spot where the error occurs.
Hope it helps.
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
If you subclass a CListCtrl and call it CMyListCtrl and then use the CMyListCtrl as a member variable in a dialog box, some of the messages are caught by the parent dialog and some are sent to the CMyListCtrl. I was wondering if there is a way to direct these to catch these in my actual dialog instead of in my control.
|
|
|
|
|
PreTranslateMessage()
Renjith-CPian.
|
|
|
|
|
It seems you've used message reflection to handle control notifications. If you want to give dialog a chance to handle them as well, use ON_NOTIFY_REFLECT_EX and return FALSE from handler defined in control class.
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
1.How do I start my CFileDialog in a particular folder. Actually I want it to detect the folderthe app is in, and start off in that directory by default.
2. Same question a s above, but now I also want the name of a particular file in the app directory(known file) to be populating the File NAme box in CFileDialog.
Thanks,
I hope it can be done.
ns
Its the Open dialog
|
|
|
|
|
CFileDialog( BOOL bOpenFileDialog, LPCTSTR lpszDefExt = NULL, LPCTSTR lpszFileName = NULL, DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, LPCTSTR lpszFilter = NULL, CWnd* pParentWnd = NULL );
where :
lpszFileName
The initial filename that appears in the filename edit box. If NULL, no filename initially appears.
try working on it!
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Okay. but how do we set the default directory? I havent tried your idea yet but I'm thinking I'll be entering stuff like:
lpszFileName = "file1.txt"<br />
with no directory info....
So am I missing something?
Thanks so much,
ns
|
|
|
|
|
CFileDialog has one struct like this:
typedef struct tagOFN { // ofn
DWORD lStructSize;
HWND hwndOwner;
HINSTANCE hInstance;
LPCTSTR lpstrFilter;
LPTSTR lpstrCustomFilter;
DWORD nMaxCustFilter;
DWORD nFilterIndex;
LPTSTR lpstrFile;
DWORD nMaxFile;
LPTSTR lpstrFileTitle;
DWORD nMaxFileTitle;
LPCTSTR lpstrInitialDir;
LPCTSTR lpstrTitle;
DWORD Flags;
WORD nFileOffset;
WORD nFileExtension;
LPCTSTR lpstrDefExt;
DWORD lCustData;
LPOFNHOOKPROC lpfnHook;
LPCTSTR lpTemplateName;
} OPENFILENAME;
lpstrInitialDir
could help u with something??
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thanks. Thats great info. I didnt know that this struct existed, and really didnt see it mentioned in the CFileDialog documentation, at least at first glance.
Appreciate it,
ns
|
|
|
|
|
Great! Glad could be a help!
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hello!
I saw the article about "Load, show and convert miscellaneous file-formats using freeimage
" in this codeproject site. The project is so great.. Gettting image file information is what I need. But I don't want to use MainFrame... Document.. or menu bar.. at all..
All I need is only file name..
So I create new testing Dialog based project Called, JPEGINFO,
Then I add following function..to my project.
<br />
BOOL CJPEGINFODlg::GetImageInfo()<br />
{<br />
FIMULTIBITMAP *m_pBitmapMP;<br />
FIBITMAP *m_pBitmap;<br />
<br />
m_pBitmap = NULL;<br />
m_pBitmapMP = NULL;<br />
CString msg,msg1,msg2;<br />
<br />
CString filename = "E:\\filesfolder\\two\\New Folder\\FaxMachines.JPG";
<br />
m_pBitmap = FreeImage_LoadJPEG(filename,JPEG_DEFAULT);
m_pBitmapMP = FreeImage_OpenMultiBitmap(FIF_JPEG,filename,false,false,false);<br />
<br />
if( !m_pBitmap )<br />
{<br />
MessageBox( "Sorry couldn't open!!");<br />
return false;<br />
<br />
}<br />
<br />
return true; <br />
}<br />
But I got following errors..
<br />
<br />
--------------------Configuration: JPEGINFO - Win32 Debug--------------------<br />
Compiling...<br />
JPEGINFODlg.cpp<br />
Linking...<br />
JPEGINFODlg.obj : error LNK2001: unresolved external symbol __imp__FreeImage_OpenMultiBitmap@20<br />
JPEGINFODlg.obj : error LNK2001: unresolved external symbol __imp__FreeImage_LoadJPEG@8<br />
Debug/JPEGINFO.exe : fatal error LNK1120: 2 unresolved externals<br />
Error executing link.exe.<br />
<br />
JPEGINFO.exe - 3 error(s), 0 warning(s)<br />
I included "freeimage.h" to my project though.
i don't know why I can't run. Would you please help me...
Thank you so much..
|
|
|
|