Callback function from unmanaged dll to vb.net-- display problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FordPrefect
    New Member
    • Oct 2007
    • 1

    Callback function from unmanaged dll to vb.net-- display problems

    I am using a 3rd party dll (not COM). One of the dll functions requires a callback function. I have used either DllImport or Declare to properly (I think) declare the function. The function requires a pointer to a function for the call back, and a pointer to a data duffer. I am using a delegate to define the callback function.

    The callback is triggered correctly and I am able to print the result of the callback to Debug.Write. I can verify that the data has been transferred into the callback function. However, I can't update a textbox or label from within the callback function. The text is indeed being updated, as I can get the text property from the control and it has been updated. However the display won't update.
    I have tried setting the textbox's text property or using appendtext. I have also tried more direct methods using a couple win32 calls to UpdateWindow or forcing an Invalidate event. Neither of those approaches work either. I even tried to set the textbox text directly with SetWindowText() but that did not work either.

    The calls to the callback function fire a few times a second. This is in vb.net 2005

    I am at a loss as to how to get this to work. Any advice appreciated.
    Thanks
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Question moved to .NET Forum.

    Comment

    Working...