[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

vb.NET constructor call from Delphi using COM

Posted on 2006-05-16
4
Medium Priority
?
309 Views
Last Modified: 2013-11-25
I have received a dll-file. I have registered the file using the following exe-files from the command-line:
regasm.exe /tlb (makes type library)
gacutil.exe

Afterwards I have opened a new project in Delphi - imported the type library and are referring to the new pas-file under uses. So far so good.

My problem arises when I try to make an instance (an object) of a class from the dll-file. I don't ever get to call the constructor because there is no method on the class that I can call (I was looking for a create-method). Is there any way to call the constructor?

I can add that in VBA I would write the following line and the constructor would automatically be called:

Dim MyObject as New TestClass

But how do I call the constructor from Delphi?

Best regards

Michael
0
Comment
Question by:flycht
3 Comments
 
LVL 3

Expert Comment

by:trainsdse
ID: 16693279
Have you tried using CreateOleObject?
0
 

Author Comment

by:flycht
ID: 16696920
Hi trainsdse

Actually I found out that there was a coClass with a create-constructor. It seems to work.

Best regards

Michael
0
 

Accepted Solution

by:
GranMod earned 0 total points
ID: 16884544
PAQed with points refunded (250)

GranMod
Community Support Moderator
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses
Course of the Month19 days, 13 hours left to enroll

873 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