将结构从表单传递给类 [英] pass structure from form to class

查看:61
本文介绍了将结构从表单传递给类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在form1后面的代码中有一个form1我做了一个类似
的结构


struct ABC

{

uint32 imagesize;

uint32版本号;

};



然后我参加了课程文件class1。



i想要在class1中传递struct ABC。



i使用像

form1 fs = new form1();



通过对象无法访问。



然后我继承我的类到form1。所以它是可以访问的。



但是我的班级有通讯管理员的功能。所以发生了错误堆栈溢出异常。
这行


public serialport sp = new serialport();



请帮助我。

i have a form1 in the code behind of form1 i made a structure like

struct ABC
{
uint32 imagesize;
uint32 version number;
};

and then i took a class file class1.

i want to pass struct ABC in class1.

i used like
form1 fs= new form1();

through object it is not accessing.

then i inherit my class to form1. so it is accessible.

but my class have functionality of communication manager. so giving error stack over flow exception occurred.
on this line
public serialport sp = new serialport();

please help me.

推荐答案

只需谷歌:将对象从表单传递到C## [ ^ ]。


这篇关于将结构从表单传递给类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆