-
Oct 15th, 2012, 03:50 AM
#1
Thread Starter
Member
[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!
-
Oct 15th, 2012, 05:57 AM
#2
Re: Invalid use of Property
-
Oct 15th, 2012, 09:01 AM
#3
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
-
Oct 17th, 2012, 07:41 PM
#4
Thread Starter
Member
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" ?
-
Oct 17th, 2012, 09:11 PM
#5
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.
-
Oct 17th, 2012, 09:32 PM
#6
Thread Starter
Member
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.
-
Oct 17th, 2012, 10:09 PM
#7
Re: Invalid use of Property
So that would be something like
Code:
Dim ReturnVal as Long
ReturnVal=ControlName.SetTransferMethod("TCP")
-
Oct 17th, 2012, 10:36 PM
#8
Thread Starter
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|