Jump to content
Xtreme .Net Talk

bisquic

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by bisquic

  1. A little more info: I've tried getting this to work with both a direct file check and a manifest file check. Same results with both... nothing.
  2. Is it possible to use the Application Updater Component with a Linux Apache server? I've set up a very basic test app but it is not working. No error messages and an empty log file. I know the app is connecting because I can see it in my firewall logs. I've even tried disabling my firewall just to be on the safe side. I've verified that directory browsing is enabled, so I'm thinking that the problem could be that I'm not using IIS. I'd really prefer to not have to set up my own IIS server since I'm already paying another company to host a webpage for me and I'd like to just use a separate directory there. Any help would be appreciated! -b
  3. cool, thanks again for the help!
  4. "You'd have to make sure you unhooked the event as soon as it was first fired though." Couldn't I just do the same with the HandleCreated event, thereby avoiding the check on the RecreatingHandle property and preventing the StartThread function from needlessly being recalled in the first place? Malfunction, I'm using multithreading to... well, currently I'm just doing this for a .NET learning experience, but you might want to use it to allow the user to ineract with the UI while some other task in your app is taking a long time to finish. Like a database request.
  5. Hopefully this will put this issue to bed. Somebody clued me in on the HandleCreated event. Now I'm just registering this event in the View constructor to call a function to start the thread. If somebody sees a problem with this approach, please let me know. Otherwise I'll assume this problem has been solved. Hope these posts save somebody else a headache or two.
  6. Ok, turns out the problem was not solved after all. InvokeRequired kept returning intermittent results which caused bizarre, random behavior. After a couple of hours of debugging, I finally realized what was wrong. After figuring it out, it doesn't seem like it should have taken me so long! Anyway, I was starting the thread from the View constructor and starting the app like this: View* view = new View(); Application::Run( view ); So there was a race condition where sometimes the new thread was executing before the window was even shown. I got around this by starting the thread from a button click instead. In this situation it's an acceptable solution, but I would still like to learn if there is a way to automatically start a thread in the main form after Application::Run. Since Application::Run blocks, I can't manually make a function call on the next line to do it. Anybody have any ideas?
  7. good point :) thanks for the help!
  8. Adding that condition did the trick. I don't understand why though since I am accessing the method from a worker thread. Seems very strange to me. It's also kind of annoying to have to do that since the condition needs to be checked in every iteration of the loop. Seems like it could really affect performance in a more demanding situation... like processing collision detection. Is there any better way to do this or is this the typical practice? Thanks for the help!
  9. did you ever find a solution to this problem? I think I'm having the same issue using mc++.
  10. Ok, I've read a handful of articles out there concerning the issue of accessing a control from a thread other than the one from which it was created. I think the most well-rounded solution I found is to create a delegate to a function that accesses the control and then call this->Invoke( theDelegate ) from the worker thread in the form to marshal the call to the UI thread. I wrote a test app to try this out and the problem I'm having is that if I try the following, the function that should be called via Invoke never gets called, and the code that follows the Invoke in ThreadLoop never gets executed... ... __delegate void DisableButtonDelegate(); DisableButtonDelegate* disableButton; Button* aButton; Thread* aThread; View() { InitializeComponent(); disableButton = new DisableButtonDelegate( this, DisableButton ); aThread = new Thread( new ThreadStart( this, ThreadLoop )); aThread->IsBackground = true; aThread->Start(); } void ThreadLoop() { while ( true ) { this->Invoke( disableButton ); MessageBox::Show( S"After invoke" ); aThread->Sleep( 2000 ); } } void DisableButton() { MessageBox::Show( S"Disabling button" ); aButton->Enabled = false; } ... However, if I place the aThread->Sleep BEFORE the Invoke, or if I insert a MessageBox before the Invoke, everything works fine and executes like I would expect it to. Can anybody with a deeper understanding of what's happening explain this to me? Also, is there a prefered way of dealing with this situation?
×
×
  • Create New...