C/C++ code
typedef struct _RESULT
{
int id;
double light;
double temperature;
double rh;
} RESULT; C/C++
void* GetResult()
{
RESULT result;
CZigbeeProtocol zigbeeProtocol;
if (zigbeeProtocol.GetResult(m_recvData,result)) //此处的result就是前面提到的结构体
return &result;
} 程序中: C/C++ codetypedef struct _RESULT
{
int id;
double light;
double temperature;
double rh;
} RESULT;
typedef void * (*dll_GetResult)(void *);
dll_GetResult GetResult=(dll_GetResult)GetProcAddress(hInstance,"GetResult");RESULT * result=(RESULT*)GetResult(0);
UpdateRecvResult(*result);
这样,程序调试不成功
typedef struct _RESULT
{
int id;
double light;
double temperature;
double rh;
} RESULT; C/C++
void* GetResult()
{
RESULT result;
CZigbeeProtocol zigbeeProtocol;
if (zigbeeProtocol.GetResult(m_recvData,result)) //此处的result就是前面提到的结构体
return &result;
} 程序中: C/C++ codetypedef struct _RESULT
{
int id;
double light;
double temperature;
double rh;
} RESULT;
typedef void * (*dll_GetResult)(void *);
dll_GetResult GetResult=(dll_GetResult)GetProcAddress(hInstance,"GetResult");RESULT * result=(RESULT*)GetResult(0);
UpdateRecvResult(*result);
这样,程序调试不成功
解决方案 »
- 用http下载时,怎么判断服务器是否支持断点续传,即是否可以使用range头域?
- 基于对话框应用程序如何改变光标形状?
- 请教一下如何从内存中载入BMP图像和光标?
- 求助获取编辑框输入的字符串的方法
- 关于webbrowse控件
- 结构体中 的数组 变量 怎么声明?? 为什么我这样不行??
- 怎样将多个包含对话框的工程集成为一个工程?
- 问题很简单,可是小生不会,郁闷!
- ODBC批操作
- 各位大侠,小弟请教一个问题,小弟从数据库里提出一段文本信息(主要有汉字、标点符号及空格、回车符),在一个CStatic中需要将该文本按照一定的格式(象一般的稿件)显示,请向各位大侠请教一下如何处理,小弟洗耳恭听)?
- 如何写一个通过ASP提交来让服务器端执行的程序?
- 如何调用DLL中的全局变量?
{
RESULT result;
CZigbeeProtocol zigbeeProtocol;
if (zigbeeProtocol.GetResult(m_recvData,result)) //此处的result就是前面提到的结构体
return &result;
} 这样能成功才怪,早给你说了,这个里面要自己new的void* GetResult()
{
RESULT *result=(RESULT*)malloc(sizeof(RESULT));
memset(result,0,sizeof(RESULT))
CZigbeeProtocol zigbeeProtocol;
if (zigbeeProtocol.GetResult(m_recvData,*result)) //此处的result就是前面提到的结构体
return result;
}
typedef void * (*dll_GetResult)(void *);
dll_GetResult GetResult=(dll_GetResult)GetProcAddress(hInstance,"GetResult");
if (GetResult==NULL)
{
AfxMessageBox("寻找22Dll函数失败");
}
这儿为什么调用动态库不成功,明天上班给分。谢谢
我初学。
void GetResult(RESULT& result)
{
CZigbeeProtocol zigbeeProtocol;
zigbeeProtocol.GetResult(m_recvData,result); //此处的result就是前面提到的结构体
}