I like to create an assembly with a property exposed in COM as
bindable. I have tried to use [Bindable(true)] attribute but when I
check the typelib produced by regasm for my assembly the property does
not have bindable on it.
Here is some code of what I mean:
[Bindable(true)]
public bool ActiveXDone
{
get
{
return _activeXDone;
}
set
{
_activeXDone = value;
}
}
when I use regasm to generate a typelib for my assembly I like to get
the following (note the bindable attribute):
[id(0x60020000), propget, bindable]
HRESULT ActiveXDone([out, retval] VARIANT_BOOL* pRetVal);
[id(0x60020000), propput, bindable]
HRESULT ActiveXDone([in] VARIANT_BOOL pRetVal);
but instead I get the following :
[id(0x60020000), propget]
HRESULT ActiveXDone([out, retval] VARIANT_BOOL* pRetVal);
[id(0x60020000), propput]
HRESULT ActiveXDone([in] VARIANT_BOOL pRetVal);
What am I doing wrong ? 3 3555
Hi Miguel!
The [Bindable] attribute is for managed design-time environment, as far as I
know it has no effect on COM-visible type libraries.
I have looked through all System.Runtime.InteropServices attributes and it
seems there is no suitable attribute at all :-(.
Re-posting your question in microsoft.public.dotnet.framework.interop might
give better results.
--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
<Mi************@visy.com.au> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com... I like to create an assembly with a property exposed in COM as bindable. I have tried to use [Bindable(true)] attribute but when I check the typelib produced by regasm for my assembly the property does not have bindable on it.
Here is some code of what I mean:
[Bindable(true)] public bool ActiveXDone { get { return _activeXDone; } set { _activeXDone = value; } }
when I use regasm to generate a typelib for my assembly I like to get the following (note the bindable attribute):
[id(0x60020000), propget, bindable] HRESULT ActiveXDone([out, retval] VARIANT_BOOL* pRetVal); [id(0x60020000), propput, bindable] HRESULT ActiveXDone([in] VARIANT_BOOL pRetVal);
but instead I get the following :
[id(0x60020000), propget] HRESULT ActiveXDone([out, retval] VARIANT_BOOL* pRetVal); [id(0x60020000), propput] HRESULT ActiveXDone([in] VARIANT_BOOL pRetVal);
What am I doing wrong ?
Miguel,
You might have to reverse engineer some of the generated code to do
this. Offhand, I would create the TLB file, and then use OLEVIEW to view
the IDL.
Then, I would copy and paste the IDL into a new file, and add the
bindable attribute to the idl in the appropriate places. Once that is done,
I would run that IDL file through MIDL, and create a type library. Once you
do that, you should be able to register that type library to create your
CCW's.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
<Mi************@visy.com.au> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com... I like to create an assembly with a property exposed in COM as bindable. I have tried to use [Bindable(true)] attribute but when I check the typelib produced by regasm for my assembly the property does not have bindable on it.
Here is some code of what I mean:
[Bindable(true)] public bool ActiveXDone { get { return _activeXDone; } set { _activeXDone = value; } }
when I use regasm to generate a typelib for my assembly I like to get the following (note the bindable attribute):
[id(0x60020000), propget, bindable] HRESULT ActiveXDone([out, retval] VARIANT_BOOL* pRetVal); [id(0x60020000), propput, bindable] HRESULT ActiveXDone([in] VARIANT_BOOL pRetVal);
but instead I get the following :
[id(0x60020000), propget] HRESULT ActiveXDone([out, retval] VARIANT_BOOL* pRetVal); [id(0x60020000), propput] HRESULT ActiveXDone([in] VARIANT_BOOL pRetVal);
What am I doing wrong ?
Nicholas,
I must say "live and learn" - I did not know before that one could create a
CCW from an already existing type library. Is there an example? What I
personally would try is creating a type library containing interfaces only,
then I'd run tlbimp.exe on it and create my [ComVisible] classes that
implement interfaces imported from the type library.
--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eJ**************@TK2MSFTNGP12.phx.gbl... Miguel,
You might have to reverse engineer some of the generated code to do this. Offhand, I would create the TLB file, and then use OLEVIEW to view the IDL.
Then, I would copy and paste the IDL into a new file, and add the bindable attribute to the idl in the appropriate places. Once that is done, I would run that IDL file through MIDL, and create a type library. Once you do that, you should be able to register that type library to create your CCW's.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
<Mi************@visy.com.au> wrote in message news:11*********************@g49g2000cwa.googlegro ups.com...I like to create an assembly with a property exposed in COM as bindable. I have tried to use [Bindable(true)] attribute but when I check the typelib produced by regasm for my assembly the property does not have bindable on it.
Here is some code of what I mean:
[Bindable(true)] public bool ActiveXDone { get { return _activeXDone; } set { _activeXDone = value; } }
when I use regasm to generate a typelib for my assembly I like to get the following (note the bindable attribute):
[id(0x60020000), propget, bindable] HRESULT ActiveXDone([out, retval] VARIANT_BOOL* pRetVal); [id(0x60020000), propput, bindable] HRESULT ActiveXDone([in] VARIANT_BOOL pRetVal);
but instead I get the following :
[id(0x60020000), propget] HRESULT ActiveXDone([out, retval] VARIANT_BOOL* pRetVal); [id(0x60020000), propput] HRESULT ActiveXDone([in] VARIANT_BOOL pRetVal);
What am I doing wrong ?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Tommy |
last post by:
I added a property to the asp.net textbox. It is set as bindable and i am
able to do so. When i go to read the property the value is not there.
Somehow it isn't persisted on the server. I tried...
|
by: Emil Georgiev |
last post by:
Hell
I have a Web Custom Control project in ASP.NET. I'm using a subclassing technique to add functionality in HyperLink web
server control. I want to create a property "BrowserWindow" of my...
|
by: Tommy |
last post by:
I have subclassed the textbox and added a property to it with the following
code:
'--------------------------------------------------------
Imports System.ComponentModel
Public Class clsTextBox...
|
by: Lance |
last post by:
I want to be able to reset a complex property in a PropertyGrid. I know that for properties that are ValueTypes you can include System.ComponentModel.DefaultValue in the declaration of the property....
|
by: Barry |
last post by:
A beginners question to someone that isn't a beginner ;) I've forgotton
a lot.
The code below isn't what I want to do but it demonstrates succinctly
my problem. I want to drop a "MyTextBox"...
|
by: Rolf Welskes |
last post by:
Hello,
I have writen a simple aspnet control MyCtrl and want to use it as follows:
(c01 may be the tag-prefix):
<c01:MyCtrl>this is a simple text</c01:MyCtrl>.
The control-code:
|
by: Andrew Hayes |
last post by:
Hi All,
I have a web user control (ASCX) that retrieves a set of records from a SQL
Server database.
What I'd like to do is choose a property of that control as a
ControlParameter for an...
|
by: tombow |
last post by:
I created a custom control (call it MyWidget) in a C# web control
library. MyWidget has a SqlDataSource property:
public abstract class MyWidget : WebControl
{
// .... snipped
private...
|
by: shapper |
last post by:
Hello,
I have a class where I created various controls.
One of the controls have a property which is a generic list of
WebControl.
Then in web site page I have something like:
Dim a As New...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |