You need to implement all functions provided by the interface. The syntax of the function is in the way: INTERFACENAME_FunctionName
regards,
CJ
Main Topics
Browse All Topicshi-
i have an interface as follows (IWeatherManager.cls)
Option Explicit
Public Function GetWeather(strZipCode, strProxy) As Variant
End Function
I then have a class that implements it. (CWeatherManager.cls)
Option Explicit
Implements IWeatherManager
Public Function GetWeather(strZipCode, strProxy) As Variant
....
End Function
When i try to compile my dll I get an error message stating that CWeatherManager needs to implement IWeatherManager.GetWeather
If if goto the drop down menu it offers the method name as
Public Function IWeatherManager_GetWeather
If i then implement this then it compiles fine.
Why can't i just name this method GetWeather?
Thanks - u
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
ok, according to my book, that is correct.
i wrote this test program which works.
Option Explicit
Private Sub Form_Load()
Dim objWeatherManager As WeatherManager.CWeatherMan
Dim objIWeatherManager As WeatherManager.IWeatherMan
Set objWeatherManager = New WeatherManager.CWeatherMan
Set objIWeatherManager = objWeatherManager
Call objIWeatherManager.GetWeat
End Sub
however, i need this component to run from my asp page. but i get this error message.
Error Type:
Microsoft JScript runtime (0x800A01B6)
Object doesn't support this property or method
/admin/Weather.asp, line 36.
when i call the object directly rather than using the interface it works fine.
im not even sure where i should ask for help on this.
a code snippet is here.
var weatherManager;
var iWeatherManager;
var html;
var PROXY = "cf2.cinops.foo.com";
weatherManager = Server.CreateObject("Weath
iWeatherManager = Server.CreateObject("Weath
iWeatherManager = weatherManager
html = String(iWeatherManager.Get
Response.Write("Temp is " + html + " degrees");
break;
>iWeatherManager = Server.CreateObject("Weath
You should never need to instantiate your interface. It is an empty class. In fact it is hard to see the advantage of using an interface at all in this case as the scripting language does not allow the early binding that would make use of it.
In VB, you would do this
Dim oWeatherManager as IWeathermanager
Then you could assign that variable an instance of your cWeatherManager class and use all the interface functions. The advantage is that you can assign different classes to the same variable, but keep the speed of early binding by not declaring the variable as Object. In the scripting language the variables are not typed, thus every binding is late binding, and there is no advantage to using an interface class.
Yea, I see what you are saying Paul. I agree with everything you said. I never used to use interfaces for my web programming, but I just read "VB COM" and got a little excited.
So, I guess what I learned here is that I shouldn't use interfaces in this case. However, I am supposing this will be different when VB.Net comes out which I will be able to use in my ASPs then.
Thanks - u
Business Accounts
Answer for Membership
by: PaulHewsPosted on 2001-06-13 at 07:30:21ID: 6186569
That's just the way the syntax works. I guess it also allows us to distinguish between interface elements and non-interface elements of a class.