Solved

rewrite dll as an activex dll

Posted on 2004-08-03
3
182 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
Comment Utility
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
Comment Utility
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
Comment Utility
ok, I have figured it out...
i'll give you some points alex...
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

772 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

11 Experts available now in Live!

Get 1:1 Help Now