-
Apr 2nd, 2004, 11:54 PM
#1
Thread Starter
Frenzied Member
How would i define a type in a class module?
Ihave added 2 class modules to my project from a working project, wel i get the error user-defined type not defined when compiling from my project but is fine fine from the working app.
So i obvioulsy have to define something somewhere, this is the code that causes the errors,
VB Code:
Public Property Get NewEnum() As IUnknown
err.Clear
On Error Resume Next
Set NewEnum = colSockets.[_NewEnum]
End Property
-
Apr 3rd, 2004, 11:40 AM
#2
Member
Re: How would i define a type in a class module?
Originally posted by Jmacp
So i obvioulsy have to define something somewhere, this is the code that causes the errors
Are you sure that is the code, I paste it into a new form and it causes no problems. What I think is happening is that you are using that stuff before it is defined, so check to see where you defined that, try moving it to the top of 1 module or the form. Goodluck
Good programming site:
*http://www.planet-source-code.com
Our CS Clan Page:
*http://h2p.inter-gamer.com/index.html
-
Apr 3rd, 2004, 12:25 PM
#3
Lively Member
Re: How would i define a type in a class module?
Originally posted by Jmacp
VB Code:
Public Property Get NewEnum() As IUnknown
err.Clear
On Error Resume Next
Set NewEnum = colSockets.[_NewEnum]
End Property
Uhhhh...?
Ok dude you may want to think about quitting using VB forever...
Yeah I know what it sounds like...but I'm not flaming ya, just stating you may be more comfortable coding in C# or something
The code I'm quoting looks very similar to C#
There is no good or evil only CODE! ~MedevH~
-
Apr 3rd, 2004, 12:32 PM
#4
Re: Re: How would i define a type in a class module?
Originally posted by MedevH
Uhhhh...?
Ok dude you may want to think about quitting using VB forever...
Yeah I know what it sounds like...but I'm not flaming ya, just stating you may be more comfortable coding in C# or something
The code I'm quoting looks very similar to C#
That's perfectly valid VB code. I use it all the time, to expose an enumerator for a For Each loop.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Apr 3rd, 2004, 12:52 PM
#5
Thread Starter
Frenzied Member
Resolved it, i had no reference to OLE automation set.
-
Apr 4th, 2004, 12:13 PM
#6
Frenzied Member
I think what Medevh means is it isn't everyday you find VB programmers having to use IUnknown, except for enumeraters and hacky shell extentions. C++ would make it much smother and vastly more complex... I think....
VB and COM Interfaces..... IDL..... pain in the butt......
Collections do kick @$$ though I remember reading and starting to use the house bricks as microsoft puts it, imporved my ability to do data operations and create biz objects almost as much as when I fell and hit my head and realized what an array was for.
Magiaus
If I helped give me some points.
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
|