Solved

rewrite dll as an activex dll

Posted on 2004-08-03
3
183 Views
Last Modified: 2012-05-05
Hi everyone!
I have a DLL that looks like this:

----------------------------------------------------------------------------------------------------------------------
library IFAll;

uses
  FastShareMem, PreDllDecl, Windows, Forms, Dialogs, SysUtils, Classes, ShlObj,.....

{$R *.res}

const
 ..............................

var
.....................

function ApplikasjonSti: ShortString; stdcall;
begin
........................
end;

exports
 ApplikasjonSti;

begin
end.
------------------------------------------------------------------------------------------------------------------------

I really want this dll to be available as an object in my aspx pages. But I have heard rumours that the DLLs must then be ActiveX dlls. How do I rewrite the DLL to be an activeX dll?
0
Comment
Question by:Darth_helge
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 500 total points
ID: 11706952
ASP and ASPX can use COM components in the code. Thus what you have to do is create a COM component that can be called from the scripting language. Binaries compiled this way are considered to be ActiveX components.

You need to start with a new ActiveX library project. Then add a new ActiveX control, Active Server Object, ActiveForm, Automation object, COM object, MTS object or even an MTS data module to it. (Other Delphi versions can offer different object types that you can add.) For ASP, the Active Server Object is the best solution.
Then you're in the type library editor. Here you add the methods that you want to use. ApplicasjonSti in your example and add the code to it in the editor.

But this process will require a complete redesign of your DLL and some knowledge about COM development...

Any other ways to call DLL methods from scripting? I'm not sure, but check out the webdevemlopment section of ExEx...
0
 
LVL 5

Author Comment

by:Darth_helge
ID: 11712718
ok. i've got started. But let's say that my dll uses 50 methods only internally in the dll and then there's one function that is public and exported. do i have to declare all the 50 internal methods in the type library? or can i just cut'n'paste these methods over to the new com component? can these private methods call other dll's?
0
 
LVL 5

Author Comment

by:Darth_helge
ID: 11809640
ok, I have figured it out...
i'll give you some points alex...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to disable mouse scroll in a combo box field within a Delphi cxGrid 4 111
Delphi TcxGrid group footer summary 3 211
Best Firemonkey component pack 1 87
Magic Software info 18 125
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now