🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.vcl.components.using.dotnet
3 messages
3 total messages Started by Jesse Calato Thu, 28 Sep 2006 20:51
calling vcl.net form from com client
#199
Author: Jesse Calato
Date: Thu, 28 Sep 2006 20:51
10 lines
1507 bytes
Hi I am trying to call a vcl .net form developed in delphi 2005 
from a com client developed in delphi 5.  I get an access 
violation when doing this.  I do the same thing with a WinForms 
form developed in Delphi 2005 and it works perfectly.  Any 
ideas why I might be getting the Access violation only with the 
VCL .net form?  I am the only developer in my company who knows 
WinForms and we would like to stick with VCL if possible, but 
we also need to be able to call new forms developed in .net 
from our existing win32 apps.  Thanks in advance for any help.
Re: calling vcl.net form from com client
#201
Author: Marc Rohloff TeamB
Date: Thu, 28 Sep 2006 22:25
17 lines
2006 bytes
On 28 Sep 2006 13:51:34 -0700, Jesse Calato wrote:

> Hi I am trying to call a vcl .net form developed in delphi 2005 
> from a com client developed in delphi 5.  I get an access 
> violation when doing this.  I do the same thing with a WinForms 
> form developed in Delphi 2005 and it works perfectly.  Any 
> ideas why I might be getting the Access violation only with the 
> VCL .net form?  I am the only developer in my company who knows 
> WinForms and we would like to stick with VCL if possible, but 
> we also need to be able to call new forms developed in .net 
> from our existing win32 apps.  Thanks in advance for any help.

Can you post a sample of code which doesn't work?

-- 
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com
Re: calling vcl.net form from com client
#202
Author: Jesse Calato
Date: Fri, 29 Sep 2006 12:45
53 lines
2129 bytes
>Can you post a sample of code which doesn't work?

Here is the Assembly code:

type
  [ComVisible(True), ClassInterface(ClassInterfaceType.AutoDual)]
  TDotNetObj = class
  private
    { Private Declarations }
  public
    constructor Create;
    function ShowWinForm: string;
    procedure ShowVCLForm;
  end;

implementation

uses WinForm, MyVCL;

constructor TDotNetObj.Create;
begin
  inherited Create;
  // TODO: Add any constructor code here
end;

procedure TDotNetObj.ShowVCLForm;
var
  a: TmyVCLForm;
begin
  a := TmyVCLForm.Create(nil);
  a.ShowModal;
end;

Here is the code in the COM Client:

procedure TForm1.Button2Click(Sender: TObject);
var
   fc: TDotNetObj;
begin
   fc := CoTDotNetObj.Create;
   fc.ShowVCLForm;
   fc.Free;
   fc := nil;
end;

CoTDotNetObj was defined by Delphi when I imported the type 
library generated by regasm.

The only ideas that I had were that I would need certain borland specific dlls registered with the OS in some way that 
the delphi install does not automatically do for me.

I appreciate any help.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads