Enum Question

D

Douglas

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
 
B

Bob Barrows

Douglas said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,146
Messages
2,570,832
Members
47,374
Latest member
anuragag27

Latest Threads

Top