Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

Question about implementing external DLL file functions

$
0
0

Hello!  

I have been working with VB.NET for several years and was provided a DLL file that only works in VC++ 2008 for one reason or another (it was written in Delphi, I believe) and is not supported in recent versions.  As a result, I'm being forced to move back to VC++ 2008 and it's very new for me and I'm having trouble implementing a VB.NET dll.  

Below is the code I would use in VB.NET:

Public MyProgrammerBox As DigiTalk.IHardwareInterface = New DigiTalk.MCProgrammer1_8Channel
MyProgrammerBox = New DigiTalk.MCProgrammer2_1Channel
MyProgrammerBox.SerialNumber = "00001"
MyProgrammerBox.InitializeHardware()

All this is doing is creating a variable called MyProgrammerBox, which is of type IHardwareInterface as defined in my Digitalk.dll file.  I am then creating a new instance of MCProgrammer1_8Channel, which is also defined in my Digitalk.dll file.  I am then establishing a serial number and running the InitialHardware() function, which are defined in my Digitalk.dll file.  Overall, it's pretty straightforward.  

The problem I'm having is I can't seem to get even a basic command recognized in VC++ and I'm not sure if it's because of how I'm trying to implement the DLL.  I was able to add my DLL to the references so it's included in the project.  To get the first line working, I am trying:

  DigiTalk->IHardwareInterface^ MyProgrammerBox = New DigiTalk->MCProgrammer1_8Channel;

But I'm getting the error

"error C2882: 'DigiTalk' : illegal use of namespace identifier in expression"

I assumed it's because I'm directly referring to the Digitalk file so I tried changing it to:

IHardwareInterface^ MyProgrammerBox = New MCProgrammer1_8Channel;

I didn't think it would work, it was more of a shot in the dark.  I was right and it gave me this error:

"error C2065: 'IHardwareInterface' : undeclared identifier"

I need to find a way to directly reference data types, variables, and functions from my Digitalk.dll file.  Does anyone know how I might go about this?  Any help you can give me would be appreciated.  Thanks!


Viewing all articles
Browse latest Browse all 15302

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>