I am writing VB6.0 projects (DLL with COM+) starting from previously written code.
I have a “main” Class Module CLS file with “main” Functions, and the Process flow etc.
I have also a “side” Module BAS where I save all the Functions / Subroutines to use as tools in my “main” Class Module.
I have written a very very straightforward logging system (because I feel very unconfortable with App.LogEvent(“blablabla”) ) but I am not able to compile the DLL. The message points me to the CLS call and I think the problem is related to the Sub that should return a value, but I do not want to return any value from that Sub!
I am quite new to VB6.0 and improving existing source code it is quite difficult.
Here is my Module BAS
Public Sub LogMyApp(ByVal sFunctionName As String, ByVal sLogEntry As String)
Dim sLogPath As String
sLogPath = "C:\Temp\MyLog.txt"
Dim fn As Integer
fn = FreeFile
Open sLogPath For Append As #fn
Write #fn, Now & "|" & sFunctionName & "|" & sLogEntry
Close #fn
End Sub
Here is my Class Module CLS call to that Sub inside the BAS Module
LogMyApp ( "FunctionBlaBla" , "blablabla" )
Any help is really appreciated!
Thanks a lot!
Simple fix, remove the parens as you are not calling a function;
(Or as purely a visual thing prefix with the Call keyword;
call LogMyApp(...))