Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / September 2007

Tip: Looking for answers? Try searching our database.

About how to user CodeClass2.AddFunctioin() and CodeClass2.AddProp

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shang Peixu - 29 Aug 2007 08:48 GMT
I encounter two very strange problems during I wrote programme recently, they
are all about the parameter of two Functions in CodeClass2.
The first is that when I invoke the CodeClass2.AddFunction and I will
firstly pass the Name of function to the method , the Name is a string, I
find that if the Name contains the char '.' (such as
SSystem.Collections.IComparer.Compare), then the method will throw and
ArgumentException which tells me that "the parameter is incorrect", now I am
very sure that the exception is fired by passing a Name containing '.' .

The second problem is very similar to the above one, when I invoke the
CodeClass2.AddProperty , I will firstly pass the Name of Property to the
method, the Name is also a string, I find that if the Name is "this" which
means that I am creating a indexer, the method will throw an
ArgumentException which is the same as the one during I invoke
CodeClass2.AddProperty().
Stevanich - 01 Sep 2007 05:30 GMT
Shang,

The name of a class or property does not include the namespace.  It is not
legal to have the following:

   Public Class Hello.World
   End Class

The CodeClass2 object has a property called Namespace, which can be used to
define the namespace of the class:
http://msdn2.microsoft.com/en-us/library/envdte80.codeclass2.namespace(VS.80).aspx

For the AddProperty method, try passing the class name as the property's
getter and setter name.  This bit is just a guess, I haven't tried it.

Hope this helps,

Steve - dotneticated.com

>I encounter two very strange problems during I wrote programme recently,
>they
[quoted text clipped - 13 lines]
> ArgumentException which is the same as the one during I invoke
> CodeClass2.AddProperty().

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.