|
Move your scrolling text to its own control that, itself, is threaded.
|
|
|
|
|
Hi Dave,
Thanks for your answer. We did what you have written. Our scrolling text was already a control, so the only thing that we had to do is adding a thread that does the work to scroll the text. But we have noticed that the OnPaint method (draws the text, and is executed by the Paint event of the form) is executed in the MainThread and not in the new thread that we have created. So the text is drawed on the form in the MainThread. The OnPaint event is triggerd by calling the invalidate method. The handler that says what to do in the MyBase.Paint event is also set in the new thread. Is it possible to execute the OnPaint method in our new created thread?
Thanks in advance,
Kurt
|
|
|
|
|
No, it's not. All drawing happens on the UI thread, no matter what.
I thought you said you moved the long-running operation to a seperate thread and left the Scrolling Text on the UI thread.
Basically, since you have no source code or control over the control that's loading the move, it's going to do it's operation on the UI thread, no matter what you do. The only option you have is to find a control that loads it's data in it's own background thread. I don't know of any off the top of my head.
Basically, you have to get each operation you want running at the same time in it's own thread. All rendering will happen on the UI thread, no matter what. So, if any operation, like loading the movie, happens on the UI thread, all drawing for all other controls, no matter what thread they're on, will stop, until the movie is loaded.
|
|
|
|
|
I'm using the webbrowser control of Microsoft to load a HTML page. When I use this control to load a page, the most of the controls are waiting then for a short time. So this means that the webbrowser control is doing his work in the UI thread? If so, why it's implemented in this way? I think it should be better to do the work of the webbrowser in a seperate thread.
|
|
|
|
|
ambio wrote: When I use this control to load a page, the most of the controls are waiting then for a short time. So this means that the webbrowser control is doing his work in the UI thread?
Yes.
ambio wrote: If so, why it's implemented in this way?
Ask Microsoft.
ambio wrote: I think it should be better to do the work of the webbrowser in a seperate thread.
The WebBrwoser control is an implementation of Internet Explorer, NOT a "from the ground up" purpose built browser control. Your constrained by the limits of IE.
If you want true multithreading, you'll have to write the page downloading stuff yourself. Check into the HttpWebRequest class.
|
|
|
|
|
Ok, thanks for your help and time.
|
|
|
|
|
Hello,
Is it possible to use vb.net transactions with connection to AS400?
Here is a snippet:
objConn.Open()
' Make the transaction.
Dim trans As Odbc.OdbcTransaction = _
objConn.BeginTransaction(IsolationLevel.ReadCommitted)
' Make a Command for this connection
' and this transaction.
Dim cmd As New Odbc.OdbcCommand( _
"UPDATE AUTCTRL SET CTLNM=? WHERE CTLNM=?", _
objConn, _
trans)
' Create parameters for the first command.
cmd.Parameters.Add(New Odbc.OdbcParameter("CTLNM", txtFirstName1.Text))
cmd.Parameters.Add(New Odbc.OdbcParameter("CTLNM", txtLastName1.Text))
' Execute the second command.
cmd.ExecuteNonQuery() '(1) BUG IN THIS LINE
' Create parameters for the second command.
cmd.Parameters.Clear()
cmd.Parameters.Add(New OleDb.OleDbParameter("CTLNM", txtFirstName2.Text))
cmd.Parameters.Add(New OleDb.OleDbParameter("CTLNM", txtLastName2.Text))
' Execute the second command.
cmd.ExecuteNonQuery()
' Commit the transaction.
trans.Commit()
' Close the connection.
objConn.Close()
'(1): ERROR [HY000] [IBM][Client Access Express ODBC Driver (32-bit)][DB2/400 SQL]SQL7008 - AUTCTRL in RAVONLIBT not valid for operation.
Thank you
Shay Noy
|
|
|
|
|
As far as I know, AS400 is a type of IBM computer, not a database. I assume you have a database on there (as you have a connection), so I expect the database either supports these types of transactions or, by the error message, more likely it doesn't. In a nutshell, check your database documentation.
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I wonder if it is DB2. The only time I used AS400 stuff it was a cobol type environment I think but that was in the 90's.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
It's DB2.
The need to optimize rises from a bad design
|
|
|
|
|
|
|
Hi all,
I am about to develop a client server application in which there can be more than 2000 clients continuously using the application at once.
The rows returned at one time might be of 1000 s as well. Previously in VB 6 I use to use win sock or dart sock for communicating but the projects were not as big as this.
Now i am developing this application in .net 2005 and i went through web and found 3 different approaches of communicating between client and server applications and so I am not being able to choose the right one for me.
In my application i will have one desktop application and one web application. Both of these interfaces can be used by clients which connect to remote server and i need to log the connected users as well.
Then server will process the requests and talk to Active x objects which will be located in different remote location and those active x objects will talk to database and get back the rows and have to return to appropriate client.
Ok now in this scenario what would be better for me to use? please advice advantages and disadvantages of using each of the processes.
thanks in advance
|
|
|
|
|
I would probably use a web service. I beleive remoting will give you a faster response but the environment is more complex to maintain. I'll be interested in other responses.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello to all you gurus and supporters here!
I seem to create some performance trouble when it comes to reading the filenames from a large directory (~ 30 thousand files) into a listview field like that:
Dim TargetFileList As Array
With openDLG
...
If .ShowDialog = Windows.Forms.DialogResult.OK Then
TargetFileList = openDLG.FileNames
Return TargetFileList
End if
End With The applications dialog window freezes for long... long....
Does someone of you probably know a better (i.e. faster) way of reading all of these filenames? The purpose is to find similar names in another directory and display filesInDir1 / missing files / filesInDir2 in different listview fields then.
Thank you for any inspiration
Michael
|
|
|
|
|
There's no way to speed this up. You're already using the system supplied dialog. Really, the problem is in returning a list of 30,000+ filenames and rendering them in the dialog. You'll ahve to write your own, but I doubt you'll see any performance gains that would justify the effort.
|
|
|
|
|
Listview doesn't handle that much items very fast in normal mode. Have a look at ListView.VirtualMode Property[^]
The need to optimize rises from a bad design
|
|
|
|
|
Thank you both for examining.
I'll have a close look at the VirtualMode.
|
|
|
|
|
I had to do something similar to what your trying to accomplish. Basically I have a treeview that is being 'partially' built with dirs/filenames when the app loads. The app requirements were that some directories were to be selected by default meaning that the "parent" directory, sub dirs, and all files are to be selected. The user can also select just a dir or selected files (so I used a tri-state checkbox scheme with the grid lines).
If a parent is expanded, the files and dirs are then populated. If closed and checked, there's no need to pull the files since you're selecting everything unless the users expands the node (if this is making sense).
We have dirs with a very large amount of files per folder. Trying to pull all file names for all folders at once could be done. Had to split it out a little.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Smart idea, kissdnuts - guess you had some good coffee again ! I thought it might be the shorter and faster way to use standard windows dialogs, but it seems the standard dialog collects the files already when a folder has been selected (which doesn't make a lot of sense, does it?).
Would you be so kind as to put some example code for populating the tree view?
Thanks
Michael
|
|
|
|
|
Hi everybody,
gotta deal with directories containing large numbers of files (approx. 30.000 in each dir), so that directory selection seems to be an endless process ( pita ) for the user if I use the the VB 2008 (Express) FolderBrowserDialog object.
In an older VBScript solution I was able to integrate a text field into the shell.BrowseForFolder object (parameter), so that there was the option to type or paste a path alternatively. This option I can't find for the FolderBrowserDialog, nor can I find any information if (and if not: how?) it's possible to use the shell.BrowseForFolder in VB 2008.
Does someone of you know a nice & fast solution for selecting a folder containing so many files? I don't need any filenames here, just the path.
Thank you
Michael
|
|
|
|
|
I did something similar to what your doing. I used a treeview/listview with checkboxes so that the user could select directories etc dynamically.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
You can use the "FolderBrowserDialog" class in System.Windows.Forms.
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
|
|
|
|
|
Thank you both for inspiration. I'll check it out!
|
|
|
|
|
Thanks for your answer, but are there really different objects called "FolderBrowserDialog"?
I had used the one "FolderBrowserDialog" before, like
Dim openFLD As New FolderBrowserDialog and that's the one that takes endless time and makes the application freeze with a large file number.
In case there are different objects of the same name: HOW would I tell VB which one to use?
Regards
Michael
|
|
|
|