473,749 Members | 2,626 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I detect if a class is included more than once ?


Here is the problem, I am working with a bunch of old code so I can
really restructure the includes, otherwise I guess I could change all
the #include statements to #include-once.

Anyway, If I have a file with a class like this:

Class myClass
end class

I get a "name redefined" error. I've been seeing these and indeed from
goolge searches, it's because the file is somehow included more than
once. This problem doesn't occur for functions and the old code bases
just used functions whereas I would like to add some classes.

In C you used to be able to detect that at the top of the file and not
included the rest of the file
if it is allready included. I just want to at least detect it so I
don't redeclare the class ...

Thanks, I'm new to ASP, but I have som,e books ...

Oct 10 '07 #1
1 1910
"wb*******@yaho o.com" wrote:
I get a "name redefined" error. I've been seeing these and indeed
from goolge searches, it's because the file is somehow included
more than once. This problem doesn't occur for functions and the
old code bases just used functions whereas I would like to add
some classes.

In C you used to be able to detect that at the top of the file and
not included the rest of the file if it is allready included. I
just want to at least detect it so I don't redeclare the class
...
I don't see any way to do this in ASP. The parser gathers all of the
#include files and assembles the script before evaluating a single line of
(VB|J)Script.
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.

Oct 10 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
20464
by: Scott Shaw | last post by:
Hi all, I was wondering if you could help out with this problem that I am having. What I am trying to do is detect keyboard input in a while loop without halting/pausing the loop until the key is pressed (without hitting return). I looked at serveral faq's on the net and installed the cspan readkey module and neither seems to work most likey its me since I am getting frustrated. but anyway here's a sample code. while (1) { if...
6
4016
by: Stephane Belzile | last post by:
Is there a way I can detect in vb.Net the power has switched to a UPS unit in case of power failure? Thanks
3
1828
by: Richard Thornley | last post by:
Hello, I was just been given a project and I have some questions on how to accomplish the first part of the task. If a user sends an email to a specific email address I need to detect that
1
5399
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved completely/succsessfully on the client's computer before updating some metadata on the server (file downloaded date for instance) However, All examples i have tried, and all examples I have found that other people says works - doesn't work for me :-(
2
7716
by: Brian Tkatch | last post by:
How do i detect a datagrid row change? Currently, i have a few datagrids that i keep in sync, refreshing from the database whenver a row changes. I would like to avoid CurrentCellChanged because changing a cell within the same row causes an uneccesary DB call. Also, when the row changed to is the "new" row, nothing should happen. I wrote some code, which indeed works, but would like to know if i am missing something more obvious.
13
1976
by: Allen | last post by:
I defines FileLogConstant class as following. class FileLogConstant { public: static const INT32 REGISTER_LOGGER; static const INT32 REGISTER_METHOD; static const INT32 MAX_LOGGER_COUNT;
7
1763
by: The Cool Giraffe | last post by:
I have the following: //A.h class A {}; //B.h #include "A.h" class B : A {};
29
1673
by: RageARC | last post by:
I have the following code: index.php: class main_class { public $database = new DAL; public $html = new HTML; }
4
6474
by: raylopez99 | last post by:
Compound question: first, and this is not easy, if there's a way to detect multiple simultaneous key presses in C# let me know (in the below code, keys c and d being pressed simultaneously or nearly so). I researched this and for C# (as opposed to MFC) there is no library function, and no easy way, though some code on the net suggested that you set up a thread that 'lives' for a certain time, then, if keys are pressed in that certain...
0
8833
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8257
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6801
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.