|
If the code you have posted is on the main UI thread (and it should be as otherwise you should not call Application.DoEvents ), the problem with using an AutoResetEvent or Monitor.Wait and Monitor.Pulse is that it will put the UI thread to sleep until the operation completes and thus produce a very unpleasant unresponsive application. It won't cause the application to crash, but it will seem like it has if a network problem occurs or a server is very slow to respond.
The question is why do you need any synching at all? The WebBrowser already provides a mechanism in the form of the event, so if step one is to download a document and step 2 is to scrape it, then why not just call scrape() from within the completed handler?
There is at least one problem with this though; it's a bit tedious to update the UI from threads other than the main UI thread, because you have to marshal the calls using Control.Invoke . It's not difficult but it is a bit ugly.
|
|
|
|
|
Hi,
if you don't need to see the web page, you should not use a WebBrowser at all; just use the HttpRequest class.
[EDIT] That will give you the page you ask for without loading all the referenced objects, such as images.
[/EDIT]
modified on Thursday, April 16, 2009 8:00 AM
|
|
|
|
|
Hi Guys,
I'm having problem with getting my TreeView check boxes working as intended. I've got a set of root nodes for Groups, and all child elements belong to that group. I'm only interested in enabling check changing for child items, and changing the group check state should be prevented.
I have overrided the OnBeforeCheck and OnAfterCheck to perform the desired bahviour, However, by double clicking on an unchecked check box, the check state is changed, and i get nothing in either OnDoubleClick, OnNodeDoubleClick and no Before/After check events. The OnDoubleClick and OnNodeDoubleClick are raised when going from Checked to Unchecked.
Ideally i'd like to disable or hide the 'group' node check boxes
Does anyone have a solution for this?
Regards
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
The only thing I can think of that might work is to override the two doubleclick event handlers and test for the Level of the node, passed in the eventargs, if Level == 1 (or whatever), return, otherwise do base.onWhatever. THis of course will only work if all of your 'group' nodes are at the same level.
It would look something like:
private override void OnDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
if (e.Node.Level == 1)
{
return;
}
base OnDoubleClick(sender, e);
}
Hope this helps.
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.”
|
|
|
|
|
Hi Henry,
Thanks for the reply, but i've tried overriding the OnDoubleClick and OnNodeDoubleClick and neither of them are called when double clicking a node, except when going from checked to unchecked.
I will see if i can make it reproducable and submit a project to MS.
Regards
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
I am busy designing an upgrade 'wizard' for our web application, as was wondering if a .NET Woikflow project would be suitable for this? The application needs to perform three main tasks, viz. obtain configuration information, upgrade the database by running one or more scripts, and upgrade the web application by replacing files. More tasks may and probably will be added to the application later on. I'm looking for a task based, sequential flow type design, with a minimal, shared interface for all tasks.
A full-on Workflow application may be overkill, but if it provides a feasible to use, ready made and tested task structure, why should I not use it?
|
|
|
|
|
|
Thanks Pete. That deserves a good looking at. I've often coded along those lines without being aware that the tactic was 'formalised' as a design pattern.
|
|
|
|
|
Hi,
We have a WPF Windows Application and this application would be used by all our client having VISTA OS. For any error occured, system will create an entry in Application event log using the custom event source - "Application Manager". When the User Access Control (UAC) is turned ON, VISTA does not allow to register custom event source in the registry. But this works well when the UAC is turned OFF.
Is there any way where in we can create a custom event source (on the fly/programatically) with UAC turned ON?
Note: Our application gets installed using "Click Once".
Regards,
Vipul Mehta
|
|
|
|
|
Unfortunately, your app needs to be running with elevated privileges to
create a custom event log.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hi,i am new developer in vb.net.i have using vb.net2.0 and ms access.actually i am doing project on college student's attendence. a getting all the connection and at all but a would like to knoe the DATE difference parameter query for the attendence report by 'TO DATE to FROM DATE'.
|
|
|
|
|
If you want to know the diffarence between two dates you can use following sql function
DATEDIFF ( datepart , startdate , enddate )
refer following link also
http://msdn.microsoft.com/en-us/library/aa258269(SQL.80).aspx
|
|
|
|
|
Hi
My VB.NET Library references ADODB. When I build it, the above message comes out.
Should I run tlbimp.exe ?
Thanks
Marcello Turnbull
|
|
|
|
|
Sounds like you have signed your assembly, and that .NET wants you to sign the assemblies that you have referenced also.
Does the message go away if you build it without the signing-key?
I are troll
|
|
|
|
|
Hello friends.
I want to create an application in .net or VB 6.0 to search file in my systems. file may be Word, Excel or PPT.
As in Windows Xp it is inbuilt file searching option but still i want to create an application like that. By which i can be able to search my files using the contents based. Any body please help me and if you have the code please mail me at anandbpsri@yahoo.co.in
with regards.
Anand Srivastava
|
|
|
|
|
Did you read the sticky? The first thing it says is don't post and ask "do you have the code to do this or that". People are very helpful here, but nobody likes a parasite.
|
|
|
|
|
Hi
i got problem in setup project welcome dialog to get new line in welcom text. am not getting new line here. How cani get new line in welcome text.
Thanks in Advance
--Naren
|
|
|
|
|
Hi Friends, In my project, i am using two classes suppose A and B. Class A contains two functions suppose SetInputF1 and SetInputF2 with same code and same return type just differ in function name (both functions are used to assign input values of class A to static global variables), and class B contains one function suppose f3. SetInputF1 is called by many functions.
Now if i call SetInputF1 in f3 then the values of static global variables are not setting properly and if i call SetInputF2 in f3 then values are setting properly. I am using SetInputF2 function only due to this problem. But due to this my code length is increasing. How to overcome this problem , please help me if you can...
http://nnhamane.googlepages.com/
|
|
|
|
|
One more thing, SetInputF2 function is not called by any function. If i call SetInputF2 function in any other function then same problem occuring as with SetInputF1 function.
http://nnhamane.googlepages.com/
|
|
|
|
|
i think due to the cause of other functions your global variable values are changing.
better to clear those variables before calling your function.
|
|
|
|
|
I don't think you have a good understanding of the problem. Chances are one of the methods doesn't actually assign the static field under some circumstance, and you need to understand what those circumstances are in order to see how to proceed from here.
Also, I cannot help but wonder why you're using static fields. If they really belong to the class rather than an instance of the class then fine, but then you should also use static methods to work with the fields. Not that this would affect whether or not the fields get set; it just doesn't make any sense to require instance methods to be used to set class state - at least in most cases it wouldn't make sense.
The short answer to most questions of the sort "my code says to add together two and two and store the result in the variable 'n', but after the code has run the value of n is five. Why?" is "attach the debugger". Step through your code and step into the "SetF.." methods and inspect local, instance, and class variables, and you'll probably soon find out exactly why it doesn't work as expected, while at the same time learning invaluable debugging skills you can use to solve hundreds of other problems.
If that's not possible, post the minimum code required to reproduce the problem. If the problem is what you say it is, you should be able to reproduce it with simple classes a bit like this:
public class A
{
static int n;
static public void SetN(int value) { A.n = value; }
static public void GetN() { return A.n; }
}
I presume you have a way to GET the value that is being set as well, although I do not understand why you'd use this approach over static properties.
|
|
|
|
|
Thanks dojohansen for your reply. Actually static variables i have mentioned above are not actually variables..they work like static variables but they are objects of user defined classes(in dll) which are created for mapping the inputs, and the objects works as keys and can be used anywhere in the project. If i assign any input value to object then its value can be used throughout the program. So we use it...but sometimes value becomes undefined(error) as mentioned above. I thought that it was due to half code in .cpp and half in .h, so integrated all in .h file then also not working...while trying a lot i got the solution. I need to write same code with different function name and that function should not be called by any other function, then values are setting properly but code is increasing...dojohansen i have posted my query after lot of debugging and discussing with colleagues, hope you better understand my problem now. Thanks and Regards - Nilesh.
http://nnhamane.googlepages.com/
|
|
|
|
|
Is available, realised in language C # the project dll-components "Windows Forms Control Library" at which the main form is inherited from System. Windows. Forms. UserControl. Given a dll-component can display Tiff files. It is necessary to make so that in Internet Explorer at opening of the reference to a Tiff-file for file display it was used this mine of a dll-component as ActiveX.
For this purpose:
1. In Properties the project on a bookmark “Application\Assembly Information …” has established a tag “Make assembly COM-visible”, and on a bookmark “Build” - a tag “Register for COM interop”.
2. By means of a command “sn.exe-k ImagingSedoControl.snk” has created a file of keys and has placed on it the reference in file AssemblyInfo.cs of the project.
3. Has compiled dll-ku and then has placed assemblage in GAC. Thus in the register all necessary keys and sections were created.
4. Further being based on http://msdn.microsoft.com/en-us/library/aa751976 (VS.85).aspx has registered CLSID the basic class of component ImagingSedoControl. MainForm in section «HKEY_CLASSES_ROOT\MIME\Database\Content Type\image/tiff» in parametre CLSID.
After that Internet Explorer at opening of the reference to a Tiff-file, for example «C:\2886456.tiff», for its display began to load my component. But to display Tiff a file, in the basic class dll-components it is necessary for me to learn that line which has been entered in an address line Internet Explorer.
How it to make?
|
|
|
|
|
If you make a plug-in that handles a content type you do NOT need to know the URL of the resource, much less of the page containing it. That would only be useful for various sniffing or spying purposes.
The browser takes care of request and your component needs only the bytes that make up the response body. I wouldn't be surprised if plug-ins *can* obtain rather more information than this, but it's certainly all you need to draw the image.
|
|
|
|
|
The matter is that mine UserControl the component is Windows Form.NET the application, instead of component ASP.NET. This component is used as usual ActiveX Plugin adjusted for that it.NET a component. Clone of it is, for example Adobe Acrobat Pdf Plugin, which boots in Internet Explorer when in its address bar it is introduced, for example "C:\designpatternscard.pdf". It is obvious, that when Internet Explorer loads Adobe Acrobat Pdf Plugin it somehow transmits it string "C:\designpatternscard.pdf" since. Otherwise Adobe Acrobat Pdf Plugin "would not know" which file to it it is necessary to map.
|
|
|
|