|
Hi,
do you now some good starting place for this?
Thanks
Bunburry
|
|
|
|
|
Bunburry wrote:
do you now some good starting place for this?
This place perhaps? (next time you should considering to do your own googling)
|
|
|
|
|
Hi,
I have a listbox on a skinned window using MFC. There are no problems with it on 98SE/Me/2000/XP but when I use the first release of 98 the list box does not show yet everything in the CListCtl class returns success when creating the window, adding colums and items.
does anybody know why?
Thannks
Ceri
|
|
|
|
|
I have brought up this question before but havn´t solved it yet
The question is:
Does someone know how to convert from a bitmap to a DIB and use the function StretchDIBBits() and implementet it in the article PrintingTricksAndTips in the printing section.
plese help.
-Tom
|
|
|
|
|
Sure, but I'm at loss why anyone would want to use the slowest GDI function available - StretchDIBBits - when there are alternatives. Any particular reason for this masochism you'd like to share with us?
|
|
|
|
|
It may be slow, but its guaranteed to work on printers compared to BitBlt() etc. So its the way to go when printing.
Roger Allen
Sonork 100.10016
WHats brown and sticky?
A stick or some smelly stuff!
|
|
|
|
|
Tom,
I think you need it for a bitmap loaded from a file from as mentioned in a previous post. This does it from the resources, but if you can load the bitmap from a file, the rest of the technisue should be the same:
CBitmap bitmap;
bitmap.LoadBitmap(ID_BITMAP);
HANDLE hDib ;
hDib = ImageToDIB(&bitmap, iImage, this) ;
BITMAPINFOHEADER *pBMI ;
pBMI = (BITMAPINFOHEADER*)GlobalLock(hDib) ;
int nColors = 0;
if (pBMI->biBitCount <= 8)
{
nColors = (1 << pBMI->biBitCount);
}
::StretchDIBits(printer_dc,
0,
0,
pBMI->biWidth,
pBMI->biHeight,
0,
0,
pBMI->biWidth,
pBMI->biHeight,
(LPBYTE)pBMI + (pBMI->biSize + nColors * sizeof(RGBQUAD)),
(BITMAPINFO*)pBMI,
DIB_RGB_COLORS,
SRCCOPY);
GlobalUnlock(hDib) ;
GlobalFree(hDib) ;
Roger Allen
Sonork 100.10016
WHats brown and sticky?
A stick or some smelly stuff!
|
|
|
|
|
Thanks a lot Roger!!
A have tested the code and with a minor adjustment I got it to work, I changed the line: hDib = ImageToDIB(&bitmap, iImage, this); to hDib = DDBToDIB(bitmap, BI_RGB,NULL);. One problem is that I don´t think the printer shows the picture in it´s correct size. If I open the picture in a paint program it says that the picture is 2cm wide but on the paper is only about 0,5cm. I have sent the application to a testperson who also will test the printing, and i´m waiting for his comment.
Thanks one more time
-Tom
|
|
|
|
|
Already posted it yesterday, but did not find a right answer
So, basically, I have a dialog (MFC) which i want to reuse three times as a Propertypage, only difference will be the Caption. SetWindowText is not working to set the caption (crashes the app since the propertypage still has not been created through Cpropertysheet.DoModal()), doing the SetWindowText in the OnInitDialog from the Propertypage has no effect (but does not crash).
Any idea ?
~RaGE();
|
|
|
|
|
Hello,
did you try changing the parameters of the PROPSHEETPAGE struct? Every propertypage contains a member variable of that type, called m_psp. Before adding the page to it's corresponding sheet, you can add PSP_USETITLE to the dwFlags member of m_psp. Afterwards assign your title to the lpszTitle variable.
|
|
|
|
|
Yep, forgot this one, I've already tried that without result. Anyway , thank you for your answer.
~RaGE();
|
|
|
|
|
If I understand your question, you are using the same propertypage in several instantiations, and want to change the title before the DoModal call?
I've done this several times and pass the string across via the constructor, then in the constructor set the title as follows:
m_psp.dwFlags |= PSP_USETITLE;
m_psp.pszTitle = m_strCaption;
where m_strCaption is the required string.
It handles it for you after this.
Debbie
|
|
|
|
|
Debs wrote:
m_psp.dwFlags |= PSP_USETITLE;
OOOhh yes, i've forgotten to set the flag. it has to be that.
Thank you Veeeeeeeeeeeery much.
~RaGE();
|
|
|
|
|
There is a workoround for this:
Start a timer of 10 ms from your OnInitDialog function, and in the timer handler first killtimer, then SetWindowText.
Bunburry
|
|
|
|
|
Tricky. I'll give it a try. Thanks.
~RaGE();
|
|
|
|
|
If the title of the sheet is dependant of the page displayed, then the page should set its parent's name when activated, doing this by overriding CPropertyPage::OnSetActive()
something like that
BOOL CMyPropertyPage::OnSetActive()
{
if(CPropertyPage::OnSetActive()){
CWnd *pParent = GetParent();
ASSERT(pParent);
pParent->SetWindowText("MyText");
return TRUE;
}
return FALSE;
}
HTH,
K.
Angels banished from heaven have no choice but to become demons
Cowboy Bebop
|
|
|
|
|
I've been building an app that has documents made up of OLE items (like the container sample app that comes with VC). But, typically, the requirements have changed, and the documents also need to hold other custom (non OLE) items. As my document class is based on COleDocument, and the items class is based on COleClientItem, I've been using COleDocument::AddItem() and COleDocument::RemoveItem().
I'd like to only have one document item class* if possible, but it needs to represent OLE and non OLE items, is this possible, and if so can anyone point me in the right direction? Or would I be better off having two item base classes with overrides of COleDocument::AddItem() etc?
* Or one class to base other classes from
Dylan
|
|
|
|
|
how to write this "" header in C++?
i tried doing in this manner, myMemo << <> << "\n";
but the output <>.
Thank you!
|
|
|
|
|
Use \
i.e. "\"" displays "
~RaGE();
|
|
|
|
|
Huh? You make no sense.
Neither as code, nor as a logical "something" this makes sense. What is it you want to do and what is it you don't understand? Is it perhaps that you just don't understand the C preprocessor?
|
|
|
|
|
Is this helpfule ?
HRESULT hr=pIXMLDOMDocument->createProcessingInstruction(_T("xml"), _T("version='1.0'"),&pIXMLDOMProcessingInstruction);
|
|
|
|
|
how to write this header in C++?
i tried doing in this manner, myMemo << "" << "\n";
but the output .
Thank you!
|
|
|
|
|
Hi,
I am not receving WM_DEVICECHANGE on a MFC dialog app. The dialog is set to Top Most and I have also used RegisterDeviceNotification at no avail.
Has anybody seen this behavior before.
Thanks
|
|
|
|
|
If I place some controls in a child frame, of course they have to be placed somewhere to provide a nice looking view.
I'm wondering what the most used way is, because I could think of two different ways.
1) Just put all controls in the View an resize them manually in OnSize().
2) Use splitter windows that provide a flat look and can't be moved manually to seperate the controls and use the basic view classes as the splitter Views.
3) something I don't know yet
I think here are many guys that actually put up a bit more complex GUI than just a ListView, so how do you do it ?
|
|
|
|
|
CFormView is functionally equivalent to a dialog window, and let you use dialog resources to lay out the controls. Usually this suffices, feel free to ask if you need more control than this.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|