Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to add new Data Types to a class module?

Posted on 2004-10-18
3
270 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 125 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

789 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