using a .Net Control as activex control in VCL form

Hi ,

We have a to integrate a simple .Dot CSharp control which needs to be integrated into bcb2010  VCL form as a control. We will place the control on the VCL form along with other VCL controls's. 

I tried creating a simple .net control using a lable+textbox and trying to use in vcl form. I have made the assembly comvisible and generated tlb files and .bpl for the component. I could see the component in "ActiveX" tool palette. But when I drag the object onto VCL form and try to access its attributes I run into problems. I am not able to see .net control on the vcl at runtime.

I am not sure that is that I am missing. I have no clue. Could any one please tell me how to make this happen?

regards
srinivas
0
srinivas
2/9/2011 6:39:00 AM
embarcadero.cppbuilder.activex 257 articles. 0 followers. Follow

6 Replies
1679 Views

Similar Articles

[PageSpeed] 11

Hello,

srinivas revanur wrote:

> I tried creating a simple .net control using a lable+textbox and
> trying to use in vcl form. I have made the assembly comvisible and
> generated tlb files and .bpl for the component. I could see the
> component in "ActiveX" tool palette. But when I drag the object onto
> VCL form and try to access its attributes I run into problems. I am
> not able to see .net control on the vcl at runtime.

could you be more clear about the problems you're running into?

I just tried importing the WinForms 2.0 object library (using Delphi),
and apart from a few naming problems I could use the WinForms
components just fine, both at compile time and at runtime.

-- 
"Hey, it compiles! Ship it!"
0
Moritz
2/9/2011 3:37:28 PM
<srinivas revanur> wrote in message news:325716@forums.embarcadero.com...

> But when I drag the object onto VCL form and try to
> access its attributes I run into problems.

Such as?  Please be more specific.

-- 
Remy Lebeau (TeamB)
0
Remy
2/9/2011 5:33:33 PM
> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> <srinivas revanur> wrote in message news:325716@forums.embarcadero.com...
> 
> > But when I drag the object onto VCL form and try to
> > access its attributes I run into problems.
> 
> Such as?  Please be more specific.
> 
> -- 
> Remy Lebeau (TeamB)

I am not able to see the methods which I have exposed. Also I am not able to see the component at runtime on the form. I don't know how can create a activex control dynamically and place it on the form so that it is visible at runtime and I should be able to change the position on the form.

The same .net component is running on a MFC DIALOG application. I could see the .net text box at runtime and I could even the type the text and the MFC dialog receives the events from .Net.  I need to do same in C++ builder.

Help is really required.
0
srinivas
2/10/2011 4:26:09 AM
Srinivas

I have sent you details in the support case that was logged, regarding this it is relatively easy to get it working and I have it working in both CB2010 and CBXE. Have received those details?

brgds

Roy. 

> {quote:title=srinivas revanur wrote:}{quote}
> > {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> > <srinivas revanur> wrote in message news:325716@forums.embarcadero.com...
> > 
> > > But when I drag the object onto VCL form and try to
> > > access its attributes I run into problems.
> > 
> > Such as?  Please be more specific.
> > 
> > -- 
> > Remy Lebeau (TeamB)
> 
> I am not able to see the methods which I have exposed. Also I am not able to see the component at runtime on the form. I don't know how can create a activex control dynamically and place it on the form so that it is visible at runtime and I should be able to change the position on the form.
> 
> The same .net component is running on a MFC DIALOG application. I could see the .net text box at runtime and I could even the type the text and the MFC dialog receives the events from .Net.  I need to do same in C++ builder.
> 
> Help is really required.
0
Ray
2/16/2011 10:30:28 AM
> {quote:title=Ray Vecchio wrote:}{quote}
> Srinivas
> 
> I have sent you details in the support case that was logged, regarding this it is relatively easy to get it working and I have it working in both CB2010 and CBXE. Have received those details?
> 
> brgds
> 
> Roy. 
> 
> > {quote:title=srinivas revanur wrote:}{quote}
> > > {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> > > <srinivas revanur> wrote in message news:325716@forums.embarcadero.com...
> > > 
> > > > But when I drag the object onto VCL form and try to
> > > > access its attributes I run into problems.
> > > 
> > > Such as?  Please be more specific.
> > > 
> > > -- 
> > > Remy Lebeau (TeamB)
> > 
> > I am not able to see the methods which I have exposed. Also I am not able to see the component at runtime on the form. I don't know how can create a activex control dynamically and place it on the form so that it is visible at runtime and I should be able to change the position on the form.
> > 
> > The same .net component is running on a MFC DIALOG application. I could see the .net text box at runtime and I could even the type the text and the MFC dialog receives the events from .Net.  I need to do same in C++ builder.
> > 
> > Help is really required.


Hi,
 Thanks for the hint and now I am able to use the .net UI control in VCL.  I am also able to invoke methods on the .net control.
 Now I have another issue. I am trying to handle the events in C++ builder which are raised from .Net control. This is not working. I have put a message in the routine in c++, but it is not invoked from .Net.
Let me explain here...with code snippet from .net component,  vcl wrappers, and my client code,


CSHARP .net component

namespace ap2008
{
    [ComVisible(true)]
    [Guid("8C629BD8-6DE3-4d0b-BF9A-72F32C593FB3")]
    [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
    public interface IMyEvents
    {
        [DispId(1)]
        void zoomed(string sname); 
    }
    public delegate void ZoomedDelegate();

    [ComVisible(true)]
    [Guid("01F4CC21-E3BB-4fba-A066-A00008C6AE92")]
    [ClassInterface(ClassInterfaceType.None)]
    [ComSourceInterfaces(typeof(IMyEvents))]
    public partial class ap2008 : UserControl, ..
    {

        public event ZoomedDelegate zoomDelegate;
	..
	public my func(){
	..
	ZoomeDelegate("test");
	
	}
.....

at C++ builder 2010 side generated files has the below code,

typedef void __fastcall (__closure * Tap2008_Zoomed)(System::TObject * Sender, 
                                                           BSTR rname/*[in]*/);


__property Tap2008_Zoomed OnZoomed={ read=FOnZoomed, write=FOnZoomed };


In my client code,

unit1.h ->
	void __fastcall Zoomed(	TObject * Sender,				   BSTR rname);

unit1.cpp->

void __fastcall TForm1::FormShow(TObject *Sender)
{

		gmap2008_1->OnZoomed = this->Zoomed;

}
void __fastcall TForm1::Zoomed(TObject* Sender, BSTR rname)
{
		ShowMessage("event from .Net"); /// ..............>>>>>>>>>>>>> I EXPECT THIS MSG should be shown.
}
//---------------------------------------------------------------------------


I tried with another example with MFC activex control and c++ builder client. even in that I have faced the same problem. what is missing here???
0
srinivas
4/18/2011 2:48:06 PM
> {quote:title=Ray Vecchio wrote:}{quote}
> Srinivas
> 
> I have sent you details in the support case that was logged, regarding this it is relatively easy to get it working and I have it working in both CB2010 and CBXE. Have received those details?
> 
> brgds
> 
> Roy. 
> 

Could someone post a link to this support case or post details on how to get this working? Thanks!


Tony
0
Tony
7/7/2011 7:19:01 AM
Reply:

Similar Artilces:

How to use method activeX control in PB (Newbie using ActiveX)
Hi all, This is the first time I'm using activeX in my application, does anyone can helpme with these problem. How to use method in activeX because I've got example that come with the ocx file only with VB6 and I don't know how to used it with PB7. ------------ Call ActiveX_name.CopyTable(filename As String,Creator As String,SDDI_plugin_name As String, CreateFlag As Integer, VersionMajor As Integer, VersionMinor As Integer) ------------ THX -- ebr ...

What is the difference between Mozilla ActiveX Control and Microsft ActiveX Control pad?
I have these two files on my computer: MozillaControl1712.exe setuppad.exe (When I open this it says Microsoft ActiveX Control Pad) Which one do I need? mariav wrote: > I have these two files on my computer: MozillaControl1712.exe > setuppad.exe (When I open this it says Microsoft ActiveX Control Pad) > > > Which one do I need? > "Microsoft ActiveX Control Pad" - An Authoring tool , "Using the ActiveX Control Pad, you can easily author pages that include advanced layout and multimedia features such as exact object placement, object layer...

using activeX control in ASP.NET with visual studio.net 2003
I want to build a webservice with ASP.NET in visual Studio.net, but when I click on toolbox and try to add an item, the ActiveX component shows up in grey, which supposed to be unusable. For example, if I add an item "Calendar Control 11.0" from "COM conponents" list, it will shows up on the toolbox list, but shows in grey. Are there anybody encounter the same problem as mine? How do you deal with it? Thanks. Regards, Kevin ...

ActiveX control using Asp.Net
How can I develope a ActiveX control using Asp.Net? I tried to build a simple one. I developed a Windows User control. Then I used it on a web page/ html page. I was happy to see it working. But oops! I couldn't see the UI expected. What am I missing? Now I am also able to see the UI of Active X control. But a new problem... Now everything works fine if I run my web application using Visual Studio. But if I try to view the page directly using the browser from localhost/other machine in the LAN, I see only a cross mark like we see when a image is missing....

Using an ActiveX control in a web form
Hi, I'm currently using a 3rd party ActiveX control as part of an old VB6 application simply running the .ocx ActiveX client side without any problems. What I would like to do is use this .ocx ActiveX control in an ASP.NET web form. I am assuming that this cannot be run server side, and therefore would like to use it client side with the user downloading the control and executing it locally. However if this can be done server side then that is even better. I have placed the .ocx on the server and registered it, I am now looking for a way of using the control in a web page. When I...

Using ActiveX Controls in ASP.NET
Hello, I have an ActiveX control (written in VB6) which I want to use in an ASP.NET application.  I'm wondering if it is possible to have this control run entirely from the server (vs. downloading to the client machine). Thanks... ActiveX is client-side; ASP.NET is server-side.  If all the component does is logic, then you may want to rewrite it in .NET, or port the VB6 code over to VB.NET. The component actually uses a microsoft chart component and charts results from a bunch of queries.  Is there a way to port it to .net in such a way as to be able to use it on a web...

Using ActiveX controls with modeless forms
Hi, I am trying to use an ActiveX control in a PowerBuilder 7.0.2 application, the control is placed on a main! window. When I run the application, the ActiveX control gives the error: "Non-modal forms cannot be displayed in this host application from an ActiveX DLL, ActiveX Control or Property Page." Does anyone know how I can make PowerBuilder use an ActiveX control that has modeless forms? Thanks in advance, Chris -- Chris Smith Work: chris.smith@avenue-legal.co.uk Home: cjs94@zepler.org.uk ...

Using an ActiveX control on an ASP.NET webform
I am trying to run Catalyst's File Transfer ActiveX control on an ASP.NET webform. I know little about ActiveX and am still new to ASP.NET. Any help is appreciated. I am developing using MS Visual Studio 2003, and working in C# I began by adding the FTP COM component to the toolbox and then dragging it onto my aspx page. I then used the lpk tool to generate a lpk file and added the appropriate object tag at the top of the page. I then added a client-side button to the page as such: <input type="button" value="Download" onclick="DownloadFiles()...

Using ActiveX control in ASP.Net 2003.
What I did is-1)Opened a new project for creating class library in VB.Net of name FindFile2)In that taken a user control of name ConfigFile. In the design view I added one button and one text box. Then I written my code for some calculations on button click event and displayed result in that textbox.3) then I added it in my existing project as- <BODY>        <OBJECT id="myControl1" name="myControl1" classid="FindFile.dll#"FindFile.ConfigFile"                  width=288 height=72>      </OBJECT...

Problem when use ActiveX control on ASP.NET page
I wrote an activeX control in C#, which internally uses another activeX control from third party. I used my activeX control in an ASP.NET page as follows: document.write('<object id=\"MyControl\" name=\"MyControl\" width=\"288\" height=\"72\" classid=\"\\MyControl.dll#MyControl\" VIEWASTEXT>'); document.write('</object>'); The problem is: 1. If I comment out the usage of the third party activex control, everything works fine. But if I tried to access any thing from that third party act...

What control do I use (or do I not use a control at all...)
Okay so here's the story so far. I am making a blog to be incorporated into a website. Well, I'm doing the blog from scratch. I'm using MySQL to source all the data via MySQL .NET/Connector. Now while developing the script, I used DataReader and Response.Write to show the blog topics. Now that it has come to put it under a design (I'm using a Master Page for that), I've hit the problem. Response.Write shows all the topics before any of the design elements could be incorporated. So that (more or less) is out of question. So next I looked into the data presentation controls. I looked up GridVi...

to use activex control
Hi I want to use a third party activex control .in asp.net with c# web application .but it is not working by using OBJECT tag and the clsid . but it works in html page. Is their any other way to use it.........   When creating the virtual directory make sure that in the properties you set it to Scripts Only, Not scripts and exec. Also make sure if you control doesn't show at all that you have the path correct to the control in the provided HTML file, the path has to match in order for it to work.  Also clear the GAC sometimes because it can all get bogged down. Another iss...

Using activeX Controls..
Hi, Can anyone help me how to use ActiveX controls in a web page? I want to execute some application in the client side.. Can anyone procide me with some links, or any help..Dont forget to click "Mark as Answer" on the post that helped you.This credits the member,earns you a point & marks your thread as Resolved so that new users will know where to search for their queries. hi, Plz check these links, http://www.suite101.com/article.cfm/vb_script/79593 http://msdn.microsoft.com/en-us/library/ms537508.aspx   Plz mark as answer if you ahve got what you were looking ...

use ActiveX Control
How can I use an ActiveX Control? I would need it to display a special type of data. I tried using the <object> tag but against what is written on msdn, there is no attribute progid for this tag. ( I get an invalid attribute error in VS2005) How else can I use it?       Well that depends on how your distributing it. Did you make it yourself? Is it in a cab file? is it just a raw hot linked DLL? Little more to go one is helpful.Evan's BlogCodeundrum: Code that puzzles. nope it's commercial and a dll. But users who would potentially use the app...

Web resources about - using a .Net Control as activex control in VCL form - embarcadero.cppbuilder.activex

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Control Sphero’s awesome BB-8 droid with the upcoming Force Band
... with Spheros enormously fun BB-8 droid . And at CES 2016 in Las Vegas, the company announced that users will soon have another way to control ...

The Volkswagen Golf will get gesture controls
Filed under: 2016 CES , Volkswagen , Technology , Hatchback , Electric Want to see the new tech that's coming to Volkswagen models in the very ...

Larwyn’s Linx: A Thorough Fisking Of Obama’s Executive Orders On Gun Control
... install a Larwyn's Linx widget . Get real-time news, 24/7, at BadBlue . Nation A Thorough Fisking Of Obama’s Executive Orders On Gun Control ...

UK police forces are going to use drones to help them control protests and carry out sieges
UK police forces are going to start using drones to help them control protests, investigate burglaries and carry out sieges, according to The ...

Now You Can Use Siri to Control Your Shades
... their Caséta Wireless Smart Bridge, a smart home device that could be used with their range of on/off and dimmer switches to give people control ...

NRA Publication Tweets Bullets Directed At Lawmakers Supporting Gun Control
... Gabrielle Giffords, the NRA targeted a pair of Brooklyn lawmakers Monday with a menacing image of bullets next to photos of the two gun control ...

Armslist.com Responds To Obama’s Gun Control Initiative
"Today's action regarding background checks is well-meaning, but ultimately ineffective."

AT&T voice assistant helps you control your smart home
AT&amp;T's Digital Life home automation service is supposed to make your life easier, but it's been lagging a bit in the control department. ...

Indianapolis mom invited to White House for gun control announcement
WASHINGTON, D.C. (Jan. 5, 2016) - DeAndra Yates never intended to become an advocate for gun safety and gun violence victims. But the last two ...

Resources last updated: 1/6/2016 2:27:23 PM