Results 1 to 10 of 10

Thread: Simple Problem Using Invoke

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2009
    Posts
    9

    Simple Problem Using Invoke

    I am working on adding multi-threading to my application. I have done two applications using multi-threading following a tutorial of sorts, and modifying the code to "get my feet wet."

    This is the first time I am trying multi-threading within my own application, and I feel I should be beyond this type of problem, but after a 3 hour search on the forums, I can not find a solution, so I am posting this thread.

    The section of code with the error
    vb.net Code:
    1. Imports System.Threading
    2. Imports SldWorks
    3. Imports SwConst
    4. Imports System
    5. Imports System.Windows.Forms
    6. Imports System.Globalization
    7. Imports System.Object
    8. Imports System.Math
    9.  
    10.     Public Parent As GCode
    11.  
    12.     Public Sub Initialize(ByVal oParent As Object)
    13.         'oGCode = oParent
    14.         Parent = oParent
    15.         .
    16.         .
    17.         .
    18.  
    19.         bResults = Parent.invoke(Parent.cSetTransform, swMathTransform)
    20.  
    21.     End Sub
    The error is:
    Error 1 'invoke' is not a member of 'ToyodaMill.GCode'.


    the Gcode class is as follows:
    vb.net Code:
    1. Imports System.Threading
    2. Imports SldWorks
    3. Imports System.IO
    4. Imports System.Text
    5.  
    6. Public Class GCode
    7.  
    8.     ReadOnly oTransformLock As New Object
    9.     Dim swTransform As MathTransform
    10.     Dim sTransformName As String
    11.  
    12.     Delegate Function dSetTransform(ByVal Transform As SldWorks.MathTransform)
    13.     Public cSetTransform As dSetTransform
    14.  
    15.  
    16.     Public Function SetTransform(ByVal Transform As SldWorks.MathTransform) As Boolean
    17.  
    18.         Monitor.Enter(oTransformLock)
    19.         SetTransform = True
    20.         Try
    21.             swTransform = Transform
    22.         Catch ex As Exception
    23.             SetTransform = False
    24.         Finally
    25.             Monitor.Exit(oTransformLock)
    26.         End Try
    27.     End Function
    Please help
    Last edited by Hack; Jun 15th, 2009 at 11:52 AM. Reason: Added Highlight Tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width