|
Read about trigraphs in MSDN. It says the compiler translates them in the first translation phase, before it does anything else. So yes, trigraphs are translated everywhere in the source code, string literals included.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
As I mailed you before:
Many thanks. I knew about trigraphs, but it didn't occur to me that they were causing these problems.
Cheers,
Sebastian
--
But I just may be the lunatic
you are looking for
-- Billy Joel --
|
|
|
|
|
I am trying to figure out how to instantiate a class that contains another class. For example, if I have a class called TopClass that contains a class called InClass :
class TopClass{
TopClass();
TopClass(int xIn);
InClass x;
}
class InClass{
InClass();
InClass(int xIn);
int xIn;
}
Even when I use non-default constructor in TopClass and called the equivalent one in InClass, it seems that the default construct in InClass has already been called to create a vanilla object. Is there any way I can automatically transfer the input variables to InClass when the non-default constructor is created? Or should I simply use pointers and initialize the pointer to a new InClass object the non-default constructor is called in TopClass?
Thanks in advance for any info.
Kiernan
|
|
|
|
|
I'm not certain I understand correctly but will this not work ?
TopClass::TopClass( int xIn ) : x( xIn )
{
}
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
<naughty>I see you skipped the chapter on initialisation lists when you were learning C++</naughty>.
Well to be honest, it IS an obscure topic and quite easy to miss when you're learning C++. So I'll let you off... THIS time.
Anyway, the answer is to use an initialisation list.
class TopClass()
{
TopClass(int xIn)
: x(xIn)
{
}
InClass x;
};
-- modified at 10:24 Monday 20th March, 2006
|
|
|
|
|
Thank you for the help. I guess I did skip that chapter. I am learning C++ after having learned Java, so this is a subtlety that escaped my attention since this problem doesn't really occure in Java due to its lack of definitions.
You answer does however bring me to another question. Isn't that the same syntax used used for passing variables to an inherited version of a function? Did I miss the big picture, whereby that syntax basically allows me to pass values to any other valid function?
Regards
Kiernan
|
|
|
|
|
using constructor initialisation list in C++ is a bit like calling super() for the base class.
but in C++, as multiple inheritence exists, you have to create each base classes then...
|
|
|
|
|
That syntax is only valid (AFAICT) in a constructor. The syntax is used to initialise any base classes, and any members. By the time you enter the function, all external parameters need to have been initialized (base classes, members, and global variables).
Although we already have syntax to initialise global variables, this is the only syntax available to initialise members and base classes.
|
|
|
|
|
Hi,
I want to navigate the records by sql connection in vc++ 6.0.I mean , I added four buttons named first ,previous last,next.
Can anyone send me the code or project.
Thanks
|
|
|
|
|
Thanks
modified 28-Sep-16 7:27am.
|
|
|
|
|
Hi Oliver Shikaloski,
Do you need to picture on the button?
|
|
|
|
|
|
Hello,
I'm writing an image processing program, which uses a plugin architecture (DLL) for image filtering.
My image is stored in a class (which contains the size of the image, pointer to the image, and basic functions - clear, copy, putpixel, etc)
Now, I want to pass the whole class as parameter to the functions in the DLL, like this:
int filter_function(CImg image) ,
without putting all the source code of the CImg in the DLL file (otherwise, I want the plugin to use the CImg class of the main program).
If I put only thew header file of the CImg in the plugin project, it gives me unresolved external symbol error.
Does anybody know how can this be done? I would be very grateful.
Thanks in advance,
kbarni
[edit] P.S. I'm using Visual C++ 6.0
-- modified at 9:33 Monday 20th March, 2006
|
|
|
|
|
Both projects need to have your CImg class compiled into them.
Probably the simplest solution would be to create a .lib project, move all the CImg source into that, and link both your main app and the plugins against that lib
--
Help me! I'm turning into a grapefruit!
Buzzwords!
|
|
|
|
|
I would like to know if there is a solution to use the class compiled in the exe file...
I need this for two reasons:
1. the class has some functions which communicate directly with the main program. (for example I have a function to create a new document (image), which calls the CWinApp::OnFileNew(). This can't be compiled in a lib file).
2. I would like to add later some new functions to my CImg class (the old ones will remain the same), and I want the older plugins to remain compatible with the main program.
Thanks again,
kbarni
|
|
|
|
|
Hi to all,
In Mfc,I created a treeview and listview , a window explorer like program. In this I want to add the password facility.Like applying password through my application the security for that file or folder get maintained.I mean On right click , the options like password gets created in the popup menus.On clicking the password button the user is asked to type the password and next time when the user double click that file or folder , the message gets appear on the screen which ask the password for that file or folder and until the correct password is not typed no one can acces it.
Can any one send me any code or link.
Thanks
|
|
|
|
|
i want to get the value of a cookie from webpage so how it is possible if anybody know please share with me.
Bankey Khandelwal
Software Engineer
|
|
|
|
|
ask in a javascript forum, you may look at document.cookie
VuNic
|
|
|
|
|
you mean this is not possible throgh c++
Bankey Khandelwal
Software Engineer
|
|
|
|
|
oops my mistake, may be you can have a look at this ..
cookie Spy^
VuNic
|
|
|
|
|
Hi
I have one Windows Service made in Visual C++, which runs on Windows 2000 Professional. My this service runs one more MFC exe when I start my service.
My Dialogbased MFC application uses the Skype API and sends and receives the messages using give functions.
It's working completely fine when I run my MFC application directly. But when I try to run my application using windows service that I have developed, it doesn't receive or send any message. Still my other functions (i.e functions other than Skype) works fine.
So what seems to be the problem? Any idea how to overcome this?
Thankx and regards in advance
Mahesh
|
|
|
|
|
Q1: "atof" is locale-dependent function, in "atof_l" locale could be managed but it needs "xlocale.h" file. What platform do i need in order to have "xlocale.h"?
Q2: In MSDN there is "_atof_l" function, but there are only 2 results in google about it. In MSDN it is said that it needs "stdlib.h" and "math.h", but there is no declaration of that function in these files. Does any one knows what it takes to compile the code with "_atof_l" within it?
Q3: What is the general method to create locale-independent software? Writing setlocale("English") in the main scope? Use of pragmas?
Q3.1: In our project we have lots of DLL-s which are unaffected by the "main" setlocale function call. Does any know a better way to change the loaded DLL-s locale, without changing every DLL code?
|
|
|
|
|
Hi guys
I've got a friend expert in old 8086 ASM but never programmed in C++.
He's asking me how to combinate both asm and c++.
The answer is simple (an example of MSDN),but he asked me some questions that I can't answer.
1. What is the set of instructions compatable with actual PC's? (I suposse that the minimum, more or less, has to be Pentium set of instructions, isnt it? Where can I get the full set of instructions?
2. Is MMX still operative in new PIV? If affirmative, where is possible to get the full set of instructions and examples? Books?
3. Is there a good book about ASM and VC++ combination or there is not so much than MSDN?
Thanks in advance
Dr.Pi
|
|
|
|
|
check Here(look at the Program No.11)^
doctorpi wrote: I've got a friend expert in old 8086 ASM but never programmed in C++.
But be sure that its a 32 bit world out there. not the old 16 bit.
VuNic
|
|
|
|
|
Hello
I have developed a dialog based application. This dialog disappears on pressing Esc key on keyboard. Is there anyway to prevent it?
Thank you.
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|