|
It was Norton. The whole program was messed up and I had to reinstall. Now it's running fine, and the WebBrowser control is loading pages as it should.
Thanks so much for taking the time to help and have a great weekend when it gets here!
AB
|
|
|
|
|
You're welcome.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi All,
In our company we are making extensive use of the above mentioned component.
Because of the STA nature of this component we have many challenges in our code to fight threading issues related to this component. (and lots of other non-deterministic behaviour)
Does anybody know if there is a HTML Component available which is simular to the MSHTML component which is not based on this component. (or any other COM/PIA component)
Where looking for a true .NET component which can run safely within a MTA application.
Thanks for your time.
Extra info Component is both used in Windows and Web app
Groetjes,
Joost Verdaasdonk
modified on Thursday, September 17, 2009 11:05 AM
|
|
|
|
|
Hi All,
Good to see that I'm not the only one who finds this question hard to answer.
I'm still hoping on some lost component fullfilling my requirments.
If you know of one let me know.
Thanks.
Groetjes,
Joost Verdaasdonk
|
|
|
|
|
Thanks in adv.
how can we change the type of the control of Tool Strip like from button to Drop down button at run time
Best Of Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
softdev_sup wrote: how can we change the type of the control of Tool Strip like from button to Drop down button at run time
Don't.
At least don't start with a ToolStripButton , make it a ToolStripDropDownButton from the start, and use the ShowDropDownArrow property to turn the dropdown functionality on and of as required.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
thanks for the post
but how can i add toolstripdropdown at run time , how to specofy that the type is dropdown or combobox or something else
Best Of Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
How to: Add ToolStrip Items Dynamically - MSDN[^], will tell you how to do that.
softdev_sup wrote: how to specofy that the type is dropdown or combobox or something else
They are all separate classes, duplicate what is done in the tutorial given above and replace their control with one of your choosing. Take a look at the entry for ToolStrip on MSDN ToolStrip Control (Windows Forms) - MSDN[^]. There are loads of links on that page. Follow them in turn. Read the ones that are textual, code the ones that are examples (if you take my advice type the code in you learn far more that way, don't copy and paste it!).
The only real way to learn how to use the built in controls, is to research them properly. Start on MSDN, then google for more help on things you don't understand.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thank You so so much , GOD bless You
Best Of Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
I work for a company that has developed a library for user authentication, and it uses this library for authenticating users that access the web site using Web Forms and ASP.NET. However, this isn't the focus of this post (or it would be obviously in the wrong place). For those who want to get to the point quickly, the real question is at the very end.
I have been tasked to create a Winforms C# application that also authenticates a user, and I am wanting to use this same library. I have installed the library locally, and it's working fine as in the following example:
private bool EncryptPassword(ref string PW)
{
Type Crypto;
object[] parameter = new object[1];
object CryptoObject;
try
{
Crypto= Type.GetTypeFromProgID("CCDUserLib.Crypto");
CryptoObject = Activator.CreateInstance(Crypto);
parameter[0] = PW;
object result = Crypto.InvokeMember("EncryptedPassword",
System.Reflection.BindingFlags.InvokeMethod, null,
CryptoObject, parameter);
PW = result.ToString();
return true;
}
catch
{
return false;
}
}
From what I understand, System.Type.GetTypeFromProgID("CCDUserLib.Crypto") searches the registry for the registered library "CCDUserLib". I am hoping that I don't have to install the CCD library locally, but instead reference the library that is already installed on our Web Server (which is not the workstation this software is going to be run on).
Is there any way to dynamically bind to a library that is installed on a different machine (like "\\CCDWebServer\bin\CCDUserLib.dll"), assuming the user has sufficient access rights to do so?
Thanks,
Daniel Bragg
|
|
|
|
|
You can't instantiate an object from a class that is not registered on the machine the code is running on. You also, cannot tell it where to find the class without the registration information in the registry.
You either have to install the library on the client workstation or you have to redesign the app to support creating the library objects on a remote server. That will introduce some performance, possibly licensing, and supportability issues, so that may not be the best course of action.
|
|
|
|
|
Thanks. Although licensing wouldn't be an issue (we wrote the library that we want to call), I don't believe it would be worth the effort to make it work this way. I'll just include the library in the distributables and call it done.
Daniel
|
|
|
|
|
Hi everybody,
When we use the Graphics object to draw, for example, on a Form, every time, something covers the entire or just a part of the Form (for example, another window) or when the Form is minimized and them maximized for example, all the drawn graphics are lost (or the part present on the covered part of the Form).
I wanted to know if there's anyway to retain these graphics in these cases? I don't (and can't) use the Paint method because I'm considering a case where the graphics are drawn using different method and not a single method to be called in the Paint event.
|
|
|
|
|
Hi,
this is a common question, for which I keep a standard reply, here it goes:
there are several steps to correctly draw something; it does not matter how complex the paint job is: from a single line, to a complex drawing, or a real work of art.
To make sure it all becomes visible on the screen and gets repainted automatically when moving, resizing, minimizing/maximizing/restoring or uncovering your Form, one should follow these steps:
1.
decide upon what object you want to draw; it normally is a Control (e.g. a Panel) or a Form itself. I prefer to add a Panel to a Form, then draw on the Panel. And I do not like PictureBoxes, they are pretty useless.
2.
create some variables (Rectangle, struct, class, whatever) that hold the parameters of your drawing. For a rectangle that could be top and left coordinate, and width+height, or just a Rectangle. etc. For a complex drawing, it could be a List of objects that derive of a common type, each having its own PaintMe() method.
3.
create a Paint handler (either add your own paint handler to the Paint event, or override the OnPaint method) for that Panel, and do all your drawing in there, using the Graphics object inside the PaintEventArgs, and your variables. Do not call CreateGraphics!
4.
if and when you want to change things, modify the variables and call Panel.Invalidate() or one of its overloads (for selective invalidation).
5.
If you want to animate things, perform the move (step 4) inside the Tick handler of a Windows.Forms.Timer which ticks on the GUI thread, so you are allowed to call Invalidate() from there too.
BTW: if you need to create some objects (Fonts, Pens, Brushes, ...) either keep them
alive in class members (hence create them only once); or create them inside the Paint
handler and don't forget to call Dispose() on them.
C# example:
private Panel panel;
private bool paintRectFlag=true;
private Rectangle rect=new Rectangle(20, 20, 300, 200);
private Pen rectPen=Pens.Black;
public Form1() {
InitializeComponents();
panel=new Panel();
panel.Bounds=new Rectangle(…);
panel.Paint+=panelPaintHandler;
Controls.Add(panel);
}
protected void panelPaintHandler(object sender, PaintEventArgs e) {
Graphics g=e.Graphics;
if (paintRectFlag) g.DrawRectangle(rectPen, rect);
}
protected void buttonClickHandler(object sender, EventArgs e) {
paintRectFlag=!paintRectFlag;
panel.Invalidate();
}
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Thank you soooo much for your detailed answer, but some questions: Can you please tell me:
1. Why do you find the PictureBox control a useless one?
2. Why did you say that we shouldn't call the CreateGraphics method?
3. What exactly does the Panel.Invalidate() method do and how it can be used here?
4. Why did you say that either create the pen, font, etc. object as class members or create them inside the Paint event handler and call the Dispose method? Why is the Dispose method necessary here and what's the difference between these two methods you mentioned.
Thank you in advance ...
|
|
|
|
|
Hi,
farzadmf wrote: 1. Why do you find the PictureBox control a useless one?
Because its functionality is very limited, and as soon as you need more, it works against you. It is OK for showing a picture, it is not OK for modifying a picture, for showing some graphics, for animation, for ...
farzadmf wrote: 2. Why did you say that we shouldn't call the CreateGraphics method?
Because a Graphics object is expensive; you get one for free in the Paint method, other ways of painting require you to create one explicitly (and disposing of it).
farzadmf wrote: 3. What exactly does the Panel.Invalidate() method do and how it can be used here?
it tells Windows your control has changed somehow and need a full or partial repaint; so Windows will call your paint handler asyncrhonously to fix that. All this and the details can be found in the documentation.
farzadmf wrote: 4. Why did you say that either create the pen, font, etc. object as class members or create them inside the Paint event handler and call the Dispose method? Why is the Dispose method necessary here and what's the difference between these two methods you mentioned.
That is elementary:
a. you must call Dispose on all instances you created and no longer need from classes that that offer a Dispose() method.
b. so you either create and dispose such objects every time you rpaint handler gets executed (that will take a lot of unnecessary CPU cycles); or you create them once and keep them around.
May I suggest you improve your programming knowledge by reading a lot, starting with an introductory book[^]to the language of your choice; and learn to use Google to find information you may need.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
I really really appreciate your concern
And, in fact, I'm not that beginner as you think (and as it seems!) and I'm sorry if I asked some beginner questions.
Actually, I'm a fan of reading books myself and I'm really used to finding my answers in MSDN and Google, but for this particular question, which has been on my mind for a long time, I didn't know what to exactly search in MSDN or Google, so I tried it here and honestly, I received some very very good answers that I will try to consider surely.
Thank you again for your detailed and good answer and for guidance.
|
|
|
|
|
Hi friends,
i have a problem in windows service.I have made application same as that code.that application contain IHTMLDocument interface.When i run the service, break point disappear from this IHTMLDOCUMENT line nad not completing the further process.Where as with the same code,application successfully executed.
Can anybody tell me what type of problem is there?reply me on sonal.2086@gmail.com
reply asap.
Thanks & regards,
Sonal Patel
|
|
|
|
|
I have no idea myself, but it sounds as though the IHtmlDocument interface requires a Form in order to work. Since services do not expose forms or a message pump, I think you're not going to get it to work.
|
|
|
|
|
hi...
can u give me solution for it?I am stuck with this problem since 2 weeks.
Please give me reply asap.
Thanx and Regards
Sonal Patel
|
|
|
|
|
Well, first, don't use IHtmlDocument. Next, I have no idea what you're doing with the page that comes back so I really can't tell you a proper solution.
|
|
|
|
|
Hi,
I am developing a live support application operator console using .net windows forms.
Now in this application it's very important to show the current info in fastest way.
I am showing all the users on site in a list-view control and to show the updated status of online users I am refreshing the list-view control's content by every second.
Now when user will click on any listview record, it will show the details of user ( chat script, geographical info,navigation info) in the bellowed panel.
It works quite fast when it is on my machine. But when I m using the remote database it's TOO SLOW
Now ,
1. What I can do to improve performance ?
2. Shall I go for threading ?
I tried to use use threading like
private void timer_refresh_Tick(object sender, EventArgs e)
{
Thread _timerTickOp = new Thread(TimerTickOperations);
_timerTickOp.Start();
}
private void TimerTickOperations()
{
try
{
UserFacade facade = new UserFacade();
Operators _currentOperator = facade.GetOperator(LoginForm.LoggedInOperatorName);
FillUsers(toolStripCbox_Filter.SelectedIndex);
.....
}
but I m getting err 'Cross-thread operation not valid: Control '' accessed from a thread other than the thread it was created on.'
What should I do to improve performance?
|
|
|
|
|
Hi,
I explained the cross-thread problems in this article[^].
In your particular case, you might consider using a Windows.Forms.Timer instead of your current timer class, as the former ticks on the main thread, hence won't show any cross-thread problems. If that results in a GUI that isn't sufficiently responsive (because your database accesses take too long), then you need to use another kind of timer and apply the InvokeRequired stuff from the article.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Threads give you more processing power, but it sounds like your bottleneck is the database. Some suggestions for you to explore;
* Check your database-indexes, that's the number one suspect in slow databases.
* Check your SQL-statements in a profiler, using the same amount of data as on the remote server.
* Check whether you can move some of your data/work to a local database.
* Check the remote server; it will be terribly slow if there's little virtual memory left.
Sometimes you can't make it faster. In that case, whip up a form to show the current progress and status. Or better yet, show it as a tray-icon, similar to Windows Update.
Good hunting
|
|
|
|
|
I am new to dotnet. I have an application with one login screen and three other screens. On login user can go to any of the other three screens by selecting the options. On all three screens i have a Picture box which i need to update the Image every one minute based on some logic.Can you please help me on how to do it using one thread in main form.
Note: I have a base form, all the forms are inherited from Baseform
User can go only to one form at a time
Using VS2003
|
|
|
|
|