I am trying to call a C function in my VB6 application. The problem is that that function takes simple
char as a parameter. Not
char array pointer (
char *) but regular
This is how it is declared:
#define FM_API extern "C" int _stdcall FM_API NVF_SetGroupFormat(char *aMarker, char aDecSeparator, int aDigits)
It returns -1 if execution was successful and 0 if not.
At the very beginning I did what I always do - just declared it and that is it.
This was my declaration:
Declare Function SetGroupFormat Lib "C:\Libs\FM_API.dll" Alias "NVF_SetGroupFormat" (ByVal lMarker As String, ByVal lDecSeparator As String, ByVal lDigits As Integer) As Integer
But it always returned 0 (fail/false).
I thought that is something wrong with parameters I passed. I called dll author for advice and told him how I pass my parameters. This is a call of that function:
Dim lSt As Integer lSt = SetGroupFormat("=;\n", ".", 0)
Author told me that this call is correct but he told me that my declaration is "probably" wrong, because I declared lDecSeparator As String, but it should be char.
Main problem is that char does not exist in VB6.
How do I declare and pass char to a c based Dll from a VB6 code?