|
Hi,
There are so many gurus here who are doing the VC++, COM, ATL , MFC programming. Could people share the interview questions they faced with these technologies. There are rarely any site which mentions the interview questions for these programming skills. Any link to site if anybody knows.
Thanks,
Lee
|
|
|
|
|
Here is a question to you on C++: Can a class constructor be declared private? If not, explain why. If yes, explain why you would do it.
|
|
|
|
|
For those who don't know, Yes it can! You would use this if you wanted to prevent anybody creating this object with a call to "new". Therefore the object itself must control it's own creation and deletion.
Another question if you are in the gaming industry may be something like:
What is a quaternion, why is it different from Euler and what are the advantages/disadvantages of both?
When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!
|
|
|
|
|
Hi,
I want to have a palette which will have some icons.. (As I click the icon the respective command becomes active.). if I kept the left mouse button pressed, I can see the sub command Icons from which any icon can be selected by moving pressed mouse button.. this sub palette can be dragged (pulled )out too to have sub palette.
Thanks
Lee
|
|
|
|
|
This is not a question. What is it that you want ?
~RaGE();
|
|
|
|
|
I want to know hwo to proceed with it.
Which base classes to be used. How can be the
things combined.
Thank you
lee
|
|
|
|
|
Hi all,
In my MDI application, I've drawn an image as the background in OnEraseBkgnd() function. I'd like to keep the image always in Center. But I'm not able to get the center of the window in OnSize. If anyone could help to come out of this problem, it would be quite helpful for me.
Thanks in advance,
Sarvan AL
|
|
|
|
|
Sarvan AL wrote: In my MDI application, I've drawn an image as the background in OnEraseBkgnd() function. I'd like to keep the image always in Center. But I'm not able to get the center of the window in OnSize. If anyone could help to come out of this problem, it would be quite helpful for me.
Well it's easy.
Take the width of the image.
Take the height of the image.
Now the cx parameter in OnSize will be the width and cy will be the height.
So how will you position the image in the centre?
int midX = (cx-bmpWidth)/2;
int midY = (cy-bmpHeight)/2;
Nibu thomas
Software Developer
|
|
|
|
|
Thanks Nibu,
I've forgotten to call Invalidate() in OnSize().
Thanks once again,
Sarvan AL
|
|
|
|
|
Hi,
I am a total beginner. How do I stop from the black screen which displays the result of execution to automatically dissapear?. It came out in a blink of an eye and then of it goes.
I just want to print out a simple "Hello World" message.
Thanks.
|
|
|
|
|
Hi
I have understood your problem.
If your are creating the console application you would be pressing the F5 button. In this case the windows diaplays the result for your execution but just dissappears. For this you have to press CTL+F5.
Cheers
"Peace of mind through Technology"
|
|
|
|
|
I'm using Dev C++. The command to run is F9
|
|
|
|
|
In case if you don't have any issue in using C functions in C++, then include conio.h and add the following code at the end of function.
cout << "Press any key to exit.";
getch();
|
|
|
|
|
Another solution is to call system("PAUSE");
|
|
|
|
|
Open a command prompt and run your program from there rather than from within the IDE. That is why the window is quickly disapearing.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
In C++, inline keyword is a request to a compiler. Compiler can ignore it.
Apart from poking through .asm files, is there any way to to find the list of inline function(s) for which compiler has ignored the inline keyword? May be some compiler setting(s) to generate the report containing this information.
-- modified at 23:55 Thursday 30th March, 2006
|
|
|
|
|
key word inline must be in h file.
if u put inline in c/cpp files, it is ignored.
inline means once.
if only one c or cpp file includes the h file in a project, the key word inline may be ignored (upto compiler).
if more than one c/cpp files include the h file, key word inline is NOT ignored.
A special image tool for Windows C++ programmers, don't miss it!
A nice hyper tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
It seems you didn't get my question.
I don't have any doubt in how to use inline. I know all the rules of inline.
What i am asking is how to find the list of inline function(s) for which compiler has ignored the inline keyword?
|
|
|
|
|
I don't know of any way of getting the compiler to tell you this.
Steve
|
|
|
|
|
I told you clearly:
1. if h file is included by 2 or more c/cpp files, inline is NOT ignored.
2. if only one c/cpp file includes the h file, all inline in the h file are ignored or not upto compiler - how do you want to know which inline is ignored? they are ignored all or none.
A special image tool for Windows C++ programmers, don't miss it!
The world unique Software Label Maker is waiting for you and me ...
A nice hyper tool for optimizing your Microsoft html-help contents.
|
|
|
|
|
It is not as simple as this - For example if you take the address of an inline function it is not inlined. There are many more complexities.
Steve
|
|
|
|
|
Kindly look at the another reply thread started by Ryan. Hope you would be able to understand my question.
|
|
|
|
|
includeh10 wrote: key word inline must be in h file.if u put inline in c/cpp files, it is ignored.
Not necessarily. You can declare a static function in a .cpp file and mark it as inline and the compiler will inline it if it is small enough.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Really, the only way you can do this is to get a list of the symbols in the program. If a function exists as a symbol in the executable, then it was not inlined. Of course, this involves enabling debug info, which usually disables inlining completely.
Other than that, the ASM files are the way to go, although remember that the linker can inline functions (not only the compiler), so you may not find them all.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote: this involves enabling debug info, which usually disables inlining completely.
This is not the case: It is the "/Od" option which does this, this is distinct from the "/Zi" option (and friends) which controls the generation of debug info. I always have debug info enabled, even in release builds - It makes postmortem analysis of crash dumps easier.
Steve
|
|
|
|