|
Hi there ... I have a form with the Web browser control over it covering the whole form. I have a help provider too for the form but pressing F1 doesnt allow the help provider's help file to show . As i understand it, I need to use MSHTML and IDocShowUI interface and implement ShowHelp but all my efforts have failed. Can anyone send me the code to implement it in C#? You can contact me at fayazhsn@hotmail.com .... I need this asap!!
Thanks in advance!!
|
|
|
|
|
See Using MSHTML Advanced Hosting Interfaces[^] for an explanation of how to properly implement the IDocHostUIHandler . When the WebBrwoser control (AxWebBrowser as VS.NET and aximp.exe call it by default) has the focus, it's implementation is queried, which doesn't work like .NET controls would. The COM implementation is what is responding to events in this case.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello. thanks for your prompt reply. I already read that article and also the one which is a chapter from a book by Ted Faison. Ted explains that I need to create a mshtml object to use that. I dont know how to do that. The article you've mentioned also talks abt IDocHostUIHandler . I need info abt IDocHostShowUI & ShowHelp .... How can I show my custom help file (*.chm) when F1 is pressed?
|
|
|
|
|
You implement them and expose your implementation to MSHTML (rather, the aggregate WebBrowser control) the same way. The article I linked shows you how to build a typelib from which you can create an interop assembly. You must do that unless you want to create an RCW manually, which is entirely possible (that's how I typically do it when I need to interop with only a few unmanaged interfaces).
For more information on these interfaces, you should see the topic Programming and Reusing the Browser[^], specifically the section Advanced Hosting Reference[^].
Once you've created an RCW for the IDocHostShowUI interface, you must tell the WebBrowser control that you're it's parent. The article I linked also explains one way to do that. There are several ways, and without hacking the source for the AxWebBrowser control (if you use aximp.exe to create that interop assembly, you can opt to generate source code instead) that's the easiest way to do it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How can a open the *.sln file or *.csporj file made in Professional version of VS.NET with the Enterprise Architect.
Thank you
|
|
|
|
|
Same way you open any other solution or project file.
Especially since the solution was created in a lower level of VS.Net than what you're trying to open it in, there should be no problems.
Is it possible that the solution was created in .Net 1.1 and you're trying to open it with .Net 1.0? that would cause some minor difficulty. But Pro to Enterprise should be no problem at all.
Grim (aka Toby) MCDBA, MCSD, MCP+SB
|
|
|
|
|
I have tried to update VS.NET Enterprise Architect online and i got the message that that my version was the last one. And with all these I can't open the *.sln or *.csproj file.
|
|
|
|
|
First things first, What's the error message?
Second, you CAN, in the Enterprise Architect version, open a project, or any other file, written by the Professional version. But, you CAN'T open a project written in any edition of VS.NET 2003 in VS.NET 2002.
So my questions will be a repeat of the first reply you got...
Which verion of Visual Studio.NET Professional Edition was the project written in, 2002 or 2003?
Which version of Visual Studio.NET Enterprise Edition are you trying to open the project in, 2002 or 2003?
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The version of my VS.NET is 2002 and the files are downloaded from MS website, so I don't know with what version the files were written. So my question is how can I open the files?
|
|
|
|
|
OK. Last time! WHAT IS THE ERROR?
All you do is double click the .sln or .csproj file. That's it! There is no special trick to getting files to open. If the files were created in VS.NET 2003, you can download and compile this[^] little conversion tool so you can open the project files. THIS IN NO WAY SAYS THAT THE PROJECT IS GOING TO COMPILE WHEN YOU GET IT OPEN!
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
the error message told me that the files were made in the professional version of VS.NET and i couldn't open them with the version i had (Enterprise Architect). I'll try this utility you tell me about and i'll let you know what happens!
thanks a lot!
|
|
|
|
|
the project converter that Dave told me about works fine.
|
|
|
|
|
Hi,
I want the all the nodes in the tree to be expanded. How do I set this property?
Karteek
|
|
|
|
|
Simply call the ExpandAll() method of the TreeView control:
TreeView1.ExpandAll()
I have to ask, have you ever read the documentation on the TreeView and Datagrid controls? Or have even looked through the Intellisense dropdown when you hit "."?
And what's with the "regd" with every question you post?
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Agreed. This forum is for specific questions. You'll never learn anything if you don't actually try to research things - even basic research such as reading the class documentation - if you expect everyone to do the work for you.
I'm a bit confused by "regd" as well. It isn't necessary.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
Actually I have to complete the a project within the next two weeks. It is a big one and I donno much abt C# and .Net. So I post it so that I get the answer without wasting much time. regd I mean regarding. Sorry if I distrubed u with my posts.
Karteek
|
|
|
|
|
Putting "regarding", "re", or "regd" in a subject is pointless: obviously your post relates to whatever the subject says - that's what a subject is for.
It doesn't matter how much time you have to do a project. Not reading about what you're doing is counter-productive and no very smart. You should just jump into something - especially for an important project - without having any idea of what you're doing.
Besides, while your developing your project you should be reading about what you're doing. Not only will you learn while you develop your project, reading may help to make your project better by either providing you with alternative means to perform some task or to make your project more stable.
There's simply no valid excuse why someone can't read even something as simple and quick as class library documentation, at least for the classes the person is using. None.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
karteek wrote:
I donno much abt C# and .Net. So I post it so that I get the answer without wasting much time.
Actually, posting your question and waiting for an answer will take more time than reading the class documentation. It would have taken you about 2 minutes to find the answer to this one just reading the class documentation on the TreeView control.
...and you probably would have learned something else in the process too...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hello, i get this error-> System.Data.SqlClient.SqlException: Login failed for user 'xxx\ASPNET'
do some one knows how to solve it?
i am new to sql and i use msde.
thank u in advance
|
|
|
|
|
You basically have three options:
1) Get some SQL Server management tools, and set up login/user permissions in the SQL Server / Database for the ASPNET user.
2) Same as above, but create a separate SQL Login account, and don't use trusted connections to the database.
3) Add the ASPNET user to the Administrators group. This, however, is not at all secure, and can have very serious side-effects.
Grim (aka Toby) MCDBA, MCSD, MCP+SB
|
|
|
|
|
It sounds like your connection string is setup using Integrated Security. Avoid this and use a dedicated username and password for SQL access. You'll also have to setup that username and password for the database using SQLManager.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Can anybody please help me with dropdownlist.
it must be very simple ... I have this dropdown list which returns me only 1st record .. no matter what i select.
I m using drodownlist1.seletedItem.text to see the value and it's always showing me that i have selected 1st record.
Thanks
|
|
|
|
|
Can you post a bit more of your code so we can see exactly what you are doing?
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Hey Lads,
I'm have a problem here that has me confuddled.. Maybe it's something stupid but I'd appreciate any suggestions.
I have a simple class that contains some strings and an int or two. Lets call it BasicClass . Now I have an ArrayList that contains a few BasicClass objects.
I'm serializing that ArrayList (Binary serialization) into a memory stream. From the memory stream I'm pulling out the underlying byte[] which I am storing in a database.
Now, when I retrieve the data from the database (as a byte array) I create a memory stream containing the byte[] ... I deserialise the contents of the byte[] to give me a lovely ArrayList ....
Great.. everything works.. to here.
When I try to get at the contents of the ArrayList and cast them back to BasicClass objects I get an InvalidCastException (if I don't use safe casting)...
When debugging I can clearly see that the ArrayList , after being deserialized from the database etc, contains x number of object 's and each of those are of type BasicClass (or so the debugger says)... but I can't cast them back to BasicClass objects.... I call GetType() on the objects in the deserialized ArrayList and then when looking at the Type.FullName property it tells me that the object is of type BasicType .... grrrrr!!! .... If it is then why the hell can I not cast it to a BasicClass object.
I also tried the exact same using xml serialization and it gives the exact same problem.
Oh, and BasicClass is serializable, as is the ArrayList class.
Any help would be greatly greatly appreciated lads. I need this sorted ASAP.
Regards,
Brian Dela
http://www.briandela.com IE 6 required. http://www.briandela.com/pictures Now with a pictures section http://www.briandela.com/rss/newsrss.xml RSS Feed
|
|
|
|
|
I'm just curious why you're serializing the ArrayList to a MemoryStream to bet the byte[] instead of just serializing the whole shabang?
In any case, it I would venture a guess that for some strange reason, the BasicClass Type is not the same. Remember that a Type consists of the fully-qualified class name (i.e., includes the namespace), the assembly, the version, the culture and public key token). One cause of this is that perhaps you're using automatic versioning with your assembly, so that the old and new BasicClass Types differ by version. If that's true - there's your problem.
There's two ways to solve this: don't use automatic version (so little control and real pain in the arse with larger solutions, especially when you use late-binding like for plug-ins and what-not) or derive your own SerializationBinder and override BindToType . You can make this implementation generic so that the version number is basically ignored, as I did here:
public override Type BindToType(string assemblyName, string typeName)
{
string name = assemblyName.Substring(0, assemblyName.IndexOf(','));
Type t = Type.GetType(typeName + ", " + name);
return t;
}
Microsoft MVP, Visual C#
My Articles
|
|
|
|