|
First, wrong forum.
Second, when writing COM clients, there's really no such things as classes that you can access. Everything is done through interfaces. If you're writing a COM server, you of course use classes but they implement the interface through which clients access the classes. This is one of the fundamentals of COM.
Finally, when the host (Internet Explorer) calls IObjectWithSite::SetSite(IUnknown*) , you QI (QueryInterface) for the IWebBrowser2 interface. That's your web browser. Later, call IWebBrowser2::get_Document(IDispatch**) and QI the IDispatch for IHTMLDocument2 (or a newer interface, depending on your browser requirements).
Next time, though, there is a forum for ATL and COM. This would be a more suitable place. If you are using C# to do this, instead of QI'ing for an interface, you simply do a type-cast. The CLR treats this the same.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
|
How can I draw zigzag red lines under some words in a RichTextBox or any other textual environment? (Just like what is done in spell checkers)
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
I create a MDI contain form, add a MainMenu, a ImageList, a ToolBar, and the ToolBar relate the ImageList.
When I use the function Application.EnableVisualStyles() to enable xp style, the toolbar icons are disappeared. But when I use instead of a manifest file, the toolbar icons display correct.
Is this a bug with .net framwork 1.1?
(I used VS.net2003 simplified chinese version)
=== Game is power! ===
|
|
|
|
|
Does anyone know if it is possible to give the ComboBox control a flat appearance? If not, do you know where I may find a flat combo box?
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Anything's possible (given time)!
Search for the author "Carlos H. Perez". He has some great flat controls available here on CP.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath Stewart wrote:
He has...
He had...
|
|
|
|
|
Yeah, I noticed that just today. I remember him saying that he was moving everything new to a commercial library. Nice of him to pull the old stuff! Greedy bastard.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I can get the form's graphics with CreateGraphics(). But how can I get the title bar's graphics? or How to determine the title bar's retangle?
The wParam gotten from WM_NCPAINT always is 1.
|
|
|
|
|
Ok, I am trying to figure out the best way to do this. I have string representing an HTML page that I need to render and then save as a .jpg or .gif image. I currently use the IE control to preview the HTML page, but I need to be able to capture an image without previewing the document. Any pointers or ideas?
|
|
|
|
|
I'm currently working on a project where I need to scrape a web page for info.
Seems pretty simple far. The problem is that the site has a password protected front end. When you log in it takes you to a menu page. The data I want to scrape is on another inside the site.
The question is after making my initial webrequest and posting data to the stream, how to I navigate to another page and then do a request for it's data.
Thanks in advance
|
|
|
|
|
Are you using the WebClient class? Does the site use cookies to store session data? If so, make sure to set it up to receive those cookies.
|
|
|
|
|
I solved this.
I am using HttpWebRequest and HttpWebResponse. I created a CookieContainer to hold all the session stuff from the first request which is the login page.
I can now copy that Cookie container into the CookieContainer of any new request that I want to make on the site.
HttpWebRequest loginRequest = null;
HttpWebRequest secondPageRequest = null;
loginRequest = (HttpWebRequest)WebRequest.Create(loginURL);
secondPageRequest = (HttpWebRequest)WebRequest.Create(secondPageURL);
CookieContainer loginCookies = new CookieContainter();
loginCookies = loginRequest.CookieContainer;
secondPageRequest.CookieContainer = loginCookies;
Thanks
David
|
|
|
|
|
Heath Stewart kindly provided me with the code snippet below which works generally for exposing functionality that somebody's wrapper of a windows system control left out.
My question now is, how do i best integrate it with VS Designer? The textbook way is to create a new component TreeViewNoHScroll. I am then free to register the class in the designer toolbox etc. But that seems a bit heavy, adding my own Windows Forms control dll to the toolbox for every simple wrapper patch. At the other extreme, I could directly edit the designer code where it creates the new TreeView() and make it a new TreeViewNoHScroll, but I dont like to muck with designer generated code because i have a hard enough time replacing controls or properties that somehow get lost and dealing with other designer quirks and gremlins.
So, is there a way to dynamically create a TreeViewNoHScroll that inherits from the existing instance of a designed TreeView, before the window is created? Or to somehow use reflection to just replace the protected function in TreeView without even creating a new wrapper class?
What's the best way to fix the wrapper with minimal impact on the designer? Thanks in advance for any suggestions.
// Exposing functionality from under a Wrapper, courtesy Heath Stewart
private const int TVS_NOSCROLL = 0x8000;
protected override CreateParams CreateParams
{
get
{
CreateParams ret = base.CreateParams;
ret.Style |= TVS_NOSCROLL;
return ret;
}
}
|
|
|
|
|
You could put the create params in an enum and create a new control from the treeview
TreeViewEx or something and expose the parameters as a property
You can then set the property to noscroll for the implementation you want, instead of hard coding the create params. This also gives you a treeview which you can add extra properties later when you need them.
James
James Simpson
Web Developer
imebgo@hotmail.com
P S - This is what part of the alphabet would look like if Q and R were eliminated Mitch Hedberg
|
|
|
|
|
yeah, that's the solution i was trying to avoid, the TreeViewNoHScroll control. anyway maybe like you suggest it's the best way, and does have the plus of being the place to put in any other mods to TreeView.
Any way to deal with the downsides i perceive:
-- another file in the project
-- registering the control with the toolbox (which sometimes forgets which of my controls are registered anyway)
-- is it possible that TreeView will ever be changed and break my code.
Thanks in advance!
".. and Toto too."
(reassurance by Glenda, the good witch of the North)
|
|
|
|
|
I'm working on my own XmlSerializer/deserializer class, and while developing the deserializer, I've noticed that Type.GetType("System.Drawing.Color") is returning null instead of a Type object. What's the reason for that? I don't see an explanation in the documentation, and I can do Type.GetType("System.Double") fine, so it's not an issue with ValueType objects... Perhaps it's an issue with structs for some other reason?
Thanks,
Arun
|
|
|
|
|
It expects the FULLY QUALIFIED NAME (iow assembly name, ver , etc, public key).
Rather use typeof(Color) or recursive thru the loaded assemblies.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Ah, okay, that must be it, thanks! System.Drawing.Color is not in my assembly or mscorlib.dll, it's in System.Drawing.dll.
I guess I'll iterate over loaded assemblies and see if they have the type I'm looking for.
|
|
|
|
|
You don't need to iterate... you know it belongs in System.Drawing.
Assembly a = Assembly.LoadWithPartialName("System.Drawing");
Type t = a.GetType("System.Drawing.Color");
...will do the job
|
|
|
|
|
Hmm, yes, but can I generalize that for other times and other assemblies? I'd hope also that it wouldn't actually reload the already-loaded assembly.
Thanks,
Arun
|
|
|
|
|
Arun Bhalla wrote:
I'd hope also that it wouldn't actually reload the already-loaded assembly.
It wont reload it (unless u have changed it of course).
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Good to know that it's implemented smartly!
I'm still not sure I can generalize across types. Perhaps I can for the types I use presently, but maybe not in the future. That is, I'd rather not store the assembly name (partial or full) in my file, especially since LoadWithPartialName isn't preferable for long-term, according to documentation.
Arun
|
|
|
|
|
i started learning c# because i had a nice idea about to write a program for windows and its my first time i program for windows so i wanted to learn the latest technology , which seems c#+forms, i started learning and it was really good nice language and seems fun and simple.
i learned the basics and all was well , but then i decided to learn the stuff i needed for my idea , and i needed midi api, i looked everywhere and i couldnt find it !!.
apparently there is no midi support in c# (i dont mean play a .midi file, i need full control over the notes and everything).i checked managed directx and nothing there too !! , i got really upset.
the only thing left to do that i can think of is code the midi with c++/unmanaged directx into a dll and use it with my c#/forms UI.
since i have no experience with dll's, and mixing managed/unmanaged code what i need is tutorials and maybe some examples how to do it.and if mixing unmanaged directx is a problem?
|
|
|
|
|
You know, I'm almost thinking about writing a .NET/DirectX tutorial...
Anyways, until I work up the motivation to do so, have you tried using the Managed DirectX libraries? Go to the DirectX portion of MSDN and look for the Managed DirectX 9 SDK.
Not a in-depth music programmer myself (I do graphics), but that may help you out.
Jeremy Kimball
|
|
|
|