Hai
I have problem with GetVIReference. I getting errors in VC++ 6.0.
"error C2660: 'GetVIReference' : function does not take 3 parameters"
MyCode:
#include "stdafx.h"
#include "windows.h"
#include "stdio.h"
#include "conio.h"
#include
#include
#include
#import "C:\Programme\National Instruments\LabVIEW 7.0\resource\LabVIEW.tlb"
main()
{
VARIANT result1;
VARIANT result2;
int size = 0;
char Path[1000];
char Password[60] = " ";
char VIPath[100] = "C:\\Programme\\National Instruments\\LabVIEW 7.0\\vi.lib\\VB_Local_LabVIEW.VI";
using namespace LabVIEW;
_ApplicationPtr pLV;
VirtualInstrumentPtr pVI;
CoInitialize(NULL);
do
{
pLV.CreateInstance("LabVIEW.A
pplication");
if (pLV == NULL)
{
printf("LV must be running, existing");
break;
}
pVI.CreateInstance("LabVIEW.VirtualInstrument");
strcpy(Path, pLV->ApplicationDirectory);
strcat(Path,VIPath);
pVI = pLV->GetVIReference(Path, Password, 0);//,Password,0);
pVI->SetControlValue("flStarted", "0");
pVI->SetControlValue("strCommand", "FunctionName");
pVI->SetControlValue("strParam1","Parameter1");
pVI->SetControlValue("strParam2","Parameter2");
pVI->Run(0);
result1 = pVI->GetControlValue("String1");
result2 = pVI->GetControlValue("String2");
printf("The Result1 of LabVIEW %f \n", result1.fltVal);
printf("The Result2 of LabVIEW %f \n", result2.fltVal);
while(!kbhit() )
cout<<"Hit any key to Continue \r";
fflush( stdin );
pLV->AutomaticClose = 0;
} while(0);
CoUninitialize();
return 0;
}
Thanks
reddy