473,508 Members | 2,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enum Question

Sorry for the re-post, ISP troubles grr...

anyways...

Gday All,

I am developing a DLL (using VB6) for use in an IIS5 ASP Application.

This DLL contains a series of 'Public Enum'(s)

During testing in VB6 these enums work fine, however when used in an ASP context I get the following Error Message:

Microsoft VBScript runtime error '800a01f4'
Variable is undefined: 'HeaderStyle'

However, if I substitute the Enum for its value (ie: HeaderStyle = 3) I get the expected functionality.

eg:

Address.Suburb(HeaderStyle)
returns the above error message.

Address.Suburb(3)
works fine.

Can someone please enlighten me as to HOW ASP handles ENUMs.

Thanks in advance,
Douglas
Jul 19 '05 #1
1 6869
Douglas wrote:
Sorry for the re-post, ISP troubles grr...

anyways...

Gday All,

I am developing a DLL (using VB6) for use in an IIS5 ASP Application.

This DLL contains a series of 'Public Enum'(s)

During testing in VB6 these enums work fine, however when used in an
ASP context I get the following Error Message:

Microsoft VBScript runtime error '800a01f4'
Variable is undefined: 'HeaderStyle'

However, if I substitute the Enum for its value (ie: HeaderStyle = 3)
I get the expected functionality.

eg:

Address.Suburb(HeaderStyle)
returns the above error message.
Why would you think this should work? The HeaderStyle constant has not been
defined in your vbscript code.
Address.Suburb(3)
works fine.
As it should.

Can someone please enlighten me as to HOW ASP handles ENUMs.

First of all, vbscript does not support enum's. Secondly, constants that are
declared in a dll are not automatically visible to the process that is
calling the dll.

To see one way of handling this issue take a look at:
C:\Program Files\Common Files\System\ADO\adovbs.inc

Another way is to create a type library (this is off topic for this list -
use Google to get information about doing this) and use a metadata tag to
reference it. This article provides an example of referencing a type
library:
http://www.aspfaq.com/show.asp?id=2112
HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #2

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

Similar topics

20
4786
by: Glenn Venzke | last post by:
I'm writing a class with a method that will accept 1 of 3 items listed in an enum. Is it possible to pass the item name without the enum name in your calling statement? EXAMPLE: public enum...
10
5764
by: James Brown | last post by:
I have the following enum declared: enum TOKEN { TOK_ID = 1000, TOK_NUMBER, TOK_STRING }; (it goes on and on like that) This is what I would like to do: TOKEN t1 = TOK_ID; // ok...
4
6467
by: Nikhil Patel | last post by:
Hi all, I am a VB6 programmer and learning C#. I am currently reading a chapter on types. I have question regarding enums. Why do we need to convert enum members to the value that they represent?...
5
2653
by: Andrea Williams | last post by:
I'm working with C# and I'm setting up some ENUM's I have a data and Business layer. I'm declaring a common enum for the Data Layer. The UI layer references the Bus layer and the bus layer...
6
2859
by: Michael Isaacs | last post by:
Regarding use of enum's, I am wondering what the cost of memory is when creating the enumeration on the calling side, and then using it on the function/method side. See example below. If I...
2
3390
by: Dennis | last post by:
I have an enum as follows: Public Enum myData FirstData = 6 SecondData = 7 end enum Is there anyway that I can return the Enum names by their value, i.e., I want to input 6 into a function...
13
12360
by: Don | last post by:
How do I get an Enum's type using only the Enum name? e.g. Dim enumType as System.Type Dim enumName as String = "MyEnum" enumType = ???(enumName)
3
3892
by: K. Wilder | last post by:
I need to declare a project level Enum that any procedure in any class can reference so there's continuity with the values. How do I do this? At present, if I declare a Module in a project and...
34
11132
by: Steven Nagy | last post by:
So I was needing some extra power from my enums and implemented the typesafe enum pattern. And it got me to thinking... why should I EVER use standard enums? There's now a nice little code...
4
1930
by: ice8595 | last post by:
Hi there, I'm fairly new at this, and I am having a bit of trouble wrapping my head around some concepts of enum for a project. So any help would be greatly appreciated. Essentially I'm...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7120
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...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7039
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...
1
5050
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...
0
4706
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...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1553
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 ...
0
415
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...

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.