Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 1st, 2007, 12:01 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default Class Cannot be Pulic in This Type of Prj

When adding an existing .cls module to a new project, I was presented with a dialog saying:

    'cls<ClassName>' can not [sic] be public in this type of project.
    The item has been changed to private.

What is the meaning of this? (The dialog has a help button, but the VS help system is non-functional on my workstation.)

What [u]exactly</u> gets changed in the file holding the class I'm adding.

I had created this class in a WebClass project. That project still uses the class. Is the conversion of this class to private going to have a detrimental effect in my WebClass project? (It is used by the project internally; it is never exposed to the Internet Server processes—if that's even possible.)
 
Old May 1st, 2007, 12:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Standalone projects cannot exposes interfaces, this is why VB is complaining and wants to set that Class as Private.
The problem arises if that same class is used in other projects, like dll or other generic ActiveX components, that exposes that class as an interface.
Please let me know if you need more info

"There are two ways to write error-free programs. Only the third one works."
Unknown
 
Old May 1st, 2007, 03:42 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I suppose from what you wrote that being in a webclass project caused the class to fit the description “used in other projects, like dll.” But it does not seem that the class would be exposed as an interface from being in a WC prj.

Plus—now, with the file being changed to private—it is now private in both prjs.

Does that seem an accurate application of what you posted?
 
Old May 1st, 2007, 04:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

it depends.
does it need to be public in one project, and private in the other? that is the problem, otherwise it can be set to Private in both.

"There are two ways to write error-free programs. Only the third one works."
Unknown





Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about value class type saadli BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5 4 December 3rd, 2008 10:15 PM
Guidelines Item 3: Replace System.Type with Type Ixtlia BOOK: Professional .NET 2.0 Generics 0 August 19th, 2007 04:09 AM
deploying asp.net application using websetup prj shupiR ASP.NET 1.0 and 1.1 Basics 0 December 21st, 2005 08:12 AM
Shall i use ASP page and ASPX pages in in .net prj bvrao VS.NET 2002/2003 4 January 5th, 2004 04:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.