|
Hi Alison,
got this eventually sorted out ?
~RaGE();
|
|
|
|
|
Hi ~RaGE();
Sorry its taken me so long to reply, I haven't been around for a while.
Yes I have sorted it out and it turned out to be my own silly error
It turned out not to be in SetWindowText but in a function called "OnEditPointSize". It was called when I set the text size.
Instead of declaring it like this:-
void CPPlusView::OnEditPointSize(void)
I had declared it like this :-
void CPlusView::OnEditColourBands(NMHDR* pNMHDR, LRESULT* pResult)
Its my own fault, I've used cut & paste when I first created the function and forgotten to change the parameters. It actually crashed when it left the function, I guess it messed up the stack.
I found it by starting the simplest program I could, then I recreated the problem by adding code in from my application. Then I had so little code to look through I soon found it.
Thanks for the help, you gave me some new ideas to try which was definetly a big help. Sometimes I get stuck with a bug and I just can't think how to find it!
Thanks Again
Ali
|
|
|
|
|
hi there..have used twain program,but when i tried to open the file back, it not available.anyone have idea about this? firstly when save it automatically save in any files. then i tried to save with putting .bmp or .jpg but it still cannot open. maybe something wrong in DIB coding.someone please explain me why its happen and how to solve it.thanks.
please someone help me, urgent!
- sue -
|
|
|
|
|
I am developing an MDI application where each document can have up to 60 views. To manage the views and documents i've subclassed the MDI client and added tabs on the top to switch between the documents/files.
But i want to be able to compare the documents/files side by side. Therefore i would like to create a splitter window inside the MDI client (http://www.codeproject.com/splitter/kaldysimplesplitter.asp[^]) and display the child windows (CMDIChildWnd) for each document inside a pane.
But unfortunately the MFC makes the assumption that the MDI frame is two parents up of the child window and if the MDI client is not the parent MFC crashes.
Any suggestions?
Thanks
Andre
|
|
|
|
|
hi,
i am displaying a rectangular box in the window on OnLButtonDown event
using
CClientDC dc(this);
dc.Rectangle(5,5,100,50);
when i minimizing or maximizing the window the rectangular box would vanished(not visible) .,because of OnPaint event
so i try with CDC class to convert all image window Bitmap and store it in
the memory .on OnPaint event i once again call the CDC to show the window image
using
void CChildView::OnLButtonDown(UINT nFlags,CPoint point)
{
CDC MemDC;
CClientDC dc(this);
MemDC.CreateCompatibleDC(&dc);
CBitmap *pOldBitmap = MemDC.SelectObject(&m_Bitmap);
MemDC.SetBkMode(TRANSPARENT);
dc.SetBkMode(TRANSPARENT);
MemDC.Rectangle(5,5,100,50);
dc.Rectangle(5,5,100,50);
}
void CChildView::OnPaint()
{
CDC MemDC;
CPaintDC PaintDC(this);
MemDC.CreateCompatibleDC(&PaintDC);
MemDC.SelectObject(&m_Bitmap);
PaintDC.BitBlt(PaintDC.m_ps.rcPaint.left,PaintDC.m_ps.rcPaint.top,
PaintDC.m_ps.rcPaint.right - PaintDC.m_ps.rcPaint.left,
PaintDC.m_ps.rcPaint.bottom - PaintDC.m_ps.rcPaint.top,
&MemDC,PaintDC.m_ps.rcPaint.left,PaintDC.m_ps.rcPaint.top,
SRCCOPY);
}
Even after using this code , i didn't get the original rectangular box
when i maximizing the window.
reply as soon as possible
send reply
|
|
|
|
|
In OnLButtonDown try to deselect m_Bitmap from MemDC by calling MemDC.SelectObject(pOldBitmap).
Also you could declate MemDC as a class member that way in OnPaint you just have to call Bitblt.
|
|
|
|
|
Inside 'OnPaint' try using 'CClientDC' instead of 'CPaintDC'
Nibu thomas.
Software Developer.
|
|
|
|
|
hi,
i am displaying a rectangular box in the window on OnLButtonDown event
using
CClientDC dc(this);
dc.Rectangle(5,5,100,50);
when i minimizing or maximizing the window the rectangular box would vanished
because of OnPaint event
so i try with CDC class to convert all image window Bitmap and store it in
the memory .on OnPaint event i once again call the CDC to show the window image
using
void CChildView::OnLButtonDown(UINT nFlags,CPoint point)
{
CDC MemDC;
CClientDC dc(this);
MemDC.CreateCompatibleDC(&dc);
CBitmap *pOldBitmap = MemDC.SelectObject(&m_Bitmap);
MemDC.SetBkMode(TRANSPARENT);
dc.SetBkMode(TRANSPARENT);
MemDC.Rectangle(5,5,100,50);
dc.Rectangle(5,5,100,50);
}
void CChildView::OnPaint()
{
CDC MemDC;
CPaintDC PaintDC(this);
MemDC.CreateCompatibleDC(&PaintDC);
MemDC.SelectObject(&m_Bitmap);
PaintDC.BitBlt(PaintDC.m_ps.rcPaint.left,PaintDC.m_ps.rcPaint.top,
PaintDC.m_ps.rcPaint.right - PaintDC.m_ps.rcPaint.left,
PaintDC.m_ps.rcPaint.bottom - PaintDC.m_ps.rcPaint.top,
&MemDC,PaintDC.m_ps.rcPaint.left,PaintDC.m_ps.rcPaint.top,
SRCCOPY);
}
Even after using this code , i didn't get the original rectangular box
when i maximizing the window.
send reply
|
|
|
|
|
In what conditions tree items can not be edited through clicking the label of that item?
I didn't intercept any mouse click message, and the ctrl also has the TVS_EDITLABELS style, but when I click the item label the break point in OnBeginlabeledit(...) doesn't reached.
|
|
|
|
|
You can edit the label by clicking the item which is currently in the selected state.
I think OnBeginlabeledit wont be fired when you move the focus to a new item by clicking it. Try clicking it again, i think then it will fire the event.
|
|
|
|
|
*Dreamz wrote: You can edit the label by clicking the item which is currently in the selected state.
Exact the scenario which I talk about in the original message
*Dreamz wrote: I think OnBeginlabeledit wont be fired when you move the focus to a new item by clicking it. Try clicking it again, i think then it will fire the event.
I click the item label several times constantly, OnBeginlabeledit just doesn't get fired
|
|
|
|
|
Does your tree control "notifies to parent" ?
~RaGE();
|
|
|
|
|
Rage wrote: Does your tree control "notifies to parent" ?
The ctrl handle the message on its own.
ON_NOTIFY_REFLECT(TVN_BEGINLABELEDIT, OnBeginlabeledit)
ON_NOTIFY_REFLECT(TVN_ENDLABELEDIT, OnEndlabeledit)
|
|
|
|
|
Urgent help my entire ERP project's class view is missing Resourse view stopped working. Yesterday it was ok,today its not there
I dont know what happened?
|| ART OF LIVING ||
|
|
|
|
|
Hello.
From your previous posts about the same problem, it seems as if your project files disappears at night, every now and then.
Why don't you make a backup before you leave work for the day?
|
|
|
|
|
Now I started taking backup but I think its too late
|| ART OF LIVING ||
|
|
|
|
|
Which version of visual C++ are you using? Try deleting the .NCB file and relaunching.
|
|
|
|
|
I AM USING VERSION 6.0
|| ART OF LIVING ||
|
|
|
|
|
shivditya wrote: project's class view is missing
Try this...
Close your workspace..Delete ".ncb" and ".clw" files from the project folder..
|
|
|
|
|
Hi,All:
I create a subclassed treectrl which allow user drag and drop
but if the Item is without image (neither normal image nor slected image)
,I can't create the Drag image ,it return NULL always.
<br />
SetCapture();<br />
Select(hSelItem,TVGN_CARET);<br />
m_pDragImageList=CreateDragImage(hSelItem);
it works well while item has image.
Can any one help me to point where I am wrong !
Thanks a lot
Don't look at me in that way!
|
|
|
|
|
white jungle wrote: if the Item is without image (neither normal image nor slected image)
,I can't create the Drag image ,it return NULL always.
This behavior seems OK to me. If your item does not have any image, which one should be taken as dragimage ?
~RaGE();
|
|
|
|
|
But if you drag a item ,the drag image is consist of the image and of course the text.
SO I don't think that the only item which include image and text can be drag and drop!
And I write some code to createDragimage with item which only has text.
but there's some wrong in my code.
That is,I can't check if there is a image with the item.
for Example:
if I retrieve the imagelist of the treectrl and return NULL.Obviously the item do not has a image.
But if the the treectrl return a valid imagelist but the item DO not have a image with it.I use fcuntion GetItemImage(hItem,iImage,iSelImage) to check if the item has a image.but the function always return TRUE.even the item is only consist of text,the parameter iImage,iSelImage will be 0.SO I can't judge if the item has a image with it.
Can anyone help me for this issue!?
Thank you very much!
Don't look at me in that way!
|
|
|
|
|
You have to cheat. Create the tree control without an image list. Before calling CreateDragImage, assign an image list to the CTreeCtrl, After the CreateDragImage function returns, assign a NULL image list to the tree control. For example:
m_tree.SetImageList( &m_imageListTree, TVSIL_NORMAL );
m_pDragImage = m_tree.CreateDragImage(m_hDragTreeNode);
m_tree.SetImageList( NULL, TVSIL_NORMAL );
This assumes that you want a tree control WITHOUT images assigned to each item. If you WANT images in the tree control, just call SetImageList when you create the tree control.
You might think that it is possible to assign an image list to the tree control, but for each item say specify -1 as the image index i.e. no image. The problem with this is that it displays the item as if there was a blank image, which is not the same thing.
|
|
|
|
|
I wanted to implement a tree like structure similar to the layers control in Photoshop. I am unable to decide which control should I subclass and use for this purpose. Tree control i dont think will be useful for such a task. How about subclassing a Listbox and drawing all the things on my own. Comments please.
Vicky
|
|
|
|
|
I think the SSTab or Tab Control is like the layer control in the photo shop. Is that you are looking? Or what do you mean by layers control?
Nice talking to you.
|
|
|
|