|
In addition to the previous advice, you would do well to search for articles on codeproject
by its defacto printing guru Roger Allen[^]. He has quite a few printing articles, with and
without views, etc. He's also a nice chap, but tell him I said that. He'll get big headed.
Iain.
|
|
|
|
|
Hi Toni
If you want to make more complex reports, i would suggest to check the functionality of some report systems like list&label or crystal reports. I especially know list&label and you can create your reports almost with drag and drop and fill them with data.
|
|
|
|
|
Thank you very much for your replies everyone.
// Afterall, I realized that even my comment lines have bugs
|
|
|
|
|
What is difference between "true" and "TRUE" key words in vc++.Like wise with "false" and "FALSE".
Can any help me regarding this matter.
Philip
|
|
|
|
|
Actually I think you going for Difference Between bool and BOOL.
Let See what MSDN say about bool
"
the Standard C++ header files contained a typedef that equated bool with int. In Visual C++ 5.0 and later, bool is implemented as a built-in type with a size of 1 byte. That means that for Visual C++ 4.2, a call of sizeof(bool) yields 4, while in Visual C++ 5.0 and later, the same call yields 1.
"
and BOOL is defined as int in WinDef.h
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
bool is a C++ native type, which is taking 1 byte memory, and that can only take true or false .
BOOL is a type redefined by the VC++ library, like this :
<font color=#0000FF>typedef enum </font> {
FALSE = 0,
TRUE
} BOOL;
this last case equals in memory to an int, so, weights 4 bytes...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
int, so, weights 4 bytes
Isn't this value dependant of the OS and the hardware?
Fold With Us!
Sie wollen mein Herz am rechten Fleck
Doch seh ich dann nach unten weg
Da schlägt es links
|
|
|
|
|
of course, but unless you use an atari....... i consider we can think about 4 bytes integers here
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I know, I'm "cutting hair in 4 pieces" ( ) but with the new 64bits CPU and OS, there will be some nice surprises with softwares which made the assumption int variables have a size of 32 bits.
Fold With Us!
Sie wollen mein Herz am rechten Fleck
Doch seh ich dann nach unten weg
Da schlägt es links
|
|
|
|
|
On this topic, I have to add this bit;
Some developers prefer to use the following syntax;
bool bFlagIsSet = false;
if (bFlagIsSet == true)
// do something
else
// do something else
instead of;
bool bFlagIsSet = false;
if (bFlagIsSet)
// do something
else
// do something else
fair enough - each to their own. But doing this with the BOOL type, since TRUE is defined as -1, could cause unexpected behaviour;
BOOL Func()
{
return 1; // return true
}
BOOL bFlagFromFunctionThatReturnsBOOL = Func();
if (bFlagIsSet == TRUE)
// this won't happen, but is expected to
else
// stuff
So, the easy rule to remember there is, always check against FALSE, since it's value is always 0, like so;
BOOL Func()
{
return 1; // return true
}
BOOL bFlagFromFunctionThatReturnsBOOL = Func();
if (bFlagIsSet != FALSE)
// this will now work properly
else
// stuff
That's my 2p
(and maybe not related at all)
Martin
|
|
|
|
|
hi,anyone here,i want Powerpoint's presentations to be displayed in my program's window,and can control its "Slides" ,"Scale" ,"Display Position" and so on...i think the OLE can resolve that,but i don't know how to do.If you have a good idea please reply at here ,or mailto: sdcgc@yahoo.com
thanks in advance!
|
|
|
|
|
I've tried to do that before. Basically, you can't. You can't tell PowerPoing where to show its presentation, and if you try to change the parent/owner of the PowerPoint slide show window, PowerPoint exits (it doesn't crash, but immediately exits). You can change the position of the window to make it appear that it's in your window, but you also need to do some pretty horrible hook work to allow your application to capture the mouse events.
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"
|
|
|
|
|
There is a way to fake it. Interested in hearing it ?
|
|
|
|
|
Use the Web Browser control and tell it to navigate to the document you want to open. When the navigation completes you get the iDisp and you can control everything you want.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
thanks for your advices
How to fake it? please give more details,thanks:->
Now i use OLE container application which can open the PPT file,but only the first page was displayed.What methods can be used to let it slide on?please help me
|
|
|
|
|
On Windows XP sp1, I use these three Directshow filters: DV Video Encoder, Stream Buffer Sink and Stream Buffer Source to implement the timeshifting function, and it works well, But on the Windows XP sp2, it has serious delays. I don’t know why and how to solve the problem ,Please give me some advice .Thanks
|
|
|
|
|
|
I'm writing a class to read in a bitmap file, background information for your consumption. I'm trying to implement this but I get the errors:
...\489gui\bitmapFile.h(45): warning C4200: nonstandard extension used : zero-sized array in struct/union
...\489gui\bitmapFile.h(46): error C2229: class 'bitmapFile' has an illegal zero-sized array
...\489gui\bitmapFile.h(46): warning C4200: nonstandard extension used : zero-sized array in struct/union
Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array
...\489gui\bitmapFile.h(48): error C2229: class 'bitmapFile' has an illegal zero-sized array
...\489gui\bitmapFile.h(45): warning C4200: nonstandard extension used : zero-sized array in struct/union
...\489gui\bitmapFile.h(46): error C2229: class 'bitmapFile' has an illegal zero-sized array
...\489gui\bitmapFile.h(46): warning C4200: nonstandard extension used : zero-sized array in struct/union
Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array
...\489gui\bitmapFile.h(48): error C2229: class 'bitmapFile' has an illegal zero-sized array
Here is the code it's referring to...
(45) RGBQuad aColors[];<br />
(46) BYTE aBitmapBits[];<br />
(47)<br />
(48) bool endOfBitmap;<br />
I know what it says but I can't define the array sizes at compile time because they will change depending on information in the header. What can I do to get this working? Thanks in advance.
|
|
|
|
|
try to use pointer the and assign memory at runtime.
|
|
|
|
|
LighthouseJ wrote:
RGBQuad aColors[];
You can't do that in C, this syntax isn't allowed. You should use a dynamically allocated array.
Define a pointer to point your future array:
RGBQuad *pMyArray;
Allocate it when you know the size:
<br />
pMyArray = (RGBQuad *)calloc(iSize, sizeof(RGBQuad));<br />
Reallocate it if needed
<br />
pMyArray = (RGBQuad *)realloc(iNewSize, sizeof(RGBQuad));<br />
Free the array when you don't need it anymore
<br />
free(pMyArray);<br />
You should have a look in MSDN or other sources for the different functions I mention, and perhaps take time to study memory managment with C.
HTH,
K.
Fold With Us!
Sie wollen mein Herz am rechten Fleck
Doch seh ich dann nach unten weg
Da schlägt es links
|
|
|
|
|
I see what you mean and it makes sense but that seems to only allocate one element instead of more than one. The calloc line looks like:
bmpPallette = (RGBQuad *)calloc(palletteCount, sizeof(RGBQuad));
palletteCount is 0x100 (256) which is what it should be. It looks like it's simply allocating a new RGBQuad instead of an array of 256 RGBQuad's which is what it should do when I look at the calloc command.
|
|
|
|
|
From MSDN[^]:
"The calloc function allocates storage space for an array of num elements, each of length size bytes. Each element is initialized to 0."
calloc(num, size) is similar to malloc(num * size)
LighthouseJ wrote:
It looks like it's simply allocating a new RGBQuad instead of an array of 256 RGBQuad's
How can you say that?
Fold With Us!
Sie wollen mein Herz am rechten Fleck
Doch seh ich dann nach unten weg
Da schlägt es links
|
|
|
|
|
Because Visual Studio identifies it when I go to write code as a simple pointer to a single RGBQuad's instead of a pointer to 256 RGBQuad's. Maybe it's actually working but I don't know how to address it properly because I've never used a pointer to an array. I have that calloc page in my Visual Studio helpfile already and it made sense of what calloc does.
|
|
|
|
|
Don't worry, it's working.
bmpPallette is a pointer (IMHO, it would be a good idea to have something in its name to identify it as a pointer, as pBmpPallette). A pointer is just an address, right? calloc will return the address of the first element of the array it allocates. bmpPalette points then on the first element of the array. Once the array allocated, you may access the different elements using bmpPallette[0], bmpPallette[1],...,bmpPallette[size-1].
For example:
bmpPallette[0].rgbRed = 255;
bmpPallette[0].rgbGreen = 0;
bmpPallette[0].rgbBlue = 128;
Disclaimer: In C, you have to take care of everything when it is about memory managment. I only mention there some of the basics. You really should have a look to a good tutorial, as http://www.le.ac.uk/cc/tutorials/c/ccccpont.html#PA[^]
Fold With Us!
Sie wollen mein Herz am rechten Fleck
Doch seh ich dann nach unten weg
Da schlägt es links
|
|
|
|
|
Thanks Budric, Blake, David, and Micheal! for helping me. I have another problem. Is there any option in "Microsoft Visual C++" compiler to create an "installation packege" of my project i.e. to install project on a pc? if not then please tell me how can i do this?
We Believe in Excellence
|
|
|
|