Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

how to implement winsock

RIGHT_THENRIGHT_THEN Posts: 154Member
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.


Comments

  • infidelinfidel Posts: 2,900Member
    : 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".


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

  • RIGHT_THENRIGHT_THEN Posts: 154Member
    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//******



Sign In or Register to comment.