Class in Dll

  • Thread starter Thread starter cvh
  • Start date Start date
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
 
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.
 
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.
 
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.
 
Back
Top