vbnetdde

所属分类:.net编程
开发工具:Visual Basic
文件大小:11KB
下载次数:83
上传日期:2006-03-23 13:16:00
上 传 者qwishes
说明:  一个在微软vb.net编程语言环境下的DDE实现源码,DDE功能用于早期的应用程序间数据交换,支持到vb6.0,.net已不再支持DDE
(vb.net a Microsoft programming language environment of DDE source, DDE function for early application data exchange between its support to the vb6.0,. Net no longer support DDE)

文件列表:
DDE.sln (945, 2001-12-28)
DDE.vb (27534, 2001-12-28)
DDE.vbproj (3430, 2001-12-28)
DDEwindow.vb (15375, 2001-12-28)
mehtest.reg (1170, 2001-12-28)

DDE.NET Project =============== 2002 Mark Hurd. Public Domain, but email me if you use the ideas in this project. Included in this archive: DDE.VBPROJ a VB.NET project DDE.SLN a VS.NET Beta 2 solution DDE*.VB two VB.NET source files README.TXT this file MEHTEST.REG a definition of the .meh file type for testing. Compiling --------- If you're not using the VS.NET IDE, this command will compile the project: vbc -debug- -removeintchecks+ -optimize+ /target:winexe -r:system.dll,system.windows.forms.dll,system.drawing.dll dde.vb DDEwindow.vb If you're using the VS.NET IDE, the project should build successfully :-) Testing ------- Run the program and double click the form. It should request the list of program groups from "PROGMAN", which is handled by Explorer. Otherwise, the program just logs all DDE messages it sees and responds to a few. The hard-coded application and topic to use for testing is: Application: DDE.NET Topic: System When dealing with items, the current code acknowledges any item name, but never sends any values. Eg. With the compiled program running, in Excel type the a formula: =DDE.NET|System!TestItem Excel should poll all applications for DDE support Choose DDE.NET|System Excel ought to respond with #N/A indicating no data has been offerred. To test the receiving of a DDE Execute command, you could use a VB6 form, seting a labels DDE details to correspond to the above, or just get Explorer to send a command: The .meh file type, as defined in mehtest.reg, asks Explorer to send a DDE Exec command to DDE.NET|System. For full functionality, (that is, the ability for Explorer to start the compiled program for you) modify the path to the executable mentioned in mehtest.reg. It should point to your compiled executable. You can 'Test' one file with a .meh extension, or many files. Ideas ----- Next thing to do is to NACK data formats we don't want to use when receiving Advise messages, because the client application should ask again with a simpler format. Also, I have cut a lot of code that only a client will use. This needs testing, so there needs to be a communication set up with a server, probably PROGMAN or one of the more recent Explorer supplied interfaces. A more useful one might be Internet Explorer, but I haven't seen much of what that offers. Notes for real implementations ------------------------------ The additional code to support the PROGMAN|PROGMAN!Groups request shows that the infrastructure required is present, but it does need reworking as suggested below: If you intend supporting DDE in your VB.NET application, rework my ideas so that you separate Client and Server tasks and probably wrap it all up in a state machine. However, if you just want to support Explorer's DDE commands, it seems I have provided the main concepts. Feedback -------- If you modify this source and make it available to others, as would be the kind thing to do, please email me before making the changes public. If you did not get this archive from http://www.ozemail.com.au/~markhurd/vbnetdde.zip please email me the URL of where you found it. Please email me at mailto:markhurd@ozemail.com.au if you have any ideas or want to include this work in a 'real' project. Changes ------- 011227 MEH First public release 011228 MEH Fixed bugs in OnAck, OnData and the API declarations. Free global data object in OnData, when requested. Log hWnds of messages received. Added code to request data from PROGMAN|PROGMAN!Groups, including these routines: DoubleClick event to actually perform the request. SendInitiate to initiate a DDE conversation. PostRequest to ask for data. WaitForData to idle loop until the requested data is sent. InitAck event records the "PROGMAN|PROGMAN" hWnd. Data event: checks for text or unicode text and logs it, or sends a NACK for other formats. sends an ACK if requested.

近期下载者

相关文件


收藏者