Hi Nicholas,
I checked all of this out, prior to answering. Yes, it's possible to
inherit CommonDialog and make API calls, but that's a lot of work for a
small performance gain. Note that I did not say that he SHOULD use a
Windows Form, but I recommended it as his "best bet." That was an opinion,
of course. I have found that it is often necessary to balance productivity
with performance, which is, of course, what the .Net Framework is all
about. But your opinion is as valid as mine, all things considered.
--
HTH,
Kevin Spencer
Microsoft MVP
Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
Nicholas Paldino said:
Well that just blows. I'd still recommend deriving from CommonDialog
at least, and then making the API calls.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Larry Smith said:
I would disagree with this. While the OpenFileDialog class is not
inheritable, the FileDialog class which it inherits from is. I would
say that it would be better to at least inherit from that, and then
work from there.
You can't do that either (read the "Remarks" section for "FileDialog").
Ultimately you have to wrap "GetOpenFileName()" in the WinAPI. The link
I provided in my first post is by a MSFT consultant who demonstrates how
to do this. Again though, it's still tough going unless you have a
WinAPI background (and even then it's low-level work)