Hi Christof,
I got most everything working and hit this one
Warning 1 warning LNK4003: invalid library format; library ignored d:\projects\Pope\FSSample\FSSample\FSSample\SampleSelectDLL.dll 1
Not sure where to go from here. This is an old DLL and maybe VS2005 does not like it?
I got the cSting to work by adding
CString s1( (char *) _HandToPtr(parm->p[0].val.ev_handle));
I can't get the third float parameter to work. Get an erorr that says can't convert float * to float. I worked around this one for now by hard codeing a number into the function call.
UPDATE:
I just remembered that I was getting a compile error:
#error Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
in the afx.h file. I switch to /MT[d] and pro_ext.h had an error that said I had to use /MD[d]. I added #define _AFXDLL that fixed the compile error but maybe the dll does not like this? It is an old DLL and I have no control over how it works.
Thanks.
>Hi James,
>
>> Here is the function call and the compile error I am getting is "cannot convert parameter 1 from 'void *' to 'Cstring'
>
>You need to create a CString object before you can pass it to the function. Something like this:
>
> class __declspec(dllimport) CSampleSelect oSampleSelect;
>
> CString s1( _HandToPtr(parm->p[0].val.ev_handle));
> CString s2( _HandToPtr(parm->p[1].val.ev_handle));
> CString s3( _HandToPtr(parm->p[2].val.ev_handle));
> nTest = oSampleSelect.MainSampleSelect(s1,s2,s3);
>
>You might need to convert the string to Unicode before calling the FLL, though, using STRCONV().