Solved

How to add new Data Types to a class module?

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now