|
I think he/she wants to see class window(when use of Add class) when he/she want to makes his/her classes.
|
|
|
|
|
Hi All,
I am working on win32 application in that solution I have included new project in which I have one header file and I want to include that header file in my win32 application's file(any .h or .cpp).
But when I do this I got the error like ......
cannot include file ,no such directory.
And also is other project setting which I have to do to include this new project's file into my other project.
If you have any suggetion??
Thanks.
Ashish Bhatt
|
|
|
|
|
Have you specified the relative path of the header file while including. You can also specify the addition include directoryies.
In VS2005 go to,
Project | Properties | Configuration Properties | C/C++ | General | Additional Include Directories.
Regards,
Paresh.
|
|
|
|
|
Ya I have tried as you told it gave me the same error.
I have include lilke below
./omnithread
into Additional Include Directories in my old project.
And also here omnithread is the new added project and it is of Static Library (.lib) type.
Is there any suggetion??
Ashish Bhatt
|
|
|
|
|
First, check the position of that header file, I suggest you use full path in your include sentence.
If it doesn't work. In Microsoft Visual Visual Stdio .Net, choose [TOOL]->[OPTION]->[PROJECT]->[VC++ DIRECTORY]->[INCLUDE FILE], select the header file you want to include, then rebuild your whole project. Sometimes, you have to close the VC, and then open it.
Tomorrow it another day.
|
|
|
|
|
Thanks for reply.
Now Let me explain more about my problem.
I have included the project omnithread in which i have one header file omnithread.h
(I hope you know about this file).Now I want to use this header file into my current project,so I included it into my file like #include "omnithread\omnithread.h".And If I compile then it gives me the error like...
fatal error C1189: #error : "No implementation header file"
Now in omnithread.h file I have code like this in the starting.......
#elif defined(__SINIX__)<br />
#include <omnithread/posix.h><br />
<br />
#elif defined(__osr5__)<br />
#include <omnithread/posix.h><br />
<br />
#elif defined(__irix__)<br />
#include <omnithread/posix.h><br />
<br />
#else<br />
#error "No implementation header file" // I hope error comes from here:((<br />
#endif
I hope you will understand the problem.
If you have idea then reply me.
Thanks.
Ashish Bhatt
|
|
|
|
|
As you have explained above, you mean you have included the head file "omnithread.h" correctly.
May be you haven't defined the preprocess macro such as "__SINIX__", "__osr5__", "__irix__", so error "No implementation header file" occurs.
Tommorrow is another day.
|
|
|
|
|
Thanks for reply.
As you told that preprocesser macro may not be defined i tried to see its defination but it shows it is not defined.But the same other project is running by doing the same thing and it doesn,t give error to it.But I am doing the same thing and it gives me the error.
The diff is only that I include header file like #include "omnithread\omnithread.h" and in other project it is like #include<omnithread.h>.
If any other suggetion then reply.I will appreciate your answer.
Thanks.
Ashish Bhatt
|
|
|
|
|
I want to do a program with 3 views, in 2 of them graphic (these views are derived from CVIEW) and on the other side I want to put a file explorer (similar to Windows Explorer). But not the kind that resulted in CTreeView or CTreeCtrl. Besides not initialize where the component and declare.
Thanks.
|
|
|
|
|
Do you want to make your tree control of course with graphics functions for files?
|
|
|
|
|
Point foobar()
{
Point local;
Point *heap = new Point;
*heap = local;
// ... stuff ...
delete heap;
return local;
}
There is a question on the source above.
Since point heap points to the object 'local', there is no need to new the point 'local'
If I change 'Point * heap = new Point' to 'Point * heap', Isn't the source more effective?
Another question is that if the class Point hasn't define the destructor function, We know
that the compiler will define the default destructor function itself.
But if I delete heap, will the call of default destructor be called?
Many thanks.
Tomorrow is another day.
|
|
|
|
|
richardye wrote: Since point heap points to the object 'local', there is no need to new the point 'local'
heap does not point to local.
richardye wrote: *heap = local;
This is a copy by value
richardye wrote: If I change 'Point * heap = new Point' to 'Point * heap', Isn't the source more effective?
No, the copy by value above will fail
richardye wrote: But if I delete heap, will the call of default destructor be called?
yep
|
|
|
|
|
|
richardye wrote: If I change 'Point * heap = new Point' to 'Point * heap', Isn't the source more effective?
Yes but in this case there should be a small change in the code. You should assign
the address of local to heap.
Point foobar()
{
Point local;
Point *heap = new Point;
*heap = local;
Point *heap = &local;
// ... stuff ...
delete heap;
return local;
}
richardye wrote: But if I delete heap, will the call of default destructor be called?
Yes. But if you are modifying the code as i meantioned above you should not call delete.
|
|
|
|
|
Naveen.R wrote: Point *heap = &local;
Provided he is not changing the value in the *heap.
- NS -
|
|
|
|
|
richardye wrote: Since point heap points to the object 'local'...
It would if you had done:
Point *heap = &local; richardye wrote: ...there is no need to new the point 'local'
And if you tried to, the compiler would complain because local is not a pointer.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I want to extract images from a CImageList and save them as transparent GIF files. I'm using the following GDI+ code and the transparent area comes out black.
<code>
const HICON hIcon = myImageList.ExtractIcon( nImage );
Bitmap* gdiBMP = Bitmap::FromHICON( hIcon );
CLSID encoderClsid;
GetEncoderClsid( T2W( "image/gif" ), &encoderClsid );
Status stat = gdiBMP->Save( L"myfilename.gif", &encoderClsid, NULL );
delete gdiBMP;
</code>
Have Google'd and searched CP to no avail. Any/all suggestions most welcome.
|
|
|
|
|
Does something like this work?
IMAGEINFO imageinfo;
myImageList.GetImageInfo(nImage, &imageinfo);
int width = imageinfo.rcImage.right - imageinfo.rcImage.left;
int height = imageinfo.rcImage.bottom - imageinfo.rcImage.top;
Bitmap TransparentBitmap(width, height, PixelFormat32bppARGB);
Graphics *pBitmapGraphics = Graphics::FromImage(&TransparentBitmap);
pBitmapGraphics->SetCompositingMode(CompositingModeSourceCopy);
SolidBrush TransparentBrush(Gdiplus::Color::Transparent);
pBitmapGraphics->FillRectangle(&TransparentBrush, 0, 0, width, height);
HDC hdc = pBitmapGraphics->GetHDC();
ImageList_Draw(myImageList, nImage, hdc, 0, 0, ILD_TRANSPARENT);
pBitmapGraphics->ReleaseHDC(hdc);
delete pBitmapGraphics;
CLSID encoderClsid;
GetEncoderClsid( T2W( "image/gif" ), &encoderClsid );
Status stat = TransparentBitmap.Save( L"myfilename.gif", &encoderClsid, NULL ); Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
Thanks for the reply. I've got a feeling your code isn't the answer, but I'll give it a try.
|
|
|
|
|
Good luck
There's a little trial and error involved in figuring out which combination of
GDI and GDI+ calls preserve alpha and transparency data.
It may look ridiculously complicated for a seemingly simple operation, but with GDI
especially, alpha and transparency data is pretty much ignored except with DIBSections.
Please let me know what works for you!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
BTW, try just drawing the icon anywhere on a window or the screen
right after the ExtractIcon call. Does it still have transparency?
If not - that's where you're losing the "background".
If so, then you're losing transparency when crossing the GDI-GDI+
line when you call FromHICON().
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: BTW, try just drawing the icon anywhere on a window or the screen
right after the ExtractIcon call. Does it still have transparency?
Good question. I suspect it doesn't have transparency at this point. Comments in articles on CP refer to "black" pixels where the transparent pixels should be.
I think I need to convert the C# code at http://www.bobpowell.net/giftransparency.htm[^] into C++, but I'm not a C# guy.
I've started converting them by hand as quick stop-gap measure.
|
|
|
|
|
Neville Franks wrote: I suspect it doesn't have transparency at this point
Well, I tested it. Both of our versions of code keep the transparency fine.
Of course, yours was much simpler
The GDI+ Save code, however, ignores it. Same with PNG.
Find a solution yet (beyond that link)?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
I'm going to take a look at making a C++ version today.
The selection of the transparent color should be automatic.
FWIW, saving the icon as a TIFF preserves the transparency
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|