|
If you have question about other converts see these link: here[^] and here[^].
|
|
|
|
|
Hello,
I am havin a problem with including file.
I made one file where I put all the file needed by other classes.
includes.h
#ifndef MY_CLASS1
#define MY_CLASS1
#include "myclass1.h"
#endif
#ifndef MY_CLASS2
#define MY_CLASS2
#include "myclass2.h"
#endif
...
and in my cpp file I just write #include "includes.h".
The problem comes up when some class inherit from other. I get the error that the identifier of some class is unknown, or that the class is redefined.
Another question: Is it possible to have as member of base class an object of a class inherited from that base class?
Thank you for your replys, Tomas
|
|
|
|
|
Why don't you use only once the include guards in your file ?
#ifndef _INCLUDES_H_
#define _INCLUDES_H_
#include "MyClass1.h"
#include "MyClass2.h"
Of course, you need to have include guards in the specific header files also.
Tomas(cz) wrote: Is it possible to have as member of base class an object of a class inherited from that base class?
No, unless it is a pointer to the object (and you use a forward declaration of the class).
|
|
|
|
|
If I were you I'd stick to 1 header per class and include what you need where you need it. trying to include everything through 1 header is never really going to work.
Tomas(cz) wrote: Is it possible to have as member of base class an object of a class inherited from that base class?
No, many people would say that's what pointers are for (except the Java Bunnies) Just add a base class pointer as a member of your base class and then later you can use it to point to instances of derived classes, how cool is that
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
I want that the left bottom be (0,0), and y increases upward.
Here are two ways, why the 1st not work?
1
Matrix matrix(1,0,0,-1,0,0);
g.SetTransform(&matrix);
g.TranslateTransform(0.f,REAL(drawing_rect.Height));
2
Matrix matrix(1,0,0,-1,0,drawing_rect.Height)
g.SetTransform(&matrix);
system
|
|
|
|
|
I'm sorry if this is a stupid question but my C knowledge is VERY small - almost zero!
I'm creating a C# wrapper around some C functions and in the header file there is
typedef long long int Samples; I get the typedef idea, but why more than one type-declaration?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Because in C, long long int is a type (64 bits integer). See here[^].
|
|
|
|
|
Ah, now I get it, long int in C == int in C#, long long int in C == long in C#. Thanks
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
I suspect you'll find that it's defining a 64 bit integer - Ie reeeeeeeally long.
Try doing sizeof(Samples) - or whatever the C# equivalent it.
I've just tried it in VC++6, and get the following error:
error C2632: 'long' followed by 'long' is illegal
Anyone want to try it in a later compiler?
Iain.
|
|
|
|
|
It is C only, check my previous answer.
|
|
|
|
|
VC6 doesn't do long long but later e.g. VS2005 MS compilers do. You can use __int64 though even on VC6 which is equivalent.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Hi,
How to convert XML, formatted with XSLT, to PDF ?
Any information would be highly appreciated.
Regards,
Paresh.
|
|
|
|
|
[Insert stuff here] can be converted to PDF if [insert stuff here] can be printed. You can do it with Lib haru[^] if you are doing native programming and with iTextSharp[^] if you are writing managed code.
If you are printing it manually, then you could use one of those virtual PDF printers.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Thanks Rajesh. I will look into the libs.
Regards,
Paresh.
|
|
|
|
|
Hi,
I want to keep my software settings in XML file.
Is this possible in vc++ to save and read settings from a XML file?
|
|
|
|
|
yes. here[^]
more seriously, there are plenty of libraries out there.
if you search on Codeproject, you'll find some.
but the best XML libs are certainly TinyXML and MSXML... google for them.
|
|
|
|
|
|
I took a dialog class and using insert active X control i placed a pie chart in it. using toolbar i placed 4 edit boxes. all i want is when ever i place values in those edit boxes the pie graph should change dynamically. please send me the code for it. i'm using VC 7.1 version(.Net 2003)
|
|
|
|
|
Well, you can add handlers for EN_CHANGE messages from those edit boxes. Read the new number from them, then do whatever you have to do to alter your pie chart.
I imagine you have a m_pPieChart (for example) variable, so something like m_pPieChart->UpdateSegment (2, nNewNumber); to update the 3rd (assuming 0 based) segment.
I have no idea about what pie chart activex control you used, so that's very handwavy help.
Good luck,
Iain.
|
|
|
|
|
hi @ all,
i want to encode recorded sound by media lib(winapi) in PCM Format to the g711 uLaw codec.
Anyone here who knows how to do this correctly? All methods to encode i´ve found expect an
integer value but the WAVEHDR structure hold the recorded data in LPSTR.
How can I convert this correctly?
Greetings Crazydogg
|
|
|
|
|
Do you intend to use _itoa:Convert an integer to a string.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I think you mean atoi but
it´s a way to try but if it works is the other questions.
|
|
|
|
|
No this is not working. The integer will be 0 after using atoi.
|
|
|
|
|
There's 2 issues here. One is the encoding PCM vs uLaw and the other is the file format, headers, footers, record structure etc. It's a few years since I did this but I suggest you code a reader and a writer for each file format and ensure that you can successfully read and write example files of each type, with noise in is fine as long as the noise is the same after you've read it in and written it out again. Then you need to look into the encoding side and work out how to get the audio information translated from one encoding to the other or to an acceptable common encoding for an existing codecs.
The biggest issue with this stuff is likely to be time efficient buffer management. Just remember that calling new and delete is very expensive.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
That´s all done but the methods for encoding are available and I just want to know how to give the recorded sound to this methods.
How do you mean to look in the encoding side. I´m just a beginner in sampling and encodign sound. Do you have any Code Snippets or a good tutorial?
|
|
|
|