|
|
Is there a way to use images with different height in CTreeCtrl?
|
|
|
|
|
No, when they come from image list. You'd have to use custom draw.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
My application use DirectShow. I want to know that wether my app need DirectX for execute.
Thank you.
|
|
|
|
|
Didn't you answer your own question ?
To know what DLLs you need, just launch your app, and use one the tools provided along with VS : DLL dependency walker. You'll certainly see directx dlls.
DLL dependency walker is a static logger though, if you want to know dynamically which DLLs are loaded, then I recommend a far better tool : Christophe Nasarre's article on DLL hell,
And I swallow a small raisin.
|
|
|
|
|
QUESTION:
I still cant figure out what the heck is stream (System.IO.Stream) and what we need it for?
i'm a C++ user. If i need to store ANYTHING, whether it's a simple "double" or as complex as an array of CMyFunnyImage, i can always allocate a buffer:
unsigned char * pbuffer = new char [100];
i'm a bit newbie, but why do we need to serialize anything to a "stream"?? The following fragment serialize an xml document to a "MemoryStream". But i dont see why it didnt just serialize it to a "String" or a generic buffer "unsigned char"??
Sample code fragment, in VB.NET:
Dim HSBCWC As new Customer()
HSBCWC.ID = 08346
HSBCWC.FirstName = "Paul"
HSBCWC.LastName = "Bowie"
...
Dim stream As MemoryStream()
Dim serializer As New XmlSerializer( Customer.GetType() )
serializer.Serialize( stream, HSBCWC ) QUESTION 1: Why not serialize to a string as supposed to a MemoryStream? It would be much simpler rite?
...
stream.Flush() QUESTION 2: I dont understand why we need to flush? flush what from what? I thought HSBCWC has already been "flushed" to stream?
stream.Seek(0,SeekOrigin.Begin) however, I do understand why u need to Seek (rewind the stream).
...
Dim reader As New StreamReader(stream)
message.body = reader.ReadToEnd()
stream.Close()
SmptMail.Send(message)
I'm a newbie and pretty confused why we need "streams" in general. And i could find any decent explaination from MSDN (as usual).
norm
|
|
|
|
|
Hello,
I would like for my DialogBar class to update all it's values from my CDocument class. I've been told I need to add a new command ID and use WM_COMMAND. I know how to set up the DialogBar side of things, but I don't know how to send the command from the CDocument class. Any help or pointers to articles?
thanks!
JennyP
|
|
|
|
|
To send a WM_COMMAND message to your dialog bar object I think it would look something like:
// Somewhere inside CDocument
((CMainFrame*)AfxGetMainWnd())->m_MyDlgBar.SendMessage(WM_COMMAND);
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
JennyP wrote:
I've been told I need to add a new command ID and use WM_COMMAND
I don' think you need new command ID. Rather, you should provide ON_UPDATE_CMD_UI handlers for controls hosted in dialog bar using their control IDs.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
How can i hook text , when i move mouse pointer over it ?
In IE , for example (HTML - text).
And more interesting - how i can to do it in any kind of applications (MSWord, etc.) ?
Thank You !
|
|
|
|
|
Actually i think this question gets asked enough that CG suggested Mike enter it in his C++ FAQ...you might wanna check it out...
Basically and easily you can't...however you can probably get away with text capture w/ HTML documents because IE (actually the IWebBrowser2 object) supports OnMouseOver & OnMouseOut events for all elements so you could probably take control of that object some how and use IE's innerHTML property and extract the text the mouse is currently over...for that matter you could then change it by setting the property...
I'm pretty sure other other programs like MS word wouldn't allow this becuase they probably use CRichEditCtrl which doesn't support the same events as IWebBrowser2 com object.
hooking text otherwise is almost impossible requiring character recognition or something like that...
Cheers
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Does anyone else pull their hair out trying to find what you're looking for using the MSDN search tool?
I usually enter a few key-words and the best 'hits' (by rank) are Q&A articles for FAQs which are 100 pages long and are ranked high because each of my key-words is used in separate sections of the FAQ---thus I don't find what I'm looking for after skimming the document--wasting 10 minutes in the process. Has anyone found a better method for quickly arriving at the spot you want?
thanks!
JennyP
|
|
|
|
|
Yup...google is your friend...
If i can't find it using the index I look to the CP or Google..
Cheers
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
JennyP wrote:
Has anyone found a better method for quickly arriving at the spot you want?
Using " and " ?
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Would it be un-reasonable to have this error catching technique encapsulate(???) every function/method...???
Even if it were to make catching bugs in a distrubuted remote application a lot easier...???
Just curious...
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
IMO, it's excessive; especially if you're talking about "catch(...)". unless every function is calling off to code you have no control over that has a high likelyhood of doing something stupid, you should be able to handle most possible error conditions on your own: test that pointer before using it, check your array bounds, etc.. at the very least, checking for possible error conditions will let you handle some situations gracefully. with catch(...), the error has already happened, and you don't really know what caused it, or what the state of the system is.
on the other hand, if your code actually uses specific exception objects as a form of code flow (ie. as C++ friendly goto's), then you might see a lot of try/catch blocks. but, even then, you wouldn't likely have them on every function.
-c
Though the cough, hough and hiccough so unsought would plough me through,
enough that I o'er life's dark lough my thorough course pursue.
--Stuart Kidd
|
|
|
|
|
Chris Losinger wrote:
IMO, it's excessive;
I would agree. However the reason I want to use try/catch is very un-conventional.
I always thought that under most circumstances you could get away with traditional if/then error handling techniques, instead of the more expensive try/catch.
Like u said so long as you initialize/check your pointers check the bounds of arrays etc...why bother using try/catch.
I look at try/catch as an alpha release technique to track down unrecognized bugs and fix them up with the faster more efficient if statements.
Anyways...thanx for the input
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
I always thought that under most circumstances you could get away with traditional if/then error handling techniques, instead of the more expensive try/catch.
How much more expensive is try/catch when compared to dozens of if statements?
How much more readable is one exception handler than dozens of if statements?
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Tomasz Sowinski wrote:
How much more expensive is try/catch when compared to dozens of if statements?
I would think quite a few more clocks are expended using try and catch. I suppose you could profile it and find out.
Tomasz Sowinski wrote:
How much more readable is one exception handler than dozens of if statements?
This is true, but it's harder or near impossible to determine what went wrong given the context of the situation. Where as i absolutely know what went wrong i use if's.
cheers
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
I would think quite a few more clocks are expended using try and catch. I suppose you could profile it and find out.
Sure. The real question is: do you need these clock ticks. 'Premature optimization is the root of programming evil' - do you know who said this?
Hockey wrote:
it's harder or near impossible to determine what went wrong given the context of the situation.
If you need different actions in different context, write different catch handlers.
Anyway, I'm not going to preach and convert you to try/catch. If you want to live in early 90s, it's OK with me.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
I've always been facinated with code optimizations...I suppose it has a lot to do with the fact that I haven't had a new computer in like 5-8 years...
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
I've always been facinated with code optimizations
Nothing wrong with that... as long as fascination doesn't turn into obsession. If you want to optimize, profile first. I don't believe you'll find that using exceptions will slow your code down.
BTW: are you aware that calling new/malloc and delete/free is quite expensive?
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Perhaps a slight obsession...
I seem to wanna go back in time rather than move forward with technology...honestly i'd rather code in assembler than anything...just cuz you have total control of everything. Sounds ridiculous, but i've never claimed to be the most productive programmer.
Actually I really enjoy OOP...the whole object concept is really cool too...i've always hated hi level procedural langs...like QBasic or Pascal...tho
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi
I have a dialog based application that uses many popup windows to display data. I changed the icon for these popups and it shows in the popup window and the task bar.
My prob is the new icon will not display (on the 'switch-to-program popup' window) when I press Atl-tab to swap between windows. What do I need to do for it to show up.
<br />
CMyWnd * mywnd = new CMyWnd (this);<br />
mywnd->Create(IDD_MYICON,GetDesktopWindow());<br />
HICON icon = AfxGetApp()->LoadIcon(IDI_MYICON);<br />
mywnd->SetIcon(icon);<br />
thanks
---
|
|
|
|
|
You need to change the large (32x32) icon also.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|