Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing a DLL in Visual C++ 1

Status
Not open for further replies.

bobbarker

Programmer
Dec 20, 2001
83
GB
I recently gave some training to a customer on using a COM DLL utility provide by an Accountancy Software package we are resellers for.
I only code in VB, whereas my customer's preferred language is Vis C++ - though he reported he had no experience in adding reference to DLL objects in Vis C++. The software suppliers also did not have any examples for Vis C++.
I was wondering whether anybody may be able to 'translate' the following VB actions into Vis C++ for me.
Thanks for your help in advance.

1. Select Project - References and select a reference for the DLL object
2. Code:
Dim oToolkit as Enterprise01.Toolkit 'Declare a variable for the DLL Library.Object
Dim intRes As Integer 'Declare an integer variable
Set oToolkit = CreateObject("Enterprise01.Toolkit") 'Create and return a reference to the DLL
intRes = oToolkit.OpenToolkit 'Return the value OpenToolkit method of the object to the integer variable

 
1. Menu=>ClassWizard=>Add class...=>From type library... and select the type library (ie the file thats holds the COM interface info). In your case the DLL.

2. The step above will generate a class you can call.




/Per

"It was a work of art, flawless, sublime. A triumph equaled only by its monumental failure."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top