Results 1 to 8 of 8

Thread: [RESOLVED] Invalid use of Property

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2012
    Posts
    47

    Resolved [RESOLVED] Invalid use of Property

    guys why do i always get this error (Invalid use of property) in this code?

    <code>
    ctrl1.SetTransferMethod ("TCP")
    </code>

    thanks guys!

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,143

    Re: Invalid use of Property

    what is your ctrl1?

  3. #3
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Invalid use of Property

    I have no idea what ctrl1 is supposed to be but I can tell you that is not how you assign a property in VB
    To assign "TCP" to a property it would be coded like
    Code:
    ctrl1.SetTransferMethod ="TCP"
    using () implies that you are callign a function that will be returning a value or a sub routine us the Call method

  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2012
    Posts
    47

    Re: Invalid use of Property

    well ctrl1 is an activeX control Im trying to use to access an IP Camera. I've tried what you said Data but it throws an error "Argument not optional" ?

  5. #5
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,143

    Re: Invalid use of Property

    Did you create the "SetTransferMethod" as a property for your control, or is in an intrinsic method of it? All my searches for that term turn up zip. if it's a method, what is the type argument required. But, your first post seemed to indicate that you created a property for your control, hence would have given you that first type error. Can you show more code, and describe what ctrl1 is?

    PS. Just before you start typing "TCP" right after you type the parenthesis after ...method, what does it prompt you for for the type argument? A string, like you typed, or some other type?
    Last edited by SamOscarBrown; Oct 17th, 2012 at 09:26 PM.

  6. #6

    Thread Starter
    Member
    Join Date
    Jun 2012
    Posts
    47

    Re: Invalid use of Property

    ahm it is name for the control Im trying to use. the control is part of an SDK. I don't yet have much codes coz I'm just about to start it and when I do i got this error. Let me illustrate a part of the SDK describing "SetTransferMethod".

    "SetTransferMethod = To set the transfer method. Parameter is transfer method. Remarks: Transfer Method=[ TCP | UDP ]."

    P.S. It is expecting a string like SetTransferMethod(TransferMethod as String) as Long.
    Last edited by dexjel140503; Oct 17th, 2012 at 09:50 PM.

  7. #7
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Invalid use of Property

    So that would be something like
    Code:
    Dim ReturnVal as Long
    
    ReturnVal=ControlName.SetTransferMethod("TCP")

  8. #8

    Thread Starter
    Member
    Join Date
    Jun 2012
    Posts
    47

    Re: Invalid use of Property

    oh that'd do the trick. thanks DataMiser!

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