How to use a DLL to create a simple exe.
-
Hello Everyone, I am trying to code a program in VB6 where i have a DLL. My aim is to call some functions from the dll. I am totally new to this VB envoirnment and hence require some help. Actually this is a part of PHP project which is to be interfaced with some other application through this dll. The dll guys gave this code and i simply copy pasted this code in VB application. The minute i compile the code i get an error "Constants, fixed length strings, arrays, user-defined types and declare statements not allowed as public members of object modules." This is the part of the code, i am getting error on the very first line of the code. Option Explicit Declare Function RTSOpen Lib "RTSLINK.DLL" Alias "Open" () As Long Declare Function Send Lib "RTSLINK.DLL" (ByVal strRequestXML As String) As Long Declare Function GetLastErrorMessage Lib "RTSLINK.DLL" () As String Public Sub vbSend() Dim nResult As Integer Dim strErrorMsg As String * 255 Dim strRequestXML Dim strResponseText .... Regards, Chaitannya
-
Hello Everyone, I am trying to code a program in VB6 where i have a DLL. My aim is to call some functions from the dll. I am totally new to this VB envoirnment and hence require some help. Actually this is a part of PHP project which is to be interfaced with some other application through this dll. The dll guys gave this code and i simply copy pasted this code in VB application. The minute i compile the code i get an error "Constants, fixed length strings, arrays, user-defined types and declare statements not allowed as public members of object modules." This is the part of the code, i am getting error on the very first line of the code. Option Explicit Declare Function RTSOpen Lib "RTSLINK.DLL" Alias "Open" () As Long Declare Function Send Lib "RTSLINK.DLL" (ByVal strRequestXML As String) As Long Declare Function GetLastErrorMessage Lib "RTSLINK.DLL" () As String Public Sub vbSend() Dim nResult As Integer Dim strErrorMsg As String * 255 Dim strRequestXML Dim strResponseText .... Regards, Chaitannya
What kind of project did you create?? What file is this code being pasted into?? Mind you, it's been about 7 years since I last used VB6, so my memory may fail me at any point...
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
What kind of project did you create?? What file is this code being pasted into?? Mind you, it's been about 7 years since I last used VB6, so my memory may fail me at any point...
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007A simple exe project, copy pasted the code in the Form page.
-
A simple exe project, copy pasted the code in the Form page.
Hmmm... It would appear that somewhere along the line there is code outside of a function/sub that can only work inside a function/sub. This is anything that isn't a declaration. It's also possible that some of the code you were given will only work if pasted into a Module, not a form.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007