有人可以让我知道如何提供所有必需的文件,如inf文件,.sys等,以编程方式安装第三方设备驱动程序.这个解决方案应该最小的操作系统是Windows2000.
我尝试将.inf文件复制到Win Folder\INF文件夹,将sys文件复制到Win文件夹\ system32\drivers,但每次插入设备时,Windows弹出Found New Hardware用户界面,这是我想避免的.
下面是我尝试但功能返回的东西error 87 (The parameter is incorrect).
HINF HInf;
UINT ErrorLine;
BOOL bRes = FALSE;
PBOOL FileWasInUse = FALSE;
LPCSTR szSourceFileName = _T("C:\\Drivers_HypercomP1320\\hypvcpusb.inf");
LPCSTR szInfFileName = _T("hypvcpusb.inf");
PVOID Context = NULL;
HInf = SetupOpenInfFile ( szSourceFileName, NULL, INF_STYLE_WIN4, &ErrorLine);
LPCSTR SourceFile = ("hypvcp.sys");
LPCSTR SourcePathRoot = _T("C:\\Drivers_HypercomP1320");
LPCSTR DestinationName = _T("C:\\WINDOWS\\system32\\drivers\\hypvcp.sys");
bRes = SetupInstallFileEx ( HInf, NULL, SourceFile, SourcePathRoot, DestinationName, SP_COPY_FORCE_IN_USE,
(PSP_FILE_CALLBACK)CopyMsgHandler, Context, FileWasInUse);
DWORD dwVal = GetLastError();
SetupCloseInfFile(HInf);
// Callback …Run Code Online (Sandbox Code Playgroud) 有人可以告诉我如何使用UIBezierpath绘制单个点吗?我可以使用UIBezierpath画一条线,但是如果我松开手指然后放回去,然后再删除任何东西,则不会在屏幕上绘制。
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
CGPoint p = [touch locationInView:self];
[pPath moveToPoint:p];
[pPath stroke];
[self setNeedsDisplay];
}
- (void)drawRect:(CGRect)rect
{
[pPath stroke];
}
Run Code Online (Sandbox Code Playgroud) 如何将NSDateFormatted字符串转换Apr 18, 2014 10:34:19 AM为2014-04-18T17:34:19?我已经尝试过以下但它返回一个nil NSDate指针.这里的任何人都可以帮助我.谢谢.
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
[dateFormatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss"];
NSDate *date = [dateFormatter dateFromString:@"Apr 18, 2014 10:34:19 AM"]; // Error nil
NSLog(@"date: %@", date);
Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个泛型方法,它将一个SEL参数作为参数传递给dispatch_async执行,但我无法如何执行传入的SEL.请允许有人帮助我.
// Test.m
-(void) executeMe
{
NSLog(@"Hello");
}
- (void)viewDidLoad
{
[super viewDidLoad];
SEL executeSel = @selector(executeMe);
[_pInst Common_Dispatch: executeSel];
}
// Common.m
-(void) Common_Dispatch:(SEL) aSelector
{
dispatch_async(iDispatchWorkerQueue, ^(void) {
// How to execute aSelector here?
});
}
Run Code Online (Sandbox Code Playgroud)