|
Seems like you didnt add the file to your project via Project->Add to project->File
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
i'm pretty sure i did.
i'm using vs.net 2003, & added all files to the project by doing:
'project->add new item' (or it's equivalent)
there's a beginners template tutorial (part 1) on this site submitted by a chap called stefan spenz which i copied into my project in the usual way i.e. class definition into header & class implementation into source file (.cpp), then i tried to build the project with the class being used in main.cpp (with #include "stack.h" for new class where needed) and i had the same problem.
i'm obviously missing something about templates!?
|
|
|
|
|
Milby007 wrote:
there's a beginners template tutorial (part 1) on this site submitted by a chap called stefan spenz which i copied into my project in the usual way i.e. class definition into header & class implementation into source file (.cpp), then i tried to build the project with the class being used in main.cpp (with #include "stack.h" for new class where needed) and i had the same problem.
There is your problem. You should include the template implementation in the header file. Read this[^] faq about C++ templates and you should do fine...
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Example:
#include <tuple.hpp>
What does the hpp mean? Is it just for the human eye? Is it any different to the compiler than a .h file?
thanks
|
|
|
|
|
It's the name of a header file for a corresponding .cpp file. With C, you have .c and .h files. With C++, you have .cpp and .hpp files. In the past 15 years, I've never used a .hpp file.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
It's just for the human eye, the compiler doesn't care.
|
|
|
|
|
The compiler does not care. SOME (but not all) editors switch to C++ mode when the see *.hpp.
|
|
|
|
|
|
I've got an About CDialog that has 2 buttons on it (OK, Release Notes). When I click the 'X' to close the dialog it acts as though I clicked on the Release Notes button.
I can close the dialog by clicking OK, any ideas on getting it to close on 'X'?
BW
The Biggest Loser
"Farm Donkey makes us laugh. Farm Donkey hauls some ass." -The Stoves
|
|
|
|
|
Make sure the ID of the 'Release Notes' buttons is not IDCANCEL.
|
|
|
|
|
Ah, good thought, but no it's ID_RELEASE.
BW
The Biggest Loser
"Farm Donkey makes us laugh. Farm Donkey hauls some ass." -The Stoves
|
|
|
|
|
brianwelsch wrote:
...it acts as though I clicked on the Release Notes button.
So when the "X" is clicked, the handler function for the "Release Notes" button is getting called. Yes?
What is the value of ID_RELEASE ?
What does the About dialog's message map look like?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
DavidCrow wrote:
So when the "X" is clicked, the handler function for the "Release Notes" button is getting called. Yes?
Yes
What is the value of ID_RELEASE?
2
What does the About dialog's message map look like?
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)<br />
ON_BN_CLICKED(ID_RELEASE, OnRelease)<br />
END_MESSAGE_MAP()
BW
The Biggest Loser
"Farm Donkey makes us laugh. Farm Donkey hauls some ass." -The Stoves
|
|
|
|
|
brianwelsch wrote:
What is the value of ID_RELEASE?
2
Change it to 102 and it'll work! ;)
Here's the reason: IDCANCEL has a value of 2.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I changed it, but had the same issue. I ended out renaming the ID, deleting the old ID and creating a new button with the old ID name. It got a new random ID value, and all's good.
Thanks for your help, David.
BW
The Biggest Loser
"Farm Donkey makes us laugh. Farm Donkey hauls some ass." -The Stoves
|
|
|
|
|
brianwelsch wrote:
It got a new random ID value...
Actually, there not random at all. They are controlled by the _APS_NEXT_CONTROL_VALUE macro at the bottom of the project's resource.h file.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Does anyone know how to disable the safe mode of windows?
Thanks in advance
|
|
|
|
|
Hi gurus,
I'd like to know how to
1) save the list of all open documents in an MDI before closing the application and the last active document
1) reload the documents when the MDI application starts.
Thanks
Best regards.
There is no spoon.
|
|
|
|
|
The MRU list is handled automatically with an MFC application.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi everyone!
I needed to save picture from CBitmap object to BMP file. I have made this method:
BOOL SaveBMPImage( LPCTSTR sBMPFile, CBitmap& bitmap )
{
BITMAP bmap;
bitmap.GetBitmap(&bmap);
BITMAPINFOHEADER bmih;
bmih.biSize = sizeof(BITMAPINFOHEADER);
bmih.biWidth = bmap.bmWidth;
bmih.biHeight = bmap.bmHeight;
bmih.biPlanes = 1;
bmih.biBitCount = 32;
bmih.biCompression = BI_RGB;
bmih.biSizeImage = 0;
bmih.biXPelsPerMeter = 0;
bmih.biYPelsPerMeter = 0;
bmih.biClrUsed = 0;
bmih.biClrImportant = 0;
BITMAPFILEHEADER bmfh;
bmfh.bfType = 0x4d42; // 'BM' WINDOWS_BITMAP_SIGNATURE
bmfh.bfSize = bmih.biSize + bmih.biSizeImage + bmih.biClrUsed * sizeof(RGBQUAD) + 14 ;
bmfh.bfReserved1 = bmfh.bfReserved2 = 0;
bmfh.bfOffBits = 14 + bmih.biSize + bmih.biClrUsed * sizeof(RGBQUAD);
CFile file;
if( !file.Open(sBMPFile , CFile::modeWrite | CFile::modeCreate ) )
return FALSE;
// Write the file header
file.Write( &bmfh , min(14,sizeof(BITMAPFILEHEADER)) );
// Write the DIB header
file.Write( &bmih , bmih.biSize);
long velkost;
velkost = bmap.bmWidthBytes * bmap.bmHeight;
// otocenie obrazka (je dolu hlavou)
CDC dc;
dc.CreateCompatibleDC(NULL);
dc.SelectObject(&bitmap);
long i,j;
COLORREF farba;
for( j=0 ; j
|
|
|
|
|
Misenucik wrote:
It works everywhere - except...
So what is it that does not work? Have you stepped through the code to see what values are different between two machines? Do you have error-checking in place? How do the two .bmp files differ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I am not sure about the value that the GetBitmapBits() returns, but all others are the same. In wiever looks the picture as I am looking through a film negative (just violet,red and black colours) and the picture is there twice.
If you have any idea or if you have any method for saving a CBitmap to BMP file that works everywhere and you'll send it to me, I will be very thankful.
Thank you very much
|
|
|
|
|
Misenucik wrote:
bmih.biBitCount = 32;
are you sure your bitmap from GetBitmapBits is actually 32 bits?
Software | Cleek
|
|
|
|
|
Hi,
I have to code a SDI MFC application as below:
----------------------
| This is heading |
| |
| 1. some text |
| 2. Some text |
| 3. Some text |
| 4. Some text |
| |
----------------------
The "This is heading" part should not be scrollabe and below that part i.e from "1. Some text ......." should be scrollable.
Please tell me which CView subclass should I use.
Send me sample code / any articles.
Thanks & Regards,
Neeraj
|
|
|
|
|
You could use a CFormView derived class that has a static header and a scrollable window below it. I do not have any examples but they are very easy to use. Just like designing a dialog box.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|