I am using a INI file to save the configs of my software. I am getting this weird error when I am saving (writing) the configurations to the INI file.

I get the following error message:
Compile Error: ByRef argument type mismatch

Vb says that the error is with the following line:

VB Code:
  1. WriteToINI "CLICKWHEEL", "Sensitivity", intSensitivity, strINILoc

VB Code:
  1. 'In a module
  2. Public Sub WriteToINI(strSectionName As String, strKeyName As String, strValue As String, strFileName As String)
  3.  
  4. Dim WriteToIniResult As Long
  5.  
  6. On Error GoTo ErrHandler
  7.  
  8.     WriteToIniResult = WritePrivateProfileString(strSectionName, strKeyName, strValue, strFileName)
  9.     Exit Sub
  10.    
  11. ErrHandler:
  12.     Debug.Print Err.Description
  13.     Err.Clear
  14.     Resume Next
  15.  
  16. End Sub
with the intSensitivity part.

The variable is declared as public and contains either a 1 or 0.
I have a line before this one that writes a string to the INI file and it works fine, but I get an error with this line.

I am new to INI files... so any clue??

I already made a thread of this... but I accidently marked it resolved so I had to make a new thread... I don't know how to remove the resolved...

I shall reply tomorrow morning because I have to go to sleep now...