Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 18013
Number of posts: 55386

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
how to implement winsock Posted by RIGHT_THEN on 27 Jul 2005 at 8:42 AM
implements winsock

gives an error that there is something with underscore in it
as the documentation for implements also say that there should not be anything with the underscore starting its name.
_event18 and _pbrowse19 are the ones giving problem.they are hidden
so i checked in the object browser and yes they are there
so as a remedy i tried implementing all of them induvidually

implements {ievent18]
implements [ipbrowse19]
implements winsock

_event18 gets implemented but now _pbrowse19 has a property _remotehost
which is a problem .i cannot implement an induviduval property.how can i get around this problem of implementing a class which might have hidden interfaces.please overlook the syntax error idea is convyed here.
thanks a million in advance and rest after you reply.


Report
Re: how to implement winsock Posted by infidel on 27 Jul 2005 at 10:13 AM
: implements winsock
:
: gives an error that there is something with underscore in it
: as the documentation for implements also say that there should not be anything with the underscore starting its name.
: _event18 and _pbrowse19 are the ones giving problem.they are hidden
: so i checked in the object browser and yes they are there
: so as a remedy i tried implementing all of them induvidually
:
: implements {ievent18]
: implements [ipbrowse19]
: implements winsock
:
: _event18 gets implemented but now _pbrowse19 has a property _remotehost
: which is a problem .i cannot implement an induviduval property.how can i get around this problem of implementing a class which might have hidden interfaces.please overlook the syntax error idea is convyed here.
: thanks a million in advance and rest after you reply.

Simplest thing would be to just write a wrapper class rather than trying to use VB's broken polymorphism "features".


infidel

$ select * from users where clue > 0
no rows returned


Report
could you eleborate on wrapper sir? Posted by RIGHT_THEN on 28 Jul 2005 at 1:42 AM
thanks a billion for taking the time out sir

" Simplest thing would be to just write a wrapper class rather than trying to use VB's broken polymorphism "features"."

what do you mean by wrapper sir?

here i am quoting an example where i make two classes
result3 and result2
result2 class implements result3 class
what i wanted to do here was that in result3 class
there is no "Let TheIncreasedValue" to the corresponding
"Get TheIncreasedValue".i thought by implementing result3 in result2
can i create "LET TheIncreasedValue" in result2 for result3.would it work? yes it did.

what can we do with this is that now no class should pose limitation if it does not provide corresponding lets for the gets we can create them
ourselves.by implementing them in our new class.so i thought the restrictions of read only property are over because i can make a corresponding let for any get or vice-versa.

because get only lets you read some thing and let lets you apply a value to the property.i could get around this problem in the below mentioned demostration example.

same thing i wanted to apply to winsock. because it does not let you
set your own ip address.it is a read only property which means it must be a get.without any corresponing let.i thought buy applying this implementation formula i could make myself a let for localip.with which
i might be able to misguide somebody trying to hook on to my computer or trying to read from it.similarly local host name can be changed random wise.this was the idea behind it to try to make already made classes more useful for myself.i dont know if it would have worked the way i wanted it to if at all it was implemented.but making gets and lets would have been successful.because sme limitation might appear in other classes i might work on.

i am trying at vb not an expert on it so i dont know what a wrapper is
could you qoute a little example please just to give an idea to me that
how can i implement a class with hidden interface.


thanks a trillion this time sir.


please dont try to burn your brain with irritation of this example
if it appears cumborsome what it does and how it does has been told above.it is only for reference.

'*******starting***to***make****result3**class***

Private IncreasedValue

Public Function IncreaseValueByHundered(value As Variant)

value = value + 100
IncreasedValue = value 'filling value in a variable of
'module scope

IncreaseValueByHundered = value 'function now can return the
'increased value
End Function

Public Property Get TheIncreasedValue() As Variant

TheIncreasedValue = IncreasedValue 'now value can be retrieved
'from get which is being
'given through the above
'mentioned module scope
'varible IncreasedValue

End Property


'**////*finsished*//*making*//*result3*////*class**///**

'???????????????????????????///////???????????
'?????????????????????????????????????????????

'**///***starting*//*to*///**make*//*result2*\\*class**\\\\*now*\\*

Implements result3
Private ObjectForResult3 As New result3

Private sendvalue1 As Variant
Public Property Let start_result2(value As Variant)

Set ObjectForResult3 = New result3
ObjectForResult3.IncreaseValueByHundered (value)

End Property

'start result3 intializing in result2*****

Public Property Get result3_TheIncreasedValue()
result3_TheIncreasedValue = _
ObjectForResult3.TheIncreasedValue
End Property

Public Function result3_IncreaseValueByHundered(value As Variant)
result3_IncreaseValueByHundered = _
ObjectForResult3.IncreaseValueByHundered(value)
End Function

Public Property Let result3_TheIncreasedValue(value As Variant)

ObjectForResult3.IncreaseValueByHundered (10)'sending the value to
'increase.
'result should be 110

MsgBox (ObjectForResult3.TheIncreasedValue & _
"succesfully retrieved changed value from _
Get TheIncreasedValue of result3 class by _
applying let TheIncreasedValue from result2 class")

End Property
'*****/end////making////result 3//class//******






 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.