本文整理汇总了C++中DeviceInterface::getSupportedSensoryEffects方法的典型用法代码示例。如果您正苦于以下问题:C++ DeviceInterface::getSupportedSensoryEffects方法的具体用法?C++ DeviceInterface::getSupportedSensoryEffects怎么用?C++ DeviceInterface::getSupportedSensoryEffects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DeviceInterface
的用法示例。
在下文中一共展示了DeviceInterface::getSupportedSensoryEffects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: all
//.........这里部分代码省略.........
for(unsigned int i=0;i<envPath.length();i++)
{
if (envPath[i] == '\\'){
envPath.insert(i,1,'\\');
i++;
}
}
plgsPath = envPath;
plgsPath.append("\\\\plugins.csv");
plugins.open(plgsPath.c_str(),ios::out | ios::binary);
}
if(plugins.fail())
{
cout << "Error opening:"<< plgsPath << endl;
MessageBox(NULL,plgsPath.c_str(),"Ambient Library - Error", MB_OK);
errorMessage = DEVICE_ERROR_OPEN_DRIVER_LIST ;
}else
{
while(plugins.good()){
getline(plugins,line);
all.append(line);
}
}
plugins.close();
// parse the file
//MessageBox(NULL,all.c_str(), "MUH", MB_OK);
std::vector<std::string> devs = Utils::StringSplit(all,";");
// now we know which drivers to load, because the number after every dll specifies which ones we are going to load
// after loading the dll, query it and save which effects it can handle
for(unsigned int i=0;i<devs.size();i+=2){
if(atoi(devs[i+1].c_str()) == LOAD_DRIVER)
{
wchar_t *libText;
std::string pt = envPath;
pt.append("\\\\plugins\\\\");
pt.append(devs[i].c_str());
libText = new wchar_t[strlen(pt.c_str())+1];
memset(libText,0,strlen(pt.c_str())+1);
MultiByteToWideChar(CP_ACP,NULL,pt.c_str(),-1,libText,strlen(pt.c_str())+1);
drv = LoadLibrary(pt.c_str());
delete []libText;
if(drv != NULL){
// dll got loaded properly
// get our entrypoint
InitDeviceDriverPtr = (ctor_b_InitDeviceDriver) GetProcAddress(drv,"ctor_b_InitDeviceDriver");
if (NULL != InitDeviceDriverPtr)
{
// add the driver to our list
DeviceInterface *devI = InitDeviceDriverPtr(disableFateTime);
ptr<std::vector<int>> vec; // we are responsible for the vector ...
vec = new std::vector<int>();
devI->getSupportedSensoryEffects(vec);
devices.insert(pair<DeviceInterface *,ptr<std::vector<int>>>(devI,vec));
// now we have our driver loaded
cout << "Loaded device driver successfuly!"<< endl;
loadedPlugins.push_back(drv);
}else{
std::string error_msg;
error_msg.append("Error at loading driver: ");
error_msg.append(devs[i].c_str());
MessageBox(NULL, error_msg.c_str(), "Ambient Library - Error", MB_OK);
cout << "Error at loading driver: "<< devs[i].c_str() << endl;
errorMessage = DEVICE_ERROR_LOADING_DRIVERS;
FreeLibrary(drv);
}
}else{
cout << "No such device driver could be found: " << devs[i].c_str() << endl;
}
}else{
//MessageBox(NULL, devs[i].c_str(), "Not Loading..", MB_OK);
}
}
}