Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to add new Data Types to a class module?

Posted on 2004-10-18
3
Medium Priority
?
277 Views
Last Modified: 2008-03-17
Hello,

In VB6, I am trying to create with the Class Builder a class module to store all my initialization variables. Ultimately, the class will be imported in an (ESRI) ArcMap VBA  module. The generic ESRI objects are stored in ESRI ArcMap Object Library. So, when I create a new VB project, I make sure that this library is referenced . Then I proceed with creating the class itself in Class Builder. However, the only return Data Types I see are the basic ones - Byte, Boolean, Integer, String, Variant, etc., - that is I don't see any of the typical ArcMap objects, like IFeatureClass etc.

My question is - if I create a property, do I have to set it to Variant in order to cast it later to the ArcMap IFeatureClass type? Am I missing something? The alternative probably is to create the class directly in ArcMap VBA, but I'd rather use the Class Builder because it stubs all the properties and methods for me.

I realize that probably not many VB experts have experience with ArcMap but the question is valid for any VBA programming environment (Excel, Access, etc.)

Thank you for any ideas.
0
Comment
Question by:valboy
3 Comments
 
LVL 14

Accepted Solution

by:
Shiju Sasidharan earned 375 total points
ID: 12340798
hi
i am not familiar with ArcMap
u try this
create a small class with only properties that u need to include in ur user-defined data-type
and create an object of this class in the main class where u needed the Datatype
only difference is instead of using
'----------------------------
 Type  UserDefinedData
    'Variables....
 

 end Type  

'-----------------------
try to use the opjects of the created class

Shiju
0
 

Author Comment

by:valboy
ID: 12342722
Shiju,

Thank you for the advice. I did post on another forum, too, because I was pressed for time and the few answers there  gave me some ideas. For the complete thread see http://forums.devx.com/showthread.php?s=&postid=398160#post398160.

Valentina



0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question