AboutSyed Rizwan Muhammad Rizvi Expertise I can answers questions regarding web based and desktop based programming in VB.Net. Which can include SOAP, XML, Custom Controls, COM Interoperability etc.
Experience Have been working in this specific area for last 2 years previously I was a VB 6 Developer with experties in other languages as well. Total 10 years of programming experience.
I have created a C++ smart device DLL and added it to my project.
From my VB program I can call the functions successfully in the DLL. Using the code below
CODE
<DllImportAttribute("WIN32SmartDLL.dll")> _
Private Shared Function AddNumbers(ByVal a As Integer, ByVal b As Integer) As Integer
End Function
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim answer As Integer = AddNumbers(25, 25)
End Sub
However, I need to be able to get the DLL to get information from the VB program.
So basically I have a function in my VB program, and I want a DLL function to call this function.
So DLL will be call a VB function.
Many thanks for any advice on this,
Steve
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim answer As Integer = AddNumbers(25, 25)
End Sub
Answer Rather than asking you to write wrappers etc. I would suggest that an easier way would be to write another function inside the C++ DLL which accepts the information that you want to be passed from VB to C++ and store it for later use. You can make an init function and before any other function in the DLL is called you can check whether init has been called or not and act accordingly.