Hi,
My problem is the following:
I create a very basic ActiveX control in Visual Basic 6 using the ActiveX control wizard. It has one method that simply displayes a message box. When I compile this to an .OCX file, it works correctly in Visual C++ or other Visual Basic projects. I can also use TSTCON32.EXE (AxtiveX test container) to test it and it works fine.
When I try to Import it into a Delphi 5 project it is also listed correctly as a registered control and I can add it to my Delphi project. The control is then placed on a new Form together with a simple command button. It the Command button's Click event I simply call the VB control's method and expect to see the message box pop up...
When the program is run, the following error message is displayed:
"Project Project1.exe raised exception class EAccessViolation with message 'Access violation at address66080E3B in module MSVBVM60.DLL. Read of address FFFFFFFF. Process stopped..."
This happens for any method call that I make to any control that I create with VB6.
I am sure that a simple control like this has to work in Delphi and that I am doing something stupid or am overlooking something...
Any help from the Delphi experts out there will be much appreciated!
Thanks!
NZMan
Here is my Delphi code. The VB test control is called SayWow.
*******************************************
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, OleCtrls, PRJSayWow_TLB;
type
TForm1 = class(TForm)
SayWow1: TSayWow;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
SayWow1.SayWow();
end;
end.
**************************************
My problem is the following:
I create a very basic ActiveX control in Visual Basic 6 using the ActiveX control wizard. It has one method that simply displayes a message box. When I compile this to an .OCX file, it works correctly in Visual C++ or other Visual Basic projects. I can also use TSTCON32.EXE (AxtiveX test container) to test it and it works fine.
When I try to Import it into a Delphi 5 project it is also listed correctly as a registered control and I can add it to my Delphi project. The control is then placed on a new Form together with a simple command button. It the Command button's Click event I simply call the VB control's method and expect to see the message box pop up...
When the program is run, the following error message is displayed:
"Project Project1.exe raised exception class EAccessViolation with message 'Access violation at address66080E3B in module MSVBVM60.DLL. Read of address FFFFFFFF. Process stopped..."
This happens for any method call that I make to any control that I create with VB6.
I am sure that a simple control like this has to work in Delphi and that I am doing something stupid or am overlooking something...
Any help from the Delphi experts out there will be much appreciated!
Thanks!
NZMan
Here is my Delphi code. The VB test control is called SayWow.
*******************************************
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, OleCtrls, PRJSayWow_TLB;
type
TForm1 = class(TForm)
SayWow1: TSayWow;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
SayWow1.SayWow();
end;
end.
**************************************