小编use*_*332的帖子

使用ShellExecute在进程之间进行IPC

我正在用C++编写win32 api.我有一个父进程,我正在使用它通过调用ShellExecute来运行一个新程序.

我希望子进程能够与父进程通信(通信只需要一种方式).我认为一个匿名管道适合这个,我已经找到了如何使用CreatePipe函数创建管道,但我不确定如何使用ShellExecute命令将管道提供给子进程.

有人能指出一个体面/相关的教程吗?或者,如果另一种形式的IPC比管道更好,请指出我的方向.

如果它是相关的,这就是我的shell执行命令的样子:

ShellExecute(NULL, "open", "Argo\\argo.exe", NULL, NULL, 1);
Run Code Online (Sandbox Code Playgroud)

c++ winapi ipc pipe

10
推荐指数
1
解决办法
467
查看次数

UITableView无法通过单个手势识别器进行触摸

我有一个带有UITextField,UIButton和UITable视图的UIView.文本字段和按钮会破坏搜索栏,然后将结果加载到表格视图中.

我想这样做他们键盘解雇.如果用户在编辑文本字段时点击某些内容.我的策略是为UIView添加一个手势识别器,但是后来手势识别器似乎拦截了表视图中的所有触摸并且你| tableView:didSelectCellAtIndexPath:| 永远不会被召唤.有趣的是(至少对我来说)UIButton在用户编辑字段时仍然可以使用,即使UITableView不是.

我试过实现| gestureRecognizer :: shouldRecognizeSimultaneouslyWithGestureRecognizer:| 总是返回是,但这没有帮助.我也尝试过设置

singleTapRecognizer.cancelsTouchesInView = NO;
Run Code Online (Sandbox Code Playgroud)

这也没有帮助.

我很满意在文本字段调用时添加和删除手势识别器的想法| textFieldDidBeginEditing:| 和| textFieldDidFinishEditing:|,虽然这感觉很乱,但是当你编辑文本字段时仍然需要两次点击才能触摸一个单元格(一个用来关闭它们键盘并删除识别器,一个用来点击单元格).

有没有更好的办法?

相关代码如下:

- (void)loadView {
  [super loadView];

  self.scrollView = [[UIScrollView alloc] initWithFrame:[UIScreen mainScreen].bounds];
  self.scrollView.backgroundColor = [FDEColors viewBackgroundColor];
  self.view = self.scrollView;

  self.searchField = [[UITextField alloc] initWithFrame:CGRectZero];
  self.searchField.placeholder = @"What are you looking for?";
  self.searchField.backgroundColor = [FDEColors textFieldBackgroundColor];
  self.searchField.clipsToBounds = YES;
  self.searchField.layer.borderColor = [[FDEColors buttonColor] CGColor];
  self.searchField.layer.borderWidth = 1.f;
  self.searchField.returnKeyType = UIReturnKeySearch;
  self.searchField.delegate = self;
  [self.view addSubview:self.searchField];

  self.searchButton = [[UIButton alloc] initWithFrame:CGRectZero];
  self.searchButton.backgroundColor = [FDEColors …
Run Code Online (Sandbox Code Playgroud)

objective-c uitableview uiscrollview ios

7
推荐指数
1
解决办法
554
查看次数

标签 统计

c++ ×1

ios ×1

ipc ×1

objective-c ×1

pipe ×1

uiscrollview ×1

uitableview ×1

winapi ×1