How to assign an Instance of my own class to another? 
Author Message
 How to assign an Instance of my own class to another?

Hi, all:

I would like to assign  one of my own class to another in VB 5.0:

code//////////////////////////////////

    Dim obj1 As myClass
    Dim obj2 As myClass

    Set obj1 = New myClass
    Set obj2 = New myClass

    obj2 = obj1

end of code////////////////////

It can not pass compilation, error message says: " expected  "=" ".

Actually, another case I have this " assignment problem" is when I tried to pass one object of myClass with a function.

I guess that I must to write something in the myClass defining such assignment, but I don't know how and could not fine any info in the VB 5.0's help.

Could anybody here give me a help?

Thanks a lot!

JAY



Thu, 17 May 2001 03:00:00 GMT  
 How to assign an Instance of my own class to another?

Dim obj1 As myClass
Dim obj2 As myClass

Set obj1 = New myClass
' Set obj2 = New myClass

set obj2 = obj1

HTH

Fei

    Hi, all:

    I would like to assign  one of my own class to another in VB 5.0:

    code//////////////////////////////////

        Dim obj1 As myClass
        Dim obj2 As myClass

        Set obj1 = New myClass
        Set obj2 = New myClass

        obj2 = obj1

    end of code////////////////////

    It can not pass compilation, error message says: " expected  "=" ".

    Actually, another case I have this " assignment problem" is when I tried to pass one object of myClass with a function.

    I guess that I must to write something in the myClass defining such assignment, but I don't know how and could not fine any info in the VB 5.0's help.

    Could anybody here give me a help?

    Thanks a lot!

    JAY



Thu, 17 May 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. instance of class module can't see own type

2. newbie: private class variables are visible in class instances

3. Find out if somebody make an instance of a Class without having access to the Class

4. nested class inherits containing class accessing private instance members

5. instance a class from its class name

6. .... ASSIGNING A OWN CREATED PRINTFORM IN NT TO A VB PRINT COMMAND

7. Draging picture from my own toolbar and creating new instance

8. My own Collection Class in Access97

9. DataGrid remove item error bind with own class inherit from collection

10. DataGrid remove item error bind with own class inherit from collection

11. Using a System Class in my own Assembly

12. Adding classes to my own project

 

 
Powered by phpBB® Forum Software