Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Error: GetProcAddress on Win32API.new

Guys, I made a dll in VB, and i have some problems. When i declare her in the Win32API.new, like this:
@var = Win32API.new('cnn_dll','make_conn',%w(p), 'b')
Made this error:
GetProcAddress : make_conn or make_connA
What i'm do to make this error??
This is the Dll. Please helping me.
Thanx.
 
This happens when you call an inexistent function inside the DLL. Strange, i discovered that by accident, and i´m sure it could give a better description of that error xD

Well, check if the name of the function is correct, and try not to use underlines. I advice you to use MS´s convention to name your DLL functions to avoid problems (capitalize the first letter of each word, no spaces, no underlines and first word may be a verb).
 
Guys, put it in Windows/System32 results the same thing. Nothing...
Here's the code used in de DLL. Is VB6.0.
#################################################
Option Explicit

Public CnnConn As New ADODB.Connection
Public CnnCmd As New ADODB.Command
Public CnnSel As New ADODB.Recordset

Public Function TakeConnectionA(ByVal cnnline As String)
CnnConn.Open cnnline
Do While Not CnnConn.State = 1
Loop
End Function
', campos As Integer
Public Function QueryA(ByVal SQL As String) As String
Dim comp As String, filds As String
Dim i As Integer, j As Integer
Dim aSQL As String
aSQL = SQL
With CnnCmd
.ActiveConnection = CnnConn
.CommandType = adCmdText
.CommandText = aSQL
Set CnnSel = .Execute
End With
With CnnSel
If .BOF And .EOF Then
QueryA = ""
Exit Function
Else
.MoveFirst
While Not .EOF
For j = 0 To .Fields.Count - 1
If j = 0 Then
filds = .Fields(j) & ";"
Else
filds = filds & .Fields(j) & ";"
End If
Next
filds = Mid(filds, 1, Len(filds) - 1)
If i = 0 Then
comp = filds & "\"
i = 1
Else
comp = comp & filds & "\"
End If
.MoveNext
Wend
comp = Mid(comp, 1, Len(comp) - 1)
End If
End With
QueryA = comp
'select_db = "OK"
End Function
Public Function InsertA(ByVal SQL As String)
With CnnCmd
.ActiveConnection = CnnConn
.CommandType = adCmdText
.CommandText = SQL
.Execute
End With
End Function
####################################################
Thanx for your help guys.
 
joaoneto;147558 said:
Guys, put it in Windows/System32 results the same thing. Nothing...
Here's the code used in de DLL. Is VB6.0.
#################################################
Option Explicit

Public CnnConn As New ADODB.Connection
Public CnnCmd As New ADODB.Command
Public CnnSel As New ADODB.Recordset

Public Function TakeConnectionA(ByVal cnnline As String)
CnnConn.Open cnnline
Do While Not CnnConn.State = 1
Loop
End Function
', campos As Integer
Public Function QueryA(ByVal SQL As String) As String
Dim comp As String, filds As String
Dim i As Integer, j As Integer
Dim aSQL As String
aSQL = SQL
With CnnCmd
.ActiveConnection = CnnConn
.CommandType = adCmdText
.CommandText = aSQL
Set CnnSel = .Execute
End With
With CnnSel
If .BOF And .EOF Then
QueryA = ""
Exit Function
Else
.MoveFirst
While Not .EOF
For j = 0 To .Fields.Count - 1
If j = 0 Then
filds = .Fields(j) & ";"
Else
filds = filds & .Fields(j) & ";"
End If
Next
filds = Mid(filds, 1, Len(filds) - 1)
If i = 0 Then
comp = filds & "\"
i = 1
Else
comp = comp & filds & "\"
End If
.MoveNext
Wend
comp = Mid(comp, 1, Len(comp) - 1)
End If
End With
QueryA = comp
'select_db = "OK"
End Function
Public Function InsertA(ByVal SQL As String)
With CnnCmd
.ActiveConnection = CnnConn
.CommandType = adCmdText
.CommandText = SQL
.Execute
End With
End Function
####################################################
Thanx for your help guys.

make a C++ dll and it will work
 
i found it:

"This is because VB dll's are ActiveX dlls; they adhere to the COM binary
specification, and do not export their functions via the C calling
convention (cdecl). "

Make a dll for me please, with this functions, in c++. Thanx.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top