i have read something in internet how to call c++ .dll, and tried to declare functions in vb 6, but however after i compiled, the error was there:" can't find DLL entry point in xxxx.dll". so how to invoke the c++ member function in one .dll, someone can give me help to realize step by step. thanks a lot in advance.
note: probably one library has several classes, so how can i know which library i can use or how to use it?
Private Declare Function DataFormat Lib "icon_vc80_40d.dll" (ByVal cpIpAddress As String, _
ByVal dnsFlag As Boolean) As Boolean
Private Sub Command1_Click()
Dim a As String
Dim b As Boolean
Dim c As String
a = Text1.Text
c = DataFormat(a, True)
Text2.Text = c
i used this code to test the .dll, but the error occurred: didn't find .dll file. or couldn't find entry point of .dll. what is problem?
Note: ICON_API icon::DataFormat::DataFormat ( const DataFormat& df,
bool cloneComponents = true
[in] df DataFormat object to copy.
[in] cloneComponents Specifies if a deep or shallow copy is made.
Not thread safe. The data being copied can change at any time.
could you help me to check, is this right? the Note above just showed dataformat() detail.
thanks a lot, i have documentation of .dll, so i know the actual function name, is this right? sorry, i dun know more this point. now i used the code to test one function DataFormat() what i posted in previous reply. so the error occurred: file not found: icon.dll. so what is problem? and also i have several classes in one library, how i can call the functions properly?thanks.
thanks for your reply. i knew i need to export the c++ dll function first, and then i can call it. but i don't know how to export step by step? i got the dll already. how to export? please help me. thanks a lot
If you haven't DLL source code then you can't. However, you may develop (with C/C++) a new DLL that will act as wrapper of the original one (i.e. an adapter [^]). For details on building a VB6 callable DLL, see this great article series [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke