Exemple #1
0
void CExtension::AddDefaultLibraryReferences (SDesignLoadCtx &Ctx)

//	AddDefaultLibraryReferences
//
//	Adds default references if we have no other libraries

	{
	if (GetLibraryCount() == 0)
		{
		//	Add compatibility library if we don't load anything else
		//	(This should only happen for older extensions. All official 
		//	extensions use either RPG or RTS libraries).

		if (GetAPIVersion() < 26 && GetFolderType() != folderBase)
			m_bUsesCompatibilityLibrary = true;
		}
	}
int search_connect(char* apiVersion, long* deviceIDs, wchar_t** deviceSerial, int numFound)
{
	//search and connect
	rs = GetAPIVersion(apiVersion);
	printf("API Version: %s\n", apiVersion);
	rs = Search(deviceIDs, deviceSerial, &numFound);
	printf("%d device(s) found.\n", numFound);
	for (int i = 0; i < numFound; i++)
	{
		printf("Device ID: %d\nDevice Serial Number: ", deviceIDs[i]);
		for (int j = 0; j < SNLENGTH; j++)
		{
			printf("%c", deviceSerial[i][j]);
			if (j == (SNLENGTH - 1))
				printf("\n"); 
		}
	}
	printf("Connecting...");
	rs = Connect(deviceIDs[0]);
	if (ReturnCheck(rs))
		printf("Connected.\n");

	return 0;
}