CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > migration_to_asp.net.migrating_from_asp_to_asp.net Tags:
Item Type: NewsGroup Date Entered: 9/5/2007 11:34:36 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 34 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
LowRider2112
Asp.Net User
Problems with DISPID_VALUE properties using managed wrapper9/5/2007 11:34:36 PM

0/0

Hello.

Problem:

I'm getting a C# compiler error on my .aspx web page:  CS0118: 'oMap' is a 'variable' but is used like a 'method'  I am using a managed .net wrapper generated by TLBIMP.EXE for one of our COM components.  As best as I can tell, the managed wrapper does not support properties in the COM IDL that have a dispatch id of 0 (using the DISPID_VALUE contant).

Code:

This is an example of the original JavaScript code that I am trying to convert:

var oMap = Server.CreateObject("util_Map");
oMap("key1") = "asdf";
oMap("key2") = "zxcv";
  

This is the C# migrated code on my .aspx web page that gets the compiler error:

util_Map oMap = new util_Map();
oMap("key1") = "asdf";  <-- CS0118: 'oMap' is a 'variable' but is used like a 'method'  
oMap("key2") = "zxcv";
 

The IDL of the COM object is defined as such for these properties:

 

interface util_IMap : IDispatch
{
   [
      propput, 
      id(DISPID_VALUE), 
      helpstring("Add a key, value pair to the map.")
   ]
   HRESULT Item([in] BSTR Key, [in] VARIANT Value);

   [
      propget,
      id(DISPID_VALUE),
      helpstring("Retrieve a key's value from the map.")
   ]
   HRESULT Item([in] BSTR Key, [out, retval] VARIANT *pValue);

....
 

HOW DO I MIGRATE THIS CODE?

I've tried various permutations of the original code like oMap("key1", "asdf") or even oMap.set_Item("key1") = "asdf", but they just give different compiler errors.  So, at this point, I can't use our legacy COM object with the managed wrapper.

Ideas?

 

Zhao Ji Ma - MS
Asp.Net User
Re: Problems with DISPID_VALUE properties using managed wrapper9/10/2007 8:49:03 AM

0/0

Hi LowRider2112.

The type library conversion process transforms property accessor methods in the following ways:

  • Properties with the [propget] attribute become managed properties of the same type, with a corresponding method called get_propertyname.

  • Properties with either the [propput] attribute or [propputref] attribute become managed properties of the same type, with a corresponding method called set_propertyname.

 For additional information about type library conversion, click the following article to view the article in the MSDN:

http://msdn2.microsoft.com/en-us/library/k639e386.aspx


Zhao Ji Ma
Sincerely,
Microsoft Online Community Support

?Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ?
LowRider2112
Asp.Net User
Re: Problems with DISPID_VALUE properties using managed wrapper1/4/2008 12:15:12 AM

0/0

Actually, all I had to do is use square brackets in C# instead of ().

For more information, please review this post:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2107752&SiteID=1

 

3 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Problems with DISPID_VALUE properties using managed wrapper - ASP ... Problems with DISPID_VALUE properties using managed wrapper. Last post 01-03- 2008 7:15 PM by LowRider2112. 2 replies. Sort Posts: ...
MSDN Common Language Runtime TLBIMP.EXE doesn't support ... DISPID_VALUE marks the property as the default property of the COM interface. ... Problem Summary:. Using TLBIMP.EXE to create a managed class wrapper for ...
DNN Gets some good press!!! - ng.asp-net-forum.dotnetnuke - Web ... problems with dispid_value properties using managed wrapper · enterprise templates · is non-enabled sufficient for a captcha protected createuserwizard? ...
CodeGuru: Automation and Eventing with Word Using Visual Studio 6.0, you won't really need to look at these wrapper thanks to the .... so you can use DISPID_VALUE in your call to InvokeHelper. ...
CodeProject: Understanding Classic COM Interoperability With .NET ... The Item property is assigned a DISPID of DISPID_VALUE (0) to indicate that this is the default ...... General, Problem using C# properties syntax, member ...
CodeProject: Understanding Classic COM Interoperability With .NET ... NET managed objects can be late bound and loaded using Reflection. ..... The Item property is assigned a DISPID of DISPID_VALUE (0) to indicate that this is ...
More Automation In Delphi Session by Brian Long The wrapper components are not present in the type library import unit being managed by the server, but can be added in by an explicit import operation. ...
VisualWorks using 6-22. standard object properties 13-4. standard objects 13-2. standards 13 -1. starting a deployed image manually 15-5. structure wrapper classes 4-20 ...
6 Konzeption einer Middleware für Optimierungssoftware Wrapper für die jeweiligen LIB-Versionen berücksichtigt werden, ...... Name einer als Default gekennzeichneten Eigenschaft (DISPID_VALUE) weggelassen wer- ...




Search This Site:










the installer was interrupted before xx

help!!

free forums

trying to use sql 2005 for security

customize a createuserwizard

customizing sitemaps

problem with login mangement

how to get rid of so many warning messages?

connecting to mysql database?

root arrows

iis and asp.net

active directory q help !! 2 weeks and nothing

clientid problem. could someone, please, help me?

weird javascript runtime error from .net code

the http verb post used to access path '/website11/htmlpage.htm' is not allowed.]

unable to start debugging

re: title in skins

alternate links module

error with a specific page name (

context.user.isinrole does not work

adekosis world

error

specifying rows

finding values in databinding

from datareader to dataset

where do i begin

enter key

autgenerate class properties from variables

can not authenticate when domain transfer - authenticate ok when entering website directly

bug: new tabs appear out of order in tab manager

 
All Times Are GMT