fjczd 发表于 2009-3-26 21:36:53

dll里的句柄怎么设置?

调用dll函数时,说明如下,
SSIDLL_API int __stdcall SSIConnect(HWND hwnd, long Baud, int Port);
where:
• hwnd is the handle of the window whose procedure will receive Windows
messages from the library.
• Baud is the baud rate to use
• Port is the COM port number to open
Return Values
• SSICOMM_NOERROR if the COM port was opened successfully.
• An error code if an error occurred (see Table 1-1 on page 1-32)
Example
int status;
// using baud rate of 9600, com port number 1
status = SSIConnect(m_hWnd, 9600, 1);
请问如何把example中的函数转换到labview中呢
主要是这个hwnd,不知道怎么弄
希望老大给指点一下,最好能给个labview8.2或以下版本的例子
谢谢了

附件里是dll文件和完整的pdf说明书,我这里的仅仅是其中的一个函数

fjczd 发表于 2009-3-26 21:48:42

从论坛上搜了半天,也没找到满意的答案

fjczd 发表于 2009-3-27 10:58:07

查了些资料
感觉有用,把网址发上来,与大家共享
http://forums.lavag.org/hWnd-for-cw3DPlot-in-LabVIEW-t11064.html&p=46552
http://forums.ni.com/ni/board/message?board.id=170&thread.id=194265
http://blog.csdn.net/laipin7/archive/2008/10/30/3187739.aspx
http://blog.ednchina.com/jizzll/130972/message.aspx
http://msdn.microsoft.com/en-us/library/ms633499.aspx

labc 发表于 2009-3-27 17:14:11

本帖最后由 labc 于 2009-3-27 17:25 编辑

你得给个ocx的, dll的不行

Labc

tester 发表于 2009-3-27 23:20:41

HWND hwnd不是窗体吗

上传一个获取窗口句柄的labview的程序!
http://www.cpubbs.com/bbs/viewthread.php?tid=59655&fromuid=3757

labc 发表于 2009-3-28 09:42:01

本帖最后由 labc 于 2009-3-28 09:51 编辑

tester, 你说得没错啊.
从楼主提供的资料来看, 有两种情况, 一种就是要窗口的, 另外一种例外情况是ActiveX可能需要Hwnd. ActiveX 就用我给的那个方法.
请楼主试试吧.

下面是别人的发言:
All native LabVIEW controls are entirely handled internal to LabVIEW and Windows is not aware at all that there is something like a control inside a LabVIEW panel. LabVIEW uses Windows HWNDs only for its windows, both front panels and block diagrams.The exception to this are Active X controls that of course need to use a HWND somehow in order to work as Windows requires them to do.

Labc

fjczd 发表于 2009-3-28 13:49:22

本帖最后由 fjczd 于 2009-3-28 14:02 编辑

你得给个ocx的, dll的不行

Labc
labc 发表于 2009-3-27 17:14 http://www.cpubbs.com/bbs/images/common/back.gif
ocx是VB编程调用的,dll是vc编程用的
我想用labview调用dl。
如果你说ocx,我就传上来。
还有,labview调用dll好用还是调用ocx好用?
ocx在这里

fjczd 发表于 2009-3-28 14:09:31

本帖最后由 fjczd 于 2009-3-28 14:19 编辑

这里是两个安装文件,装上后,会在C:\Program Files\Symbol Technologies\SSI SDK下有帮助文档和vb、vc的例子。
SSIConnect.ocx文件在C:\WINDOWS\system32中
页: [1]
查看完整版本: dll里的句柄怎么设置?