Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

PaleyX

@PaleyX
About
Posts
125
Topics
47
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SatNavs - Your preferences
    P PaleyX

    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.

    The Lounge question

  • Rugby: Australia vs. South Africa Take 2
    P PaleyX

    Why are Australia and South Africa playing each other twice just before the tri nations when they will also play each other twice?

    The Lounge visual-studio com game-dev

  • GC
    P PaleyX

    My apps performance improved, my own personal performance remained much the same :-O

    C# performance

  • GC
    P PaleyX

    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.

    C# performance

  • Schema and OdbcConnection
    P PaleyX

    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.

    C# database question xml

  • Schema and OdbcConnection
    P PaleyX

    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

    C# database question xml

  • Charting
    P PaleyX

    Are the Xceed and Nevron charts for .NET the same thing?

    C# csharp question

  • NTL hell
    P PaleyX

    I have NTL and have no problems with it - just got a free upgrade to 3MB too :cool:

    The Lounge help com tools question

  • Thread and Not Responding
    P PaleyX

    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?

    C# question help

  • Thread and Not Responding
    P PaleyX

    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
    
    C# question help

  • Thread and Not Responding
    P PaleyX

    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.

    C# question help

  • Thread and Not Responding
    P PaleyX

    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]

    C# question help

  • Super 12 Rugby Roundup : Week 5 - Knives
    P PaleyX

    Why do the Super 12s games rate so poorly on Aussie TV?

    The Lounge adobe game-dev collaboration regex announcement

  • Cursors and threads
    P PaleyX

    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.

    Visual Basic question

  • Cursors and threads
    P PaleyX

    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?

    Visual Basic question

  • Cursors and threads
    P PaleyX

    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:

    C# question

  • Cursors and threads
    P PaleyX

    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?

    C# question

  • Frozen shoulder: anything work?
    P PaleyX

    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.

    The Lounge com help question

  • WaitCursor
    P PaleyX

    I tried doing that - it didn't do anything other than mess up the threads. Thanks for your reply though

    C# question

  • WaitCursor
    P PaleyX

    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?

    C# question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups