472,373 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,373 software developers and data experts.

How to set a Property as a Default Property in COM Wrappers(CCW's)

Hi to All,

I am creating COM Wrappers(CCW's) to the existing .Net Product, which is developed using C#. In this, am getting problem with setting "Item" propertty as the Default Property. My requirement is like this:

I created 4 classess in CCW namely: PdfDocument, PdfForm,PdfFormField and PdfFormFieldList. to the respective .Net classess. Below, am giving the classess in brief. I configured my project for COM Interop .

************************************************** ************************************************** *************************************
PdfDocument:

public class PdfDocument
public readonly property Form() as PdfForm
get
''''''' code for returning PdfForm type
end get
end propety
end class

PdfForm:

public class PdfForm
public readonly property Fields() as PdfFormFieldList
get
''''''' code for returning PdfFormFieldList Type
end get
end property
end class

PdfFormFieldList

public class PdfFormFieldList
default public readonly property Item(byval pdfformfiled as PdfFormField) as PdfFormField
get
''''' code for returning PdfFormField type
end get
end property
end class
************************************************** ************************************************** *************************************

Using the above 4 classes, I want the behavior like below in classic ASP.

Code in classic ASP:

dim doc
set doc = server.createobject("DynamicPDF.PdfDocument")
''''' Instead of calling: doc.Form.Fields.Item(("name of the Pdfformfield")
response.write(doc.Form.Fields("name of the Pdfformfield")

Same code in VB6

dim doc as new PdfDocument
''''' Instead of calling: doc.Form.Fields.Item(("name of the Pdfformfield")
msgbox(doc.Form.Fields(("name of the Pdfformfield")


In Vb6, "Item" porperty is working fine. But, it is not working in classic ASP as a Default Property.In ASP, it is working fine only when I code like: doc.Form.Fields.Item(("name of the Pdfformfield")

In the above, if "Item" property wihtout any parameters, it is working fine in Classic ASP, but , if it is with parameters , it is not working in Classic ASP. In Vb6, it is working fine irrespective of parameters.

I need your help in this regard.
May 24 '07 #1
1 1743
Hi to All,

I am creating COM Wrappers(CCW's) to the existing .Net Product, which is developed using C#. In this, am getting problem with setting "Item" propertty as the Default Property. My requirement is like this:

I created 4 classess in CCW namely: PdfDocument, PdfForm,PdfFormField and PdfFormFieldList. to the respective .Net classess. Below, am giving the classess in brief. I configured my project for COM Interop .

************************************************** ************************************************** *************************************
PdfDocument:

public class PdfDocument
public readonly property Form() as PdfForm
get
''''''' code for returning PdfForm type
end get
end propety
end class

PdfForm:

public class PdfForm
public readonly property Fields() as PdfFormFieldList
get
''''''' code for returning PdfFormFieldList Type
end get
end property
end class

PdfFormFieldList

public class PdfFormFieldList
default public readonly property Item(byval pdfformfiled as PdfFormField) as PdfFormField
get
''''' code for returning PdfFormField type
end get
end property
end class

PdfFormField:

public class PdfFormField
public function CreateLabel(parameterlist) as Label
'''''''''''''' code
end function
end class

** Label is another Type
************************************************** ************************************************** *************************************

Using the above 4 classes, I want the behavior like below in classic ASP.

Code in classic ASP:

dim doc
set doc = server.createobject("DynamicPDF.PdfDocument")
''''' Instead of calling: doc.Form.Fields.Item(("name of the Pdfformfield").CreateLabel(parameterlist)
response.write(doc.Form.Fields("name of the Pdfformfield").CreateLabel(parameterlist))


Same code in VB6

dim doc as new PdfDocument
''''' Instead of calling: doc.Form.Fields.Item(("name of the Pdfformfield")
msgbox(doc.Form.Fields(("name of the Pdfformfield")..CreateLabel(parameterlist))


In Vb6, "Item" porperty is working fine. But, it is not working in classic ASP as a Default Property.In ASP, it is working fine only when I code like: doc.Form.Fields.Item(("name of the Pdfformfield")

In the above, if "Item" property wihtout any parameters, it is working fine in Classic ASP, but , if it is with parameters , it is not working in Classic ASP. In Vb6, it is working fine irrespective of parameters.

I need your help in this regard.
May 24 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Varun Singal | last post by:
Hi I am calling .NET components from my Classical ASPs. For this I strong named my assemblies, then registered them in the resistry ( using RegAsm), and put them in GAC (using GacUtil) ....
1
by: nsyforce | last post by:
Is it possible to overload a constructor for a ccw? If so, how do you call it from vbscript/vb? Is there any article out there on this topic? Thanks in advance
9
by: gulu man | last post by:
Hi, What is the substitute for COM objects in .NET? How can I create something similar to com in .net? Is it still possible? Thank you
3
by: equip200 | last post by:
I have a third party program that has the ability to control my program trough ActiveX/COM. My program is built in c#? What would I need to do to have the third party program connect to my...
3
by: Miguel.Herrera | last post by:
I like to create an assembly with a property exposed in COM as bindable. I have tried to use attribute but when I check the typelib produced by regasm for my assembly the property does not have...
2
by: nigel.stephens | last post by:
nigel.stephens@parasolit.­co.uk Nov 24, 10:04 am show options Newsgroups: microsoft.public.dotnet.framework.interop From: "nigel.steph...@parasolit.co.uk" <nigel.steph...@parasolit.co.uk> -...
0
by: tsmith | last post by:
Hi Can somebody help me, please! I'm trying to use a third-party .NET forms control in an unmanaged COM-aware application (MFC). I have no problem doing this with normal .net controls, as...
3
by: clintonG | last post by:
In the early 1990s there were quite a few Interactive Voice Response (IVR) SDKs that used VB for development. What happened to this category. Its like vanished. Does anybody know how IVR...
1
by: murtyin | last post by:
Hi All, I am creating CCW for a .Net Product. The .Net Product is developed using C# and in that Item Property is implemented as Indexers(This Item property will act as a default property for...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.