我正在创建一个设计器表面并将控件加载到运行时。将控件反序列化/加载到运行时时遇到问题。
我尝试过的所有方法似乎都有某种类型的问题。
发行面临例如:
我在 git 上创建了一个示例项目:Surface Designer Test
有主要的代码片段:
从设计时序列化
private void LoadRuntime(int type)
{
var controls = surface.ComponentContainer.Components;
SerializationStore data = (SerializationStore)surface.
_designerSerializationService.Serialize(controls);
MemoryStream ms = new MemoryStream();
data.Save(ms);
SaveData.Data = ms.ToArray();
SaveData.LoadType = type;
new RuntimeForm().Show();
}
public object Serialize(System.Collections.ICollection objects)
{
ComponentSerializationService componentSerializationService =
_serviceProvider.GetService(typeof(ComponentSerializationService)) as
ComponentSerializationService;
SerializationStore returnObject = null;
using (SerializationStore serializationStore =
componentSerializationService.CreateStore())
{
foreach (object obj in objects)
{
if (obj is Control control)
{
componentSerializationService.SerializeAbsolute(serializationStore, obj);
}
returnObject …
Run Code Online (Sandbox Code Playgroud) 我一直在 Linux Ubuntu 上使用远程调试器测试 VS2017 Linux C++。我已经为 C++ 创建了一些示例项目,在我开始编写线程示例之前,一切都运行良好。
我似乎无法编译线程,因为我不断收到“对‘pthread_create’的未定义引用”错误。我知道解决方案是将 -lpthread 或 -pthread 添加到 VS 项目属性命令行,但这在这种情况下似乎不起作用。
如果有人已经完成这项工作,请您指出正确的方向。