Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ActiveX: How to implement an intern method in an ActiveX control.

Posted on 1997-10-07
6
Medium Priority
?
226 Views
Last Modified: 2010-04-04
I am writing ActiveX controls with Delphi3. I have no problems to use them in VB5 and to access their properties and events.

But when i call an intern method of an ActiveX - nothing happens.
VB5 shows me the name of the method (it is in the published section) - i only have to select it in the listbox, but when i run the program the code of the intern method is not executed.

Thank you very much for help.

DI Bernhard Angerer
Vienna University of Technology
0
Comment
Question by:angerer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 1

Expert Comment

by:miv
ID: 1346923
Please elaborate on that...
What exactly are you doing from Delphi ?
0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1346924
Is it a standard method that Delphi put there, or is it one of your own methods?  If it is one of your own methods, did you add it using Delphi's Type Library Editor?
0
 
LVL 1

Author Comment

by:angerer
ID: 1346925
ok ...

My Testcontrols looks like that:

----------------------
unit TestEdit;
interface
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TTestEdit = class(TEdit)
  private
  protected
  public
  published
    procedure InternMethod;
  end;

procedure Register;
implementation


procedure TTestEdit3.InternMethod;
begin
  Text := 'xxx';
end;


procedure Register;
begin
  RegisterComponents('TEST', [TTestEdit]);
end;

end.
----------------------

1.
I open a new ActiveX project. The code for the ActiveX and
a Type Libary is automatically created.

2.
In the Type Libary Editor i can see my procedure "InternMethod".
I press the button "Register"

3.
In VB5 i select the OCX via Project/Components

4.
I drop the control in an empty form. The name of the control
is "TestEditX1". That still works.

5.
In the code editor of vb i write

TestEditX1.

than the listbox with all the properties and methods appears.
I select "InternMethod". Than the hole line is

TestEditX1.InternMethod

6.
When i execute this line i get the message:

Run-time-error "438"
Object does not support this property method


I do not know what to do ?

Thanks for help !!!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:JimBob091197
ID: 1346926
This is very strange.  
It sounds to me like your OCX file and TLB file are out of synch.  Does your ActiveX Control unit (i.e. the one with "TTestEditX = class(TActiveXControl, ITestEditX)" at the top, not the TLB unit) have a method "procedure InternMethod; safecall;" in its protected section?

I have noticed that with ActiveX controls it is possible to get the ActiveX control unit out of synch with the TLP file by manually editing the ActiveX unit.  Have you checked that these 2 units have exactly the same methods?

JB
0
 
LVL 1

Accepted Solution

by:
lowlevel earned 900 total points
ID: 1346927
This might be an answer:

Delphi creates an activeX project that gets registred. The activeX project has a function called internMethod, just like your tTestEdit. Are you sure that the activeX wrapper component refers the call to the tTestEdit comp?

It should look something like this, and I think this should be in your activeX implementation unit.

procedure txTestEdit.internMethod;
begin
  fDelphiControl.internMethod;
end;
0
 
LVL 1

Author Comment

by:angerer
ID: 1346928
now it works - i am not sure why
in some cases i think (i am embarrassed) it was the case that the warapper forget the link to the method in my control

anyway
thanks very much
bernhard
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question