Hi Friends,
I am trying the Platform Invoke stuff and am facing a problem saying "Unable to load DLL (doAdd.dll)" where doAdd.dll is my registered dll.
To try it, i had:
1) written a function in VB6.0 as:
Function doAdd(ByVal firstNum As Integer, ByVal secondNum As Integer) As Integer
doAdd = firstNum + secondNum
Return
End Function
2) Then I made a "DLL" out of it and called it "doAdd.dll"
3) I registered it using regsvr32.
Now I suppose I can use it in .Net (?)
4)I declared it in my code as:
Declare Auto Function doAdd Lib "doAdd.dll" (ByVal firstNum As Integer, ByVal secondNum As Integer) As Integer
5) and tried running it on Page_Load as:
Dim myNum As Int16 = doAdd(12, 13)
Literal1.Text = "<BR><BR>Addition has given: " & myNum.ToString()
But with no success. It says "Unable to load DLL (doAdd.dll)"
Can somebody help me with it?
Also a good reading article on Platform Invoke using VB.Net would be helpful.
Thanx in advance,
Phani
I am trying the Platform Invoke stuff and am facing a problem saying "Unable to load DLL (doAdd.dll)" where doAdd.dll is my registered dll.
To try it, i had:
1) written a function in VB6.0 as:
Function doAdd(ByVal firstNum As Integer, ByVal secondNum As Integer) As Integer
doAdd = firstNum + secondNum
Return
End Function
2) Then I made a "DLL" out of it and called it "doAdd.dll"
3) I registered it using regsvr32.
Now I suppose I can use it in .Net (?)
4)I declared it in my code as:
Declare Auto Function doAdd Lib "doAdd.dll" (ByVal firstNum As Integer, ByVal secondNum As Integer) As Integer
5) and tried running it on Page_Load as:
Dim myNum As Int16 = doAdd(12, 13)
Literal1.Text = "<BR><BR>Addition has given: " & myNum.ToString()
But with no success. It says "Unable to load DLL (doAdd.dll)"
Can somebody help me with it?
Also a good reading article on Platform Invoke using VB.Net would be helpful.
Thanx in advance,
Phani