I have a BMW with SatNav built in - it's a female voice and says such pearls as "turn left soon" - her favourite is "please make a legal u-turn" because I often ignore her advice.
Rugby League: The Greatest Game Of All.
I have a BMW with SatNav built in - it's a female voice and says such pearls as "turn left soon" - her favourite is "please make a legal u-turn" because I often ignore her advice.
Rugby League: The Greatest Game Of All.
Why are Australia and South Africa playing each other twice just before the tri nations when they will also play each other twice?
My apps performance improved, my own personal performance remained much the same :-O
As an aside I have found I can make much memory savings by reusing objects. Performance can go through the roof when doing that as well - or at least it did with me.
I have started to use the ODBC calls and P/Invoke as the Odbc stuff is .Net is sorely lacking. Still can't get it work though. IntPtr henv; short ret; // Allocate environment handle ret = SQLAllocHandle(SQL_HANDLE_ENV, (IntPtr)SQL_NULL_HANDLE, out henv); if(ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO) { ret = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION,(IntPtr)SQL_OV_ODBC3, 0); if(ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO) { IntPtr hdbc; ret = SQLAllocHandle(SQL_HANDLE_DBC, henv, out hdbc); if(ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO) { // ret = SQLConnect(hdbc, dsn, SQL_NTS, null, SQL_NTS, null, SQL_NTS); if(ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO) { IntPtr hstmt; ret = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, out hstmt); if(ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO) { ret = SQLTables(hstmt, null, SQL_NTS, null, SQL_NTS, null, SQL_NTS, null, SQL_NTS); if(ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO) { StringBuilder tableName = new StringBuilder(256); int tableNameLen; ret = SQLBindCol(hstmt, 2, 1, tableName, 256, out tableNameLen); if(ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO) { while(SQLFetch(hstmt) == SQL_SUCCESS) { Console.WriteLine(tableName + ":" + tableNameLen.ToString()); } } } ret = SQLFreeHandle(SQL_HANDLE_STMT, hstmt); } ret = SQLDisconnect(hdbc); } // ret = SQLFreeHandle(SQL_HANDLE_DBC, hdbc); } } ret = SQLFreeHandle(SQL_HANDLE_ENV, henv); }
The SQLFetch will be called as many times as there are tables in the dsn but the dsn is empty and tableNameLen is -1. Rugby League: The Greatest Game Of All.
How do I get the database schema once I have set up an OdbcConnection? Primarily I need a list of tables and columns in the database. My App needs to be able to connect to any ODBC datasource and work out what tables and columns it contains. TIA
Are the Xceed and Nevron charts for .NET the same thing?
I have NTL and have no problems with it - just got a free upgrade to 3MB too :cool:
DoEvents isn't called at all during the processing. The WaitCursor just won't stick - I have tried setting the cursor on every single control to the WaitCursor - which kind of works although it doesn't stop mouseinput - the user can still click on things, drag stuff around, press buttons etc. So the WaitCursor doesn't seem to do much - is that what is supposed to happen? Is there a way to disable mouseinput without disabling every single control?
Hope this makes sense
Private Delegate Sub RunCrosstabDelegate(ByVal rowVar As String, ByVal colVar As String, ByVal thirdVar As String)
Private Sub RunCrosstab()
Dim crosstab As New RunCrosstabDelegate(AddressOf \_Counter.RunCrossTab)
crosstab.BeginInvoke(LkCrossTab1.RowVariable, LkCrossTab1.ColVariable, LkCrossTab1.ThirdVariable, Nothing, Nothing)
End Sub
Private Sub _Counter_CrossTabStart(ByVal sender As Object, ByVal e As EventArgs) Handles _Counter.CrossTabStart
If LkCrossTab1.InvokeRequired = False Then
Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
Else
Dim del As New CrossTabStartDelegate(AddressOf _Counter_CrossTabStart)
Me.BeginInvoke(del, New Object() {sender, e})
End If
End Sub
Private Delegate Sub CrossTabFinishedDelegate(ByVal sender As Object, ByVal e As EventArgs)
Private Sub \_Counter\_CrossTabFinished(ByVal sender As Object, ByVal e As EventArgs) Handles \_Counter.CrossTabFinished
If LkCrossTab1.InvokeRequired = False Then
Cursor.Current = System.Windows.Forms.Cursors.Default
'
Else
Dim del As New CrossTabFinishedDelegate(AddressOf \_Counter\_CrossTabFinished)
Me.BeginInvoke(del, New Object() {sender, e})
End If
End Sub
The app does call DoEvents but not anywhere touched by the long process - I usually call DoEvents after closing down a Dialog. I have run it under a profiler and DoEvents doesn't come into it. I am kicking off the long process using BeginInvoke - if that helps.
When I set Cursor.Current to the WaitCursor then start a thread to do a long process the Cursor doesn't remain as the WaitCursor it almost immediately changes back to the default cursor. My long process fires an event to say it has started and I handle that on the GUI thread (yes I am using invoke required and delegates) - this sets the Cursor.Current to the WaitCursor then when the long process has completed it fires another event which is handled on the GUI thread which sets the Cursor.Current to the default cursor. I would like the Cursor to remain as the WaitCursor until the long process has completed but no amount of jiggery pokery seems to enable me to do that - I have had to resort to disabling huge amounts of the GUI so the user can't mess up - a WaitCursor would be nice but it just isn't happening. I know the following is in VB but I haven't had much joy on the VB forum. The long running process fires off an event every 1000 records or so which is handled on the GU thread thus: Private Delegate Sub xxxDelegate(ByVal sender As Object, ByVal e As xxxEventArgs) Private Sub xxx(ByVal sender As Object, ByVal e As xxxEventArgs) Handles LongProcess.xxx If button.InvokeRequired = False Then Console.WriteLine("A - " & Cursor.Current.ToString()) ... Else Console.WriteLine("B - " & Cursor.Current.ToString()) Dim del As New xxxDelegate(AddressOf xxx) Me.BeginInvoke(del, New Object() {sender, e}) End If End Sub
When run the following is written to the console: B - [Cursor: WaitCursor] A - [Cursor: Default] B - [Cursor: WaitCursor] A - [Cursor: Default] B - [Cursor: WaitCursor] A - [Cursor: Default]
Why do the Super 12s games rate so poorly on Aussie TV?
It is the GUI thread which changes the cursor - the long running process just raises an event to say it has started then one to say it has completed - these are handled on the GUI thread.
In my main App I run a long running process on a seperate thread so as not to tie up the GUI - while the process is running I want to set the Cursor to the WaitCursor. The first thing the long running process does it fire an event which is handled on the GU thread and sets the cursor to the WaitCursor then when the process has finished it fires another event which is again handled on the GUI thread and sets the Cursor to default - however, the cursor never actually changes to the WaitCursor The long running process fires off an event every 1000 records or so which is handled on the GU thread thus: Private Delegate Sub xxxDelegate(ByVal sender As Object, ByVal e As xxxEventArgs) Private Sub xxx(ByVal sender As Object, ByVal e As xxxEventArgs) Handles LongProcess.xxx If button.InvokeRequired = False Then Console.WriteLine("A - " & Cursor.Current.ToString()) ... Else Console.WriteLine("B - " & Cursor.Current.ToString()) Dim del As New xxxDelegate(AddressOf xxx) Me.BeginInvoke(del, New Object() {sender, e}) End If End Sub
When run the following is written to the console: B - [Cursor: WaitCursor] A - [Cursor: Default] B - [Cursor: WaitCursor] A - [Cursor: Default] B - [Cursor: WaitCursor] A - [Cursor: Default] ... Why is this?
Whoops, sorry about that - my apps engine is in C# and the GUI is in VB (don't ask) and I tend to spend more time on the C# messageboard - I guess I got bit carried away :doh:
In my main App I run a long running process on a seperate thread so as not to tie up the GUI - while the process is running I want to set the Cursor to the WaitCursor. The first thing the long running process does it fire an event which is handled on the GU thread and sets the cursor to the WaitCursor then when the process has finished it fires another event which is again handled on the GUI thread and sets the Cursor to default - however, the cursor never actually changes to the WaitCursor The long running process fires off an event every 1000 records or so which is handled on the GU thread thus: Private Delegate Sub xxxDelegate(ByVal sender As Object, ByVal e As xxxEventArgs) Private Sub xxx(ByVal sender As Object, ByVal e As xxxEventArgs) Handles LongProcess.xxx If button.InvokeRequired = False Then Console.WriteLine("A - " & Cursor.Current.ToString()) ... Else Console.WriteLine("B - " & Cursor.Current.ToString()) Dim del As New xxxDelegate(AddressOf xxx) Me.BeginInvoke(del, New Object() {sender, e}) End If End Sub
When run the following is written to the console: B - [Cursor: WaitCursor] A - [Cursor: Default] B - [Cursor: WaitCursor] A - [Cursor: Default] B - [Cursor: WaitCursor] A - [Cursor: Default] ... Why is this?
As that site suggests you should visit an osteopath. I had it a few years back and was in agony - a visit to the doctors proved useless apart from a prescription for anti-inflams - where I worked was near an osteopathy school so I tried it out - it worked wonders - the pain was much reduced after 1 visit and totally gone by the time I made my 4th visit. The treatment can be very painful but is worth it. Good luck with it.
I tried doing that - it didn't do anything other than mess up the threads. Thanks for your reply though
I have a gui app which runs a long process on a worker thread. When the thread starts the long running process fires an event which is picked up by the gui thread and sets the Cursor.Current to the WaitCursor - when the long process has finished it fires another event and Cursor.Current is set to the default cursor. Unfortunately the cursor never becomes the WaitCursor - I can test the Cursor.Current.ToString() and it says it's the WaitCursor - but it isn't, just the default cursor. Why is that?