Solved

Making ActiveX dlls in delphi 6

Posted on 2002-04-16
14
342 Views
Last Modified: 2012-06-27
Is it possible? I believe it can be done, but how? Can someone point me at a tutorial or tell me instructions? Basically, i need to make a dll that will be accessible by any language that supports com objects. The dll must have classes exported, Like class1, testclass2, etcclass3, which will contain functions and procedures. So, in a client application, the user can load the activex dll, and use class1.Function1 etc.. Help pls!
0
Comment
Question by:alkakios
14 Comments
 
LVL 1

Accepted Solution

by:
Alone earned 100 total points
ID: 6944723
Create File -> New -> ActiveX -> ActiveX Library. Then add File -> New -> ActiveX -> COM Object and go!

WBR...
0
 

Author Comment

by:alkakios
ID: 6944881
Cool, thanks! But I added a procedure in the implementation section and I try to use the dll in VB6. When I do DIm r as new Test1
its ok.
it shows the Test1 on the list.
But when I do
r. It shows nothing. maybe the procedure is private?? How can i make it work? I see that there is an exports section in the library..
0
 
LVL 1

Expert Comment

by:Alone
ID: 6944916
You must publish your public procedures in Type Library. In TypeLibrary Editor you have a button named Add Method. Try this
0
 
LVL 1

Expert Comment

by:Alone
ID: 6944926
You must publish your public procedures in Type Library. In TypeLibrary Editor you have a button named Add Method. Try this
0
 

Author Comment

by:alkakios
ID: 6944939
Great, now I can see the procedures! But when I run the program, it says ActiveX cannot create object. Also, can you explain the other parameters in the AddMethod?
0
 
LVL 1

Expert Comment

by:Alone
ID: 6944942
You must publish your public procedures in Type Library. In TypeLibrary Editor you have a button named Add Method. Try this
0
 
LVL 1

Expert Comment

by:Alone
ID: 6944969
You must publish your public procedures in Type Library. In TypeLibrary Editor you have a button named Add Method. Try this
0
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.

 
LVL 1

Expert Comment

by:Alone
ID: 6944979
Damn! My browser automaticaly sends message many times! :-((

TypeLib Editor has a button Register Type Library. But, it works only within development time. When you want to use this library on another computer, register your library manually from command line:

regsvr32 mylib.dll

To unregister:

regsvr32 /u mylib.dll

Delphi TypeLib Editor has Unregister button too ;-)
0
 

Author Comment

by:alkakios
ID: 6944981
Great, now I can see the procedures! But when I run the program, it says ActiveX cannot create object. Also, can you explain the other parameters in the AddMethod?
0
 
LVL 1

Expert Comment

by:Alone
ID: 6944986
You must publish your public procedures in Type Library. In TypeLibrary Editor you have a button named Add Method. Try this
0
 

Author Comment

by:alkakios
ID: 6944988
Its ok, i figured out the other params. but cant I make a procedure/function without the use of TypeLib? You see, I come from VB.. :) Isnt there a way? Just typing the function/procedure name?
0
 
LVL 1

Expert Comment

by:Alone
ID: 6945014
IMHO, using COM, no.
You must release the procedures and then use the TypeLibrary for publish them. In future users of your library may use your functions/procedures "just typing the name" BECAUSE you're using the TypeLibrary.
If you're planning to release non-COM library, like standard SDK, you must export functions from DLL manually using exports section. See your sources for example. Now your library is exporting DllRegisterServer, etc.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6961383
This question is reasonably current, although others are not.  ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if still open in 14 days.  Please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20248624.html
http://www.experts-exchange.com/questions/Q.20248620.html
http://www.experts-exchange.com/questions/Q.20254459.html
http://www.experts-exchange.com/questions/Q.20258610.html
http://www.experts-exchange.com/questions/Q.20263727.html
http://www.experts-exchange.com/questions/Q.20269462.html
http://www.experts-exchange.com/questions/Q.20290010.html
http://www.experts-exchange.com/questions/Q.20291825.html


To view your locked questions, please click the following link(s) and evaluate the proposed answer.
http://www.experts-exchange.com/questions/Q.20248875.html

*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations if this item remains inactive another seven (7) days.  If you are interested in the cleanup effort, please click this link http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643 
POINTS FOR EXPERTS awaiting comments are listed here -> http://www.experts-exchange.com/commspt/Q.20277028.html
 
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:pnh73
ID: 9003281
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept answer from Alone

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

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

14 Experts available now in Live!

Get 1:1 Help Now