|
I have the same problem. It just feels more natural, and easer to read/write (x==7) instead of (7==x). But good habits (a.k.a constant==variable) are good habits. I keep trying to break this one, but habits are haibts.
Trust in the code Luke. Yea right!
|
|
|
|
|
Unless, of course, you use warning level 4, which will give the compiler warning "warning C4706: assignment within conditional expression" if you try to do if (myVar = 0) . This happened only in VC++ 5 or 6, I believe; before that, you had to do the if (0 = myVar) hack to get the compiler to complain.
Best wishes,
Hans
|
|
|
|
|
Hi,
Is there any tool which converts the .pdf file to .ppt file format?
|
|
|
|
|
No, given the nature of .pdf files. (you'll find tons of tools the other way).
The best way to achieve it though is to insert the Adobe ActiveX control in one of the slides.
|
|
|
|
|
Thanks for the reply.
Could you please tell me how to insert the Adobe ActiveX control in the slides?
|
|
|
|
|
Using the mouse and an empty .ppt file, it's Insert \ Object, then browse your folders and search for the AcroFx32.dll (or something like this).
To mimic exactly this by code, you can use the Powerpoint object model. (MSDN for more info).
|
|
|
|
|
Hello,
is it possible to include .cpp files using the #include directive? I want to include an external library into my project, but the library has many files and so I would have to add all cpp-files to my project by hand.
Is something like the following allowed?
#include <extfile1.h>
#include <extfile1.cpp>
#include <extfile2.h>
#include <extfile2.cpp> etc...
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
I'm pretty sure you can.... as long as the library that you are linking in excludes the same cpp files from its build. Otherwise you'll end up with multiply defined functions and classes in the obj file.
Why can't you just compile and link the library, and include only the headers?
And they still ran faster and faster and faster, till they all just melted away, and there was nothing left but a great big pool of melted butter
"I ask candidates to create an object model of a chicken." -Bruce Eckel
|
|
|
|
|
Yes and No.
I assume you want to import the source files not an external library, which you would just add though your projects settings (make file) and then include the header files in your code.
1) If you just want to add the code/source files to your project then just add them to your work space and include the headers to the code files that access them.
2) If you realy want (or need) to include the code/source files via #include then you do not need to include the header files before those code/source files, since the headers should have been included in the source files them selfs. The 2 problems with including code/source files with #include, (1) you can only include them in only one source file and then use the headers in all other files which may need to access them, (2) you may get multiple definitions because header files in the included files may not have been coded to prevent it. (alright there could be more that 2 problems)
3) Think about it. Basicaly what the preprocessor does is creates 1 big file and then compiles it. This is simplistic, but what it means is that the preprocessor combines your file and the included files in to 1 file before it passes it to the compiler. Therefore, if you include code/source files in each of the files that use them then it is the same as cutting and pasting the contains of those files in to each of those files.
Trust in the code Luke. Yea right!
|
|
|
|
|
Thank you, I will think about it
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Hello!
I have a problem.
I figured out how to use a database on MDI and SDI applications but how can I use one on a Dialog based application?
I want to get some entries of a database and show them to the user on the dialog ( but I dont want to use a SDI or MDI based application... just a dilog based application )... I tried to add a RecordSet and a Recordview on my own and choose a database for it but it gave me some errors...
I already looked the MSDN but I didnt find anything about it ...
Can someone help me?
Please ...
I thank you for your answers...
|
|
|
|
|
The simplest way is to use DBGrid and then make its dataSource property point to the database.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
|
MSDN introduces how to customize print dialog,but how to customize print setup dialog?
|
|
|
|
|
In my program:
CString str;
CRect rect;
pDC->DrawText(str,&rect,DT_TOP|DT_WORDBREAK);
If the string is too long,It can be displayed in many lines.
I want to change the system row spacing.How can I do?
|
|
|
|
|
You'll have to change the font. Look up the LOGFONT structure in the MSDN.
Software Zen: delete this;
|
|
|
|
|
I am trying to include some graphical reptesentations in my MFC(SDI) application. I have successfully drawn bar graphs by using progress bars. But haven't been able to draw pie charts. I have found some controls on the following link but have never used controls other than drag and drop(built-in VC++ ). Plz help me how to use these controls in my program.
http://www.codeguru.com/controls/pie_chart_ctrl.shtml
If there is some other way of doing so plz suggest as I want to adopt the easiest way or ant other type of graphs which are easy to develop.
Reply me soon
|
|
|
|
|
you can use mschart control. it includes a pie chart as well.
You can find it in the gallery. In order to add it simply choose Project->Add To Project->Components and controls->Registered activeX controls and choose Microsoft Char control.
|
|
|
|
|
Usually it'd take me a few seconds to fix an "undeclared identifier" error from the compiler. A bit longer if I'm dealing with namespace issues. This time, however, I've been sweating it for a FEW HOURS and I'm nowhere near finding out what the compiler is talking about.
Here's what happening. I have this dialog class that I designed and created in the Resource editor, which includes naming all the dialog windows, boxes, buttons (etc.), and DEFINITELY, giving the dialog itself a name.
It's the dialog name that the compiler is flagging as the "undeclared identifier" problem.
Because it's a dialog application and I'm dealing with DoDataExchange(), the system is what fills in those information for me, and as far as I can tell, they're ALL there, and they're ALL spelt correctly.
It's the "enum { IDD = IDD_MAIN_DIALOG };" that appears in the class definition is where the compiler is pointing the error as coming from.
There are no missing ";", "{", "(", ")" or misspelt variables preceding this location either that might be causing the compiler to misdiagnose, and since there is only ONE "#include" statement that should be present, no problem in that department either. IT IS THERE, WHERE IT IS SUPPOSED TO BE!!!
In desperation, I even undid some of the changes I made to see if backtracking would help, but not even that brought any comfort.
Can anybody guessed why the compiler is telling me that something I KNOW I HAVE DEFINED, is undeclared ?
Thanks for any help. I appreciate it!!!
William
Fortes in fide et opere!
|
|
|
|
|
Did you do this ?
<br />
#include <resource.h><br />
See if that works. If you included the resource.h file in stdafx.h, then clean and rebuild all.
-
Vivek
|
|
|
|
|
#include "resource.h" is present in the header file in which the application class that is derived from CWinApp is defined.
Anyway, I did try putting #include "resource.h" in the header file for which the compiler is complaining about, and it returned even more errors after I did that!! Removed it quickly!!
William
Fortes in fide et opere!
|
|
|
|
|
Is the IDD_MAIN_DIALOG constant #defined in resource.h ?
Is this the only error ?
If your dialog class is in MyDlg.cpp, what is the order of include files ?
It should be
- stdafx.h
- resource.h
- other include files..
It is ok if resource.h is included multiple times, the #pragma once will ensure that exactly one copy is used during compilation.
-
Vivek
|
|
|
|
|
Yes, I have the dialog name constant defined in the "resource.h" file.
I have the #pragma once preprocessor statement present, but when I had #included "resource.h" a second time in dialog class header file, the compiler complained even more. (If you remember, that's what I did the last time and had to remove it.)
I have "#include <<afxwin.h>" in the stdafx.h file, so it's not necessary to repeat "stdafx.h" before the "resource.h" file. (I had to put a double angle bracket in front of "afxwin.h" so that angle brackets can be seen, otherwise the entire word wouldn't show for this message. However, in the program, only a single pair of angle brackets were used.)
William
Fortes in fide et opere!
|
|
|
|
|
Also, did you use the class wizard to create the dialog class, because I had the exact same problem once? Since I became so "proficient" in MFC I decided to write my own class from scratch and you can't even imagine the disaster that I unleashed to the compiler window. What I am trying to say is, recreate the class for that particular dialog and add functions or code little by little. I really hope that there is a better solution because I am dying to find out.
|
|
|
|
|
Your suggestion for a solution may work, and will probably be my last resort for things to get back on the level. However, the reason why I'm not too hot to try it out right away, is because there have been quite a bit of work that I've already invested in this program, and if I have to end up doing something like that all the time, it is foreseeable where I might have to do the same thing over and over again in a few days time, and then repeat it again in a week's time. IOW, it just doesn't sound like something I might want to consider a TRUE SOLUTION, simply to get over the hump.
What I have done, is backtracked on some of the changes I've made, to the point where I was able to compare both ClassWizard files of what things were like back then with what they are, currently, and both files checked out similar. Still, the "undeclared identifier" error remain for the current file (even though I've checked probably a million times already, that the dialog name does exist, declared, defined and spelt correctly.
I don't know what else I may be missing!!
William
Fortes in fide et opere!
|
|
|
|