|
David Carkeet wrote:
Call be a fool and laugh, if y want, but is there a simple way that I can see the elements of a CArray in the MSC++ de bugger?
Yes there is. In the "Watch" window(if you don't see it just right click in the debugger and it will bring up the option), type the name of the array and all the values will be listed. What I do is insert a breakpoint at the place after the array is filled and then start the debugger. Once you have reached the breakpoint type the array's name in the "Watch" window and then presto, your elements will be listed. Hope that helps.
|
|
|
|
|
Well, teach a mangy old dog new tricks. I didn't know the Watch window was that smart!
Thanks!
Gary R. Wheeler
|
|
|
|
|
I had an edit control and I didnt want it, so I replaced it with a richedit, called it the same thing, went into the gray afx areas and commented out the CEdit entry, the wizard had put in a CRichEdit entry. ANd went about my merry way> it devastated the project completely!!!
SO I took a fresh copy, made the old edit control invisible, put in a richedit, called it something else and it works okay.
I see that what I did was not safe.
Is this safe? -->
If i just wanted to get rid of a control and didnt want invisible control clutter in my design view. Could I just cut it out and hope the wizard takes care of it? Of course all references to it (not in the gray afx areas - I learned my lesson) have to be removed. I am extremely nervous about removing anything now and I have a graveyard of invisble controls in my formview...
Thanks,
ns
|
|
|
|
|
While removing app/class wizard generated code can cause problems, it's OK to do so if you know what you're doing (i.e. if you remove everything you need to remove, nothing more and nothing less).
In general, if you want to perform surgery on the code when removing a control, go ahead and remove *all* references to the control. Then (I suspect this is what caused unhappiness), do View | Resource Symbols and remove all unused resources from the list. The list will explicity identify these bad boys. Finally, do a Build | Rebuild All. This will allow the compiler to catch any references to the deleted controls.
A common error is to delete the control IDC_Foo, but forgetting to delete code, like this (which will compile, since you didn't clean out the resources):
CEdit* pEdit = (CEdit *) GetDlgItem (IDC_Foo);
pEdit->DoSomething();
Of course, if you'd used an ASSERT , a debug run would catch this.
CEdit* pEdit = (CEdit *) GetDlgItem (IDC_Foo);
ASSERT (pEdit != NULL);
pEdit->DoSomething();
PS: You mistakenly checked the "Display this message as-is (no-HTML) box (in your popup menu question).
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
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
|
|
|
|