|
Make sure you add a call to AfxInitRichEdit, or else the Rich Edit control won't work.
|
|
|
|
|
Found that out! It gave me an empty document without that declaration!
Thanks,
ns
|
|
|
|
|
Hello!
Maybe this is a simple question, but the answer still eludes me. I have a simple SDI project with one view (call it CMyView) and I draw something on the view in the OnDraw() function. On top of the view are displayed a number of child windows of the view. If I call Invalidate() on the view, there is a noticeable flicker when the child controls are redrawn. Since both the controls and the view use CMemDC to prevent flicker when drawing, I am forced to conclude that this flicker is the result of the view becoming the topmost window while it is painting, then the child windows coming into the foreground again. Is this analysis correct? Is there any way to prevent this flicker?
Thanks in advance!
Sincerely,
Alexander Wiseman
Est melior esse quam videri
It is better to be than to seem
|
|
|
|
|
Windows are painted back to front. So the view redraws, then all the controls draw on top of it.
Try setting the WS_CLIPCHILDREN style on the view window.
[edit]
i'd originally put WSCLIPSIBLINGS instead... ugh... need coffee...
---
Shog9
If I could sleep forever, I could forget about everything...
|
|
|
|
|
I have a context popup menu where i want certain items disabled at start. SO in the OnUpdate handler I put:
void CTrain1View::OnUpdateDeletekeyword(CCmdUI* pCmdUI)
{
pCmdUI->Enable(m_adminFlag);
}
which works fine on a regular menu, but doesnt disable my popupmenu items! At startup, the flag is false, so this same command in a regular menu is great , but doesnt gray out the items in the popup menu..?
What am I not doing right? The flag is false. I checked.
Thanks,
ns
|
|
|
|
|
See this article[^].
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Whats the pWnd in the article? So far I havent tangled with a pWnd:
<pre>CmdRouteMenu(pWnd,pSubMenu);</pre>
pSubMenu will be what I call pMenuTrackPopup below right?
<pre> CMenu menuPopup;
AfxMessageBox("in");
menuPopup.LoadMenu(IDR_MENU1);
CMenu* pMenuTrackPopup;
pMenuTrackPopup = menuPopup.GetSubMenu(0)</pre>
SO where and how do I get a pWnd?
Thanks.
|
|
|
|
|
nss wrote:
Whats the pWnd in the article?
The pWnd is a pointer to the window that controls the UI update code, i.e. the view. (A CView is nothing but a CWnd .) You can just pass this .
nss wrote:
pSubMenu will be what I call pMenuTrackPopup
Yep.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thank you. How come my code is not properly formatted? I see the pre stuff - its not supposed to do that right? How do you make your words red? Eh? Whats 'code' for? Whats 'pre' for?
|
|
|
|
|
<pre> and </pre> are meant to enclosed code fragments. Methinks you mistakenly checked the "Display this message as-is (no-HTML) box.
To make your words red, use Humbrol #60 Indian Red (low gloss), blush violently, or use the code tag.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I implemented the article but it didnt grey out my menu items. so I worked around it, but it makes me curious cos I'm sure I did all that was required - theres no crash. The menu items just look enabled as always....not greyed out, though i put in the false in the onupdate for the enable.
Oh well! I am overrunnning with Cds here- I got a deal at Office Depot for 3c per CD (the cases cost more) so I back up my stuff often and lavishly. Now I have to get some sort of organizer for the slim jewel cases. My paltry tower of 20 is long gone. Cant throw any out yet though....eventually will.
Night flows into day into night into day......
|
|
|
|
|
nss wrote:
I implemented the article but it didnt grey out my menu items.
I'll try it later today and will get back to you. Is the OnUpdateUI() handler in your view being called?
nss wrote:
3c per CD
Hmm, sounds pricey. You can get 100 CDs for between 5 and 10 bucks (after rebates) if you buy them at CompUSA or BestBuy.
nss wrote:
Night flows into day into night into day
Ouch. Take care of yourself, kiddo! A normal routine does wonders for the mind and body. I figured it out after 20 years of night mode.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi
does anyone have any sample code for firing up outlook 97 (and say sending an email)
from vc6.0 using #import msoutl8.olb and mso97.dll
rather than using the class wizard to add _all_ those classes ?
as i dont seem to be able to make it work
can someone suggest something? (other than updating to office 2000)
regards
Bryce
|
|
|
|
|
Can you use MAPI? There is some code here[^] that I have used to send email with OE, but I assume that if Outlook was set up as your MAPI client that it would use that instead.
"Quand tu sèmes ta haine
tu récoltes la Kalachnikov Love"
-Kalachnikov Love, Alpha Blondy
|
|
|
|
|
nope, can't guarentee they have it seup that way
and need to show the new email window etc
cheers for the thought though
Bryce
|
|
|
|
|
Hi,
I do a thumbnail app and use the standard Listview. My thumbs are 100x100 (that's 40 kb each at 32 bit, which they are). I have tried to load a directory with over 330 images (about 13 mb), but the ImageList_Add function fails... I can't even figure out at which item, because (256 MB RAM/700 Mhz) I can't walk the code (it hangs the computer), when trying to write to a string and display it via messagebox, it hangs, all I can do is a messagebox saying "error", otherwise, in hangs the computer (mouse is moving, but not changing, nothing clickable, no keyboard). So, my question: is this normal or is there fault somewhere on my side (can the imagelist take any number of data?) Any workarounds (I got some ideas already, but would need a lot of code rewritting).
PS: I have to mention it works fine for ie. 30-40 files and that I try to do my best freeing the resources and that I've set the number of items to be exactly the number of files in the directory.
|
|
|
|
|
if there's a limit, it's at least 773 items
i have an app that shows 100x100 thumbnails in a list control and i was able to add 773 of them before i got bored. (Win2K, 512MB, performance meter showed very little memory usage)
-c
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
A technique I used was to keep each bitmap separately and only have an imagelist with one entry. Then I switched the listview to owner data. When the control requests the text for each item I replace the bitmap within the imagelist. It works, trust me.
Joel Lucsy (jjlucsy@ameritech.net)
|
|
|
|
|
|
98... could you tell me more? It's sort of cruical thing for me right now... or where to get info.
Thanks for the other replies, maybe I could try the ownerdata thing ...
|
|
|
|
|
Btw. I cannot find the owner data style anywhere (nor searching the MSDN gives any suitable results). How can I do that? I've seen it somewhere before, but couldn't find it now
|
|
|
|
|
It's not a style. Each of the common controls that handles multiple items lets you associate a 32 bit value with each item, called the 'ownerdata' for the item. Generally, this is a pointer to a data structure within the application that contains more information about the item. For an example, look up the LVITEM structure in MSDN, for list-view items.
Gary R. Wheeler
|
|
|
|
|
GDI in Win 9x still has lots of 16-bit limitations since it is 16-bit code (necessary to retain Win16 compatibility). Thus it has lots of limits like 64K heaps, 16K max window handles, 32K max items in a list box, etc. When you load up hundreds of bitmaps, you eventually exhaust all the GDI resources. And due to the 16-bit limitations, you hit that limit rather quickly. You can monitor the GDI resources with the System Resource Meter (I think that's the name).
The solution is just to not keep all those bitmaps in memory at once.
--Mike--
Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I created a menu resource IDR_MYCONTEXT, and its got a submenu and a subsubmenu (nothing weird). I did and got the messagebox and a subsequent crash!
void CTrain1View::OnContextMenu(CWnd* pWnd, CPoint point)
{
CMenu menuPopup;
if( rcTHBImage1.PtInRect(point))
{
AfxMessageBox("in");
menuPopup.LoadMenu(IDR_MYCONTEXT);
menuPopup.GetSubMenu(0)->TrackPopupMenu(TPM_RIGHTALIGN, point.x, point.y,this);
}
However this works(but I dont get the menu I want of course!)
<pre> CMenu* pMenuTrackPopup;
pMenuTrackPopup = ((AfxGetMainWnd())->GetMenu())->GetSubMenu(0);
pMenuTrackPopup->TrackPopupMenu(TPM_RIGHt,point.x, point.y,
AfxGetMainWnd(),
NULL);
}
I am doing something wrong! What though?
Thanks,
ns
|
|
|
|
|
Did u check if the LoadMenu is returning TRUE? TrackPopupMenu?
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|