Class in Dll

C

cvh

How can I create an instance of a class defined in a Dll?

This is the code of the class:

Class PrClass

Public aPrNummer As Integer
Public aPrBarcode As String
Public aPrPma As Integer
Public aPrVaMaNr As Integer
Public aPrToMaNr As Integer

Sub New(ByVal Prnummer As Integer, ByVal PrBarcode As String, ByVal
PrPma As Integer, _
ByVal PrVaMaNr As Integer, ByVal PrToMaNr As Integer)

aPrNummer = Prnummer
aPrBarcode = PrBarcode
aPrPma = PrPma
aPrVaMaNr = PrVaMaNr
aPrToMaNr = PrToMaNr

End Sub

Public Overrides Function ToString() As String

Return CStr(aPrNummer) + _
";" + aPrBarcode + _
";" + CStr(aPrPma) + _
";" + CStr(aPrVaMaNr) + _
";" + CStr(aPrToMaNr) + _
";"
End Function


End Class


TIA,

Christophe
 
H

Herfried K. Wagner [MVP]

cvh said:
How can I create an instance of a class defined in a Dll?

Select and right-click the EXe project in the solution explorer and choose
"Add reference..." from the context menu. If the DLL project is part of the
same solution, add a project reference, otherwise add a reference to the DLL
file. Then import the DLL's namespace and use the class.
 
C

Christophe

Thank you Herfried

Herfried K. Wagner said:
Select and right-click the EXe project in the solution explorer and choose
"Add reference..." from the context menu. If the DLL project is part of
the same solution, add a project reference, otherwise add a reference to
the DLL file. Then import the DLL's namespace and use the class.
 
C

cvh

Hello,

Now I'm getting this error:

Error: The dependency 'mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=969db8053d3322ac' in project 'SmartDeviceApplication2' cannot
be copied to the run directory because it would conflict with dependency
'mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'.


I need the Dll to function in CF, what do I need to change?

Thank you,

Christophe.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top