..net can not directly access a com object. you either use the pinvoke
routines, or create a wrapper around the com object. VS will create the
wrapper if you add a reference of the com object to the project, else use
the commandline utility tlbimp.exe.
-- bruce (sqlwork.com)
"Plat" <Pl**@discussions.microsoft.com> wrote in message
news:5A**********************************@microsof t.com...
| Thanks for taking a stab at it!
|
| I understand how declaring my variable as the actual type would avoid
| late-binding errors, but instead I see a different error:
|
| error BC30002: Type 'CAppleBasket' is not defined.
|
| (And similar errors for attempts at "New FruitBasket.CAppleBasket", "New
| Interop.FruitBasket.CAppleBasket", etc).
|
| Keeping in mind that CAppleBasket is a COM object, what can I do to make
its
| type known to my ASP.NET application?
|
| Thanks again!
|
| "Patrick Steele [MVP]" wrote:
|
| > In article <BF**********************************@microsoft.co m>,
| >
Pl**@discussions.microsoft.com says...
| > > Now, let's look at a snippet of my (pretend) ASPX page!
| > >
| > > <%
| > > Dim oBasket as Object =
Server.CreateObject("FruitBasket.CAppleBasket")
| > > oBasket.setColor("red")
| > > %>
| > >
| > > If my @Page directive sets Strict="True", then I see compilation
errors like
| > > "error BC30574: Option Strict On disallows late binding".
| >
| > You've defined oBasket as type "Object". If you define it as type
| > "CAppleBasket", you shouldn't have the error.
| >
| > --
| > Patrick Steele
| > Microsoft .NET MVP
| >
http://weblogs.asp.net/psteele
| >