04-26-2013 03:39 PM - edited 04-26-2013 03:40 PM
I'm trying to run a labview dll from CVI. I think I've got it all working expect that I have to pass in a Path variable.
Following the advice found in http://forums.ni.com/t5/LabWindows-CVI/Path-data-type-convert-in-CVI/m-p/699765/highlight/true#M3544...
I think I'm setting this up correctly, but the call to FTextToPath is still returning a 1 ("An input parameter is invalid.")
sample Code:
int CVICALLBACK Go (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
MgErr err=-1;
Path pathy;
char wavePath[500]={"C:\\chewie_talking-ringtone.wav"};
switch (event)
{
case EVENT_COMMIT:
err = FTextToPath(wavePath, strlen(wavePath), &pathy);
// Call to labview DLL here
break;
}
return 0;
}
I'm assuming it's something obvious I'm missing, but damned if I can see it.
Any input is appreciated!
04-29-2013 10:39 AM
Hey MarksAlias,
On the line where you declare wavePath, it shouldn't be necessary to include the curly braces { } around the path. That's the only difference that I can see between your code and the one you linked.
Also, I noticed that an easier solution presented in that forum was to change the LabVIEW DLL to accept a string instead of a path. Is this possible for your application? If so, it might be a bit easier than doing it with these LabVIEW memory manager functions.
04-29-2013 12:06 PM
Thanks Daniel.
For now I've resolved that specific issue. The code actually works but the labview rte wasn't being initialize properly because the system was out of memory. A call to LVDLLStatus confirmed this. Not sure why the FTextToPath err returned was 'invalid parameter' but I guess that's just part of the rte not being loaded.
Thanks!
Mark