[FONT=Arial]
I am a beginner and I cannot figure out how to pass a string from a VB calling program to a C++ DLL. All I get in the C routine is garbage.
The "Declare" argument in VB is:
(ByRef s As String,.....
And the string looks like:
fln = "D:\\bin\\Data.txt"
The VB call is:
err = load_data(fln,...
On the C++ side I have:
int __stdcall load_data(char *s,...
then I use:
if(strlen(s) > 0)
{
strcpy(file_name,s);
data_file = fopen(file_name,"rt");
if(data_file != NULL)
file = true;
}
This fails every time and I am forced to call a find file dialog. I need it not to fail and can not figure out why it does.
A HUGE thank you if you can help.
Dan