Jump to content
Xtreme .Net Talk

Roey

Avatar/Signature
  • Posts

    238
  • Joined

  • Last visited

Roey's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Roey

    Threading

    Success.... Thanks so much for your help on this Mr Paul, you have saved the day.
  2. Roey

    Threading

    I came up with nearly the same method as the first example you posted. However, I found that m_configevent.WaitOne() was only executed after the UI input was complete, which obviously left Thread B still running. 'At class level Dim m_configevent As New AutoResetEvent(False) Dim m_configresult As Integer Private Delegate Function ConfigScreen_Delegate(ByVal CategoryID As Integer, ByVal CategoryDescription As String, ByVal ItemID As Integer) As Integer Private Function ConfigScreen(ByVal CategoryID As Integer, ByVal CategoryDescription As String, ByVal ItemID As Integer) As Integer If (Me.InvokeRequired) Then 'Non-UI thread executing Dim args As Object() = {CategoryID, CategoryDescription, ItemID} ' Make arguments for the delegate. Dim cdelegate As ConfigScreen_Delegate ' Make the delegate. cdelegate = AddressOf ConfigScreen Me.Invoke(cdelegate , args) m_configevent.WaitOne() 'Return result Return m_configresult Else 'UI thread executing 'Do stuff relating to user input m_configresult = 10 'Result of user input 'Allow waiting thread to return m_configevent.Set() Return 0 End If End Function As regards the last example you posted I got an error on the DirectCast, and didn't understand how this would be stopping Thread B PS I really appreciate the time you have already spent on this problem....
  3. Roey

    Threading

    Thanks once again for you help... The whole process is triggered by user input in the UI. The part of your solution that I am stuck on (please bear with me I am totally new to threading) is how to make thread B wait after calling Invoke. I tried Dim WaitEvent As Threading.AutoResetEvent WaitEvent = New Threading.AutoResetEvent(False) If Me.InvokeRequired Then Console.WriteLine("Invoke Required") Dim value_delegate As LoadConfigurationForm_Delegate value_delegate = AddressOf LoadConfigurationForm WaitEvent.WaitOne() Else Console.WriteLine("Invoke NOT Required") Dim frmSalesOrderConfigurator As New UISalesOrderConfigurator() .... WaitEvent.Set() End If But the problem is that WaitOne deals with the current thread and doesn't get executed after invoking the delegate.
  4. Roey

    Threading

    Thanks for the response. A bit more detail on my problem.... Client - calls a function on the server decExplossionArray = objRequirements.BOM_Explosion_Costing_Level_One(ItemID) Server - Does a recursive loop through a list of items until it finds an item that meets a specific criteria (Configurable - requires user input) The server then uses a delegate function to raise a screen (showdialog) on the client side Public Delegate Function ConfigurationScreen(ByVal CategoryID As Integer, ByVal CategoryDescription As String, ByVal ItemID As Integer) As Integer The user then selects a configurable item from the screen and the result is sent back to the server. The recursive loop then continues searching for configurable items (if any are found the user is once again prompted for input). Once the recursive loop has finished processing a cost is returned to the orginal screen (UI Thread).
  5. UI initiates Client Thread 1 Call to Server (Client Thread 1 Lock) Server Delegates Message to Client (Client Thread 2 starts) *server proessing not yet complete* Client uses Me.Invoke to display (showdialog) form on the UI thread Problem: The UI thread is locked so the process hangs.... I have tried creating the intital UI call to the server on a different thread but still cannot get it to work.
  6. Is it possible to have a Delegate Function raised on the server (different appdomain) that prompts a client for a response and then after receiving that response continues with its processing. I am using a wrapper method to pass the function between appdomains The Invoke method to display the modal form BUT the server side thread doesn't seem to wait for a response..... Any help would be really appreciated
  7. It took a reinstall of Visual Studio to get this going again !!!
  8. I have been using Server Explorer in Visual Studio 2005 quite happily for about a year now. This morning I tried to launch it from the View menu and nothing happened. I just cannot seem to get it running.... The databases are up and running on the server and I can connect to them using SQL server management studio.
  9. I want to change the appearance of the buttons on my form so that the BackColor property is White. The problem that I am having is that when a button is disabled the font color still looks pretty dark making it difficult to distinguish from an enabled button.
  10. In this case it would
  11. I have a Windows Forms app that connects to an Access database. I want to publish some data from this app on a web page. What are the security implications if I share the same database internally and externally. Should I be using two separate databases and synchronizing them some how?
  12. That's the sort of solution that I was thinking about as well... Would my internal Windows forms application and external website share the same database and if so are there any securty issues that I should be aware of?
  13. I also use remoting for distributed apps. There is a book that I found invaluable http://www.amazon.com/exec/obidos/tg/detail/-/1590590627/qid=1116512617/sr=8-4/ref=pd_ka_1/102-9188408-9628938?v=glance&s=books&n=507846
  14. Maybe I have misunderstood your question but why not use a tool that is already out in the market. I use Weblog Expert lite which comes as a free download http://www.weblogexpert.com/lite.htm
  15. Pretty general question here, so that I can go off and do some research... I would like to post the order status of customers orders to a website so that they can log in and see when to expect a delivery. Similar to what Dell and Amazon have. My program is currently using Windows forms. Thanks
×
×
  • Create New...