PB OLE對象PowerBuilder.Application

dgzys0769 2013-01-08 03:49:34
PB11.5版本
PBObject = CREATE oleObject
ll_result = PBObject.ConnectToNewObject("PowerBuilder.Application")
ll_result结果是-2,需要什么DLL呢
...全文
1081 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
A啦Dbit 2013-01-10
  • 打赏
  • 举报
回复
oleobject PBObject
int ll_result
PBObject = CREATE oleObject
ll_result = PBObject.ConnectToNewObject("PowerBuilder.Application")

messagebox('',ll_result) //咱电脑上返回0
destroy pbobject



dgzys0769 2013-01-10
  • 打赏
  • 举报
回复
引用 7 楼 zlf19810306 的回复:
用windows API CoCreateGuid
因为发现PB有自带的OLE,所以不想用太多的DLL,才不考虑Windows API的
pb8 2013-01-10
  • 打赏
  • 举报
回复
引用 12 楼 dgzys0769 的回复:
引用 10 楼 pb8 的回复:除了复制dll,还需要导入pbdwr90.reg文件,文件中的路径部分要换成你的实际路径 都需要哪个dll呢 pbapl115.dll,我有 pbdwr90.reg 如果是11.5,是换成pbdwr115.reg吗?
dll最好复制全一些,发布后也可以用procmon之类的工具检测一下看需要的dll,另pbdwr**.reg中**是需要换民具体版本的,在你的sybase\shared\powerbuilder下有
dgzys0769 2013-01-10
  • 打赏
  • 举报
回复
引用 10 楼 pb8 的回复:
除了复制dll,还需要导入pbdwr90.reg文件,文件中的路径部分要换成你的实际路径
都需要哪个dll呢 pbapl115.dll,我有 pbdwr90.reg 如果是11.5,是换成pbdwr115.reg吗?
dgzys0769 2013-01-10
  • 打赏
  • 举报
回复
引用 9 楼 xiajinxian 的回复:
oleobject PBObject int ll_result PBObject = CREATE oleObject ll_result = PBObject.ConnectToNewObject("PowerBuilder.Application") messagebox('',ll_result) //咱电脑上返回0 destroy pbobject……
你那个是开发环境哦
pb8 2013-01-10
  • 打赏
  • 举报
回复
除了复制dll,还需要导入pbdwr90.reg文件,文件中的路径部分要换成你的实际路径
zlf19810306 2013-01-09
  • 打赏
  • 举报
回复
在PB9里这种用法是 automation server 用Using PowerBuilder as an automation server automation server 在11.5里已经没有了
zlf19810306 2013-01-09
  • 打赏
  • 举报
回复
用windows API CoCreateGuid
dgzys0769 2013-01-09
  • 打赏
  • 举报
回复
引用 3 楼 lzp_lrp 的回复:
系统中没有 PowerBuilder.Application 这个类
请问需要什么样的组件?
dgzys0769 2013-01-09
  • 打赏
  • 举报
回复
引用 4 楼 zlf19810306 的回复:
在PB9里这种用法是 automation server 用Using PowerBuilder as an automation server automation server 在11.5里已经没有了
11.5已经不能用了吗 看到说需要DLL及其他文件的都是低版本的 我是想用PBObject.GenerateGUID(REF GUID) 这个函数的,虽然现在直接通过数据库newid()取到了,但是在没有连接数据库的程序就没办法用了
WorldMobile 2013-01-08
  • 打赏
  • 举报
回复
系统中没有 PowerBuilder.Application 这个类
WorldMobile 2013-01-08
  • 打赏
  • 举报
回复
返回值是-2,意思是类名不对 -2 Class name not found Syntax oleobject.ConnectToNewObject ( classname ) Argument Description oleobject The name of an OLEObject variable that you want to connect to an automation server or COM object. You cannot specify an OLEObject that is the Object property of an OLE control. classname A string whose value is a programmatic identifier or class ID that identifies an automation server or COM server. Return value Integer. Returns 0 if it succeeds and one of the following negative values if an error occurs: -1 Invalid Call: the argument is the Object property of a control -2 Class name not found -3 Object could not be created -4 Could not connect to object -9 Other error -15 COM+ is not loaded on this computer -16 Invalid Call: this function not applicable If any argument's value is null, ConnectToNewObject returns null.
A啦Dbit 2013-01-08
  • 打赏
  • 举报
回复
这是什么东东,,有这样用的?
数据库开发课程设计报告 学生选课管理系统 系别:计算机工程系 班级:软件1408班 姓名:金 科 目的: 掌握PowerBuilder与SQL Server的连接方法 掌握设计窗口的方法 掌握设计菜单的方法 掌握PowerScript语言的程序设计方法 掌握控件的使用方法 掌握建立数据窗口对象的方法 掌握数据窗口控件的使用方法 掌握数据窗口控件函数的使用方法 掌握数据窗口控件事件 掌握数据报表的设计方法 掌握统计图表的设计方法 了解输出打印的设计方法 掌握用户权限的设置方法 工具: PowerBuilder SQL Server 目录: ( 数据库系统设计工具——PowerBuilder 3 一、 使用PowerBuilder 3 二、 创建应用程序 5 三、 连接数据库 6 ( 界面设计 8 一、 窗口设计 8 二、 菜单设计 10 三、菜单捆绑 12 ( 程序设计 13 一PowerScript语言 13 二、 控件 18 二、 控件脚本实例 20 ( 数据浏览 23 一 数据窗口简介 23 二 数据窗口对象 23 三 数据窗口控件 25 四 数据窗口实例 26 ( 数据编辑 29 一 数据窗口控件函数 29 二 数据窗口控件函数实例 30 三、数据窗口控件事件 35 四、 数据窗口控件事件实例 35 五、 数据窗口控件事件实例 43 一、 数据窗口控件事件实例 51 一、 数据报表设计基础 55 二、 数据报表实例 56 三、 统计图表设计基础 57 四、 统计图表实例 58 五、 输出打印设计 60 一:使用数据库: 创建用户表"<班级>_<学号>_u",。创建数据库用户"<班级>_<学号>",并设置相应权限 ,即对表"<班级>_<学号>_s"、"<班级>_<学号>_c"、"<班级>_<学号>_sc"、"<班级>_<学 号>_u"和"<班级>_<学号>_tj"select、insert、delete和update权限。 二.使用PowerBuilder 1.组件:开始 程序 Sybase 2.应用程序开发步骤: 启动PB 创建工作区 创建目标、应用库及应用对象:对象、脚本。 3.创建应用程序 (1)启动PB 开始 程序 Sybase (2)创建工作区 File New Workspace:工作区名。 (3)创建目标及应用对象 工作区 右键 New Target Application:应用对象名、目标名、应用库名。 Profile Name 右键 Connect:测试连接。 Profile Name 右键 Properties Preview:copy 应用对象名 右键 Edit open事件:Ctrl+V 然后使用嵌入式SQL语句CONNECT建立连接 三.窗口设计 (1)创建窗口 (File )New PB Object Window 保存:通常窗口命名为"w_login"。 (2)界面设计 (3)设计程序,运行显示"欢迎使用"窗口 四.菜单设计 (1)创建菜单 (File )New PB Object Menu:右击Untitled,Insert Submenu Item建菜单项,右击菜单,Insert Submenu Item建命令项,菜单命名为"m_main (2)设计菜单 用户管理、学生管理、课程管理、选课管理、数据分析、系统维护 在学生管理、课程管理中分别加入子菜单 增加、删除、修改、查询;在选课管理中加入子菜单 按学生、安课程;在数据分析中加入子菜单 学生统计、课程统计、成绩统计、输出打印;在系统维护了中加入子菜单 修改密码、帮助、退出。 (3)菜单的捆绑 a)新建一个捆绑菜单的窗口 b)打开窗口,在"MenuName"框中指定需要捆绑的菜单名"m_main",在"WindowType"框中 指定所需要的并可以带菜单的窗口类型,如"mdihelp!"。 五.系统维护中的子窗口设计 (1)新建窗口,命名为w_help。 (2)制作"帮助"文件的word文档,并截图。 (3)单击工具栏上的ole控件,打开"Insert Object"对话框。 (4)单击窗口的任意位置,放置OLE控件,并将控件大小调节。 (5)打开"m_main",双击"系统维护"菜单标题下的"帮助"菜单项,写脚码。 修改密码窗口 创建窗口,命名为"w_password" Cb_1的脚码(确定) Cb_2的脚码(关闭) (2)(5)打开"m_main",双击"系统维护"菜单标题下的"修改密码"菜单项,写脚码。 六.学生管理系统中的课程管理中的所有子窗口 创建数据对象 查询表"s" 选择"file"->"new"命令,选择"grid"风格,单击"ok"按钮 查询表"c" 创建查询窗口 Open的脚码 Cb_1的脚码(检索) Cb_2的脚码(关
S7A驱动,7.20版本, Version history S7A OPC server and FIX driver for Siemens S7/S5 communication via Ethernet TCP/IP, MPI or Profibus Version 7.20 Date: 26.02.2007 Version history ================================================================================================================== Build 224 New Functions: Solved problems: - The setup program created a wrong e-doc link in Windows start menu. Now the proper link to S7A.CHM will be installed - From the S7A power tool it wasn't possible to open the online help file. Now it can be opened and also the context-sensitive help works properly. - When the signal conditioning function "S&M" was used for a byte value, the driver wrote wrong values to the PLC. Build 223 : New Functions: - The number of supported NetLinks has been increased from 4 to 64 - Communication error messages will be now displayed in the alarm history of iFIX. This helps to detect, trace and solve communication issues. - Support for MATRIX licence key added. This key does not require a special key driver. It simply needs a PC and a windows version which supports USB ports. - When using the driver in conjunction with NetLink adapter, the licensing now can take place by a license code in the NetLink. In this case a separate licence key (dongle) is not needed. Note: If the connection to the NetLink is disturbed, the driver starts in demo mode, because it can't read out the licence code. If afterwards the connection to the Netlink can be established, the driver automatically changes from demo mode to the licenced mode as long as the demo time has not yet expired. - Support for S7-200 with CP 243-1 was added. Solved problems: - Passing of invalid OPC Item IDs caused a memory leak of the driver's global memory. After the global memory was exhausted, the driver crashed. - Writing of string values failed when using hardware options NULLTERM or SPACEFILL - Wrong OPC timestamp occured when driver was running in NIO Simulation Mode - The driver could crash when the driver was stopped (either by hand or when the demo time was expired) and in the same moment the NetLink connection was disturbed. - Improvements on the seamless switching between primary and backup devices and vice versa. - The passing of invalid OPC Item IDs caused a memory leak in the driver's global memory. After the global memory was exhausted, the driver crashed. - The writing of strings failed when using the hardware options NULLTERM or SPACEFILL Build 222 : New Functions: - The driver can now be registered as a service with the local system account as the log-on account. For more information see the document "S7A_as_Service.PDF" on the installation CD . - The driver now switches "seamless" between primary and backup device and vice versa. Solved problems: - The field "Default Gateway" has been added to the NetLink's configuration property page - The string write from the OPC Server sometimes failed . This bug has been fixed - After driver uninstall, not all of the S7A-related registry entries were deleted. Now the registry will be completely cleaned from S7A registry entries after uninstall. - The Netlink module generated trace messages to debug window. These trace outputs has been removed. Build 221 : New Functions: - The information field "Runtime Mode" has been added to the system statistic display. This shows whether the driver is running in the demo mode or in the licenced mode (with a valid key). - New control tag: "!RuntimeMode:S7A". A digital (i.e. DI) or analog (i.e. AI) block with the I/O address "!RuntimeMode:S7A" delivers the value 0 (in the F_CV property), when the driver is running in the demo mode, or the value 1, when the driver has found a valid key, and therefore is licenced. This function is also available via the OPC server interface. The same item-ID address format has to be used as with the tag-I/O address, thus "!RuntimeMode:S7A" - The information field "Device in use" has been added to the device statistic display. This shows which device (primary or backup-device) is currently active. This state can also be requested via the "!switch" control tag. A digital (i.e. DI) or analog (i.e. AI) block with the I/O address "!switch: delivers the value 0, when the primary device is active and the value 1 when the backup device is active. For the place holder in the I/O address the logical name of the driver device, which is requested, must be entered . Example: "!switch:D11" delivers the state of the driver device with the name "D11". This function is also available via the OPC server interface. The same address format has to be used for the tag-I/O address as for the item-ID, thus "!switch:" - At the channel parameter dialog for the communicatiomn way "S7 TCP/IP" and "MPI/PB CIF", the combo box "Conn.Type" has been added, which now enables the selection of the connection types "PG", "OP" and "other". Until now, a PG connection was used. - In the device dialog of the communication way "MPI/PB CIF", the input fields "Rack:" and "slot no. of CPU" have been added. This extension now allows the connection to "external" Profibus- CPs (CP 342/443-5 or 343/443-5). The Profibus station address of the Profibus CP is stated in the MPI/PB address field. The rack and slot number of the S7-CPU must be stated in the corresponding fields. Please make sure that slot number of the CPU is entered and not of the Profibus-CP!! - The driver now supports the different date and time data types of the S7 PLC. See Topic "Hardware Options for OPC String and TX-Blocks to support S7 date and time data types" in the S7A online help for detailed information. Build 220 : Solved problems: - The own address of CIF50 MPI/PB communication way was limited to 31. Now the limit is 126. - Bug-fix in PG-PC Interface (CP5611) communication way. Device could be disabled from polling, after CP5611 sent a specific sequence of communication errors. Build 219 : Solved problems: Improvements and new functions: - New Parameter "Max Gap (Bytes)" on Setup parameter property page "Advanced". This parameter defines the maximum address gap between an existing and a new block at which the driver automatically appends the new block to the existing. If the address gap is greater, then the driver creates a new data block. This functionality is active, when the data block auto create option is set on. - New Radio Button selection "Show Window" on Setup parameter property page "Advanced" The driver automatically opens its window which shows trace log messages useful for trouble shooting, when the "Yes" Radio button is on. - New HTML Help Build 218 : Solved problems: - Problems with datablocks which have a length between 180 and 200 bytes. - Unsufficient exception handling in S7AMemory.Dll caused blocking of driver and all other clients (WSACTASK, Workspace, etc.) which reads data from the driver. - Error in MIX Read function could cause blocking of data blocks Build 217 : Solved problems: - In configurations with data blocks which have a primary rate of zero (as fast as possible), it sometimes happened that write requests were "stuck" in the write queue. - Sporadic locks of data blocks after the driver was switched from the primary device to the backup device Improvements and new functions: - Improved error and timeout handling on communication faults. The reply timeout on the device configuration page can no longer be configured. Instead it will be derived from the TCP/IP timeout value, configured on the channel configuration page. The value (in seconds) of reply timeout always is 1 second higher than the TCP/IP timeout. This ensures, that the logical read/write request (time-limited by reply timeout value) will not be cancelled (by timeout) before the physical request (time-limited by TCP/IP timeout value) is finished regulary or through the timeout. - The NIO Simulation mode has been expanded. If it is set "ON" the polling of data blocks will be disabled, due to which no communication errors will arise, as long as a PLC hardware is not connected to the driver. In this mode the iFix data base blocks reads the value of zero or respectively, the last value written to the driver`s output data area. - "!SyncPoll" and "!SyncSend" have been added to allow e.g. an EDA application to read/write a data block synchronously Build 216 : Solved problems: (06.06.05) - Reset of statistic counters failed Build 215 : Solved problems: (31.05.05) - An error in the OLE interface methods ReadValue ()and WriteValue() was corrected. These functions can now be used for example,within the Excel program, to access data block values. - Datablocks stopped polling after an 'unknown error' was returned by CP5611 Build 214 : Solved problems: - Syncronous reads/writes from concurrent OPC clients now work properly New function: - Performance has been improved, especially in configuration with a lot of short data blocks. - system, channel, driver and data block static display has been extended Build 213 : Solved problems: - No reconnect after the MPI/Profibus connection between CP5611 and the PLC was aborted. - S7ADRV.EXE could crash on Multi Processor Systems or Systems with Hyperthreading when error messages (e.g. "Unable to connect to MPI station") were put to driver's log window from different threads concurrently. Build 212 : Solved problems: - The AGLink error code -1268 (Unknown error message of the PLC) caused a blocking of the device. Now the device will be closed and re-opened to recover the error. - under very seldom conditions a AGLink error caused a crash of S7ADRV.EXE Build 211 : Solved problems: - Setup of TCP/IP parameters failed with error -510. Problem has been solved. - Problems in configurations with more than 8 devices within a channel have been solved - Import of CSV file from S7A Version 7.16 failed - Failed to read the AG State - Configuration of a backup IP address caused a driver crash when it tried to switch from primary to backup device Build 210 : New functions: - Communication way MPI/Profibus using Siemens CPs (CP5611, 5613) added - Communication way MPI/Profibus using Hilscher CIF50 PB added - Communication to "old" S5 series via TCP/IP added - The old Sentinel Keys will not supported any longer - Check Box "Disable comm alarming" in datablock configuration allows to suppress the COMM alarms of Tags which addresses a driver datablock which is in communication error state. - Now the OPC server is OPC DA 2.05 complient Build 210 : Solved problems: - Under Windows XP the driver crashed when the network cable was not connected to ethernet card and the driver started. - A communication error on a single device caused comm errors on all other devices of the channel Build 201 : Solved problems: - CSV Import/export works now even for the new communication ways. Build 200 : Solved problems: - Handle leakage when using asynchron read mode of OPC server. This problem was fixed by migration to OPC server toolkit version 7.20 New functions: - The driver now supports additional communication ways (serial adapter, NetLink adapter and Siemens CPs (eg. CP5611). It's no longer a pure TCP/IP driver but a general driver for Siemens S7 which allows to connect via TCP/IP, MPI bus or Profibus using different interface hardware (CPs). Build 128 : Solved problems: - In big configurations with a lot of data blocks when a data block has been written it took too long until this data block was read back. Thus between the write and the read the clients (OPC or FIX) read the old data. Now after a write the driver reads the data block priorized. Build 127 : Solved problems: - The addressing range for PLC's input area and output area has been extended from 0..255 bytes to 0..4095 bytes. Build 126 : Solved problems: - Errors in manual and automatic block write functions has been fixed Build 125 : Solved problems: - Very fast consecutive analog writes to the same data block caused a crash of the S7ADRV.EXE process. This problem has been solved. Build 124 : Solved problems: - Different communication problems has been solved. - Design of message passing to driver window has changed to prevent the driver dead locks which occored under a very seldom conditions. Build 123 : Solved problems: - Changing of the IP-Address while the driver was running had no effect. This problem has been solved. Build 122 : New functions: - Now the devices within a channel processing in parallel mode - Added "Bytes per Second" to device and channel statistics - Logging of read/write requests/responses into a log file is now configurable for individual data blocks. File logging can basically be switched on/off at register page "advanced" in power tool's setup screen. - This version is already prepared to support the S7T loadable database block which will allow to work with the S7 TIME and TIME_OF_DAY data types in iFIX database. - Shared memory management has been changed to fix problems with large configurations and multi processor systems. Solved problems: - In previous versions the S7 rack number had no effect. Now it will be mapped into the right bit positions of the "called TSAP" field when opening the ISO connection within the TCP connection. - An error in output simulations mode was fixed. - An error in auto creation of data blocks was fixed. Build 121 : Solved problems: - When the slot and rack number in the device setings has been changed, the new values wasn't used when the connection has been re-established. Now the change of these parameters take place immediately. Fixed wrong display of Transmitted and Received counters of mission control's driver statistics Build 120 : Solved problems: - The OPC Server now supports read/write of Control-Tags (eg. !Send or !PollRate). Address syntax is equal to Tag I/O Address within FIX-Database. - Driver doesn't work when a channel with 8 devices was configured Build 119 : Solved problems: - Timeout value of channel template was not stored, thus it had no effect when a new channel was added. - IP-Address of device template was not stored, thus it had no effect when a new device was added. - To avoid duplicate Connection Numbers in Driver Device config, now these Connection Numbers are assigned automatically. The "Connection No" Field in Powertool's device configuration dialog is no longer enabled for input but for displaying the assigned Connection Number. - The driver devices are now limited to 8 per channel. - When running S7A driver on W2K without hardlock key (Sentinel or HASP) the Power Tool displayed an exception message box and the driver didn't start in demo mode. This problem has been solved. Build 118 : New function: - Additionaly to the Rainbow Sentinel Key the driver now supports new Aladdin HASP Key. It detects either Sentinel or HASP Key. Solved problems: - The OPC Server now supports String addresses Build 117 : Solved problems: - Now the Input Data Area of S7 can be read. That was not possible in build version 115 and 116. - The I/O address in data base builder now accepts inputs of adresses without blank between data area identifier and adress index (e.g. D11:Q1.7 or D11:I10.0). - Under a certain condidtion the S7ADrv process runs into a deadlock situation This problem has been solved. Build 116 : Solved problems: - Now the switching between primary and backup device can be configured and used. If the communication to the primary device fails, the driver automatically switches to the device configured as backup device. If the connection to the backup device fails, it switches back to the primary device. The switching even can be done by "hand" using a DI Block with I/O address "!switch:. A F_CV value of 0 means primary device is active, F_CV value 1 means backup device is active. To change the active device just assign the corresponding value to blocks F_CV property. Build 115 : Solved problems: none New functions: - To make troubleshooting easier, the driver now allowes to log messages to a log file. To enable file logging, set the following registry key value to 1: "HKLM\Software\Intellution\Drivers\S7A\DriverDefaults\WriteLogToFile" By default this value is set to 0 which disables the file logging. The log file is named S7ADrv.log and located in the drivers default config file path. All messages dispatched to the driver server window will be logged in the file as well. Caution: The log file will "not" be deleted and re-created when driver starts. It's in the users responsibility to watch the size of the log file. If you enable the dispatching of debug level 1 to 3 messages, the log file can become a huge size in a short time!! Build 114 : Solved problems: - If SAC writes faster to the driver's image table than the driver can write to the PLC, after a while the write queue filled up to 100%. This version of the driver no longer queues write requests to PLC addresses which already in the queue, but uses the already queued request by just replacing the old write value by the new value. - In configurations with more than 1 channel, the driver sometimes crashed since This problem has been solved. - The Send and Receive counts in mission control was swapped. New functions: - Driver now runs with dongle RN-4BDNBH-B (S7A) and RN-4CKEBH-B (S7A+S7B) Build 113 : Solved problems: - Error in S7AMemory.dll caused problem in applications with very large configurations (where the shared memory "S7A_InputArea" exceeded 64k). The data type information stored in the Input Area was overwritten to WORD. Thus the SAC Task interpreted the block values always as an integer no matter what data type was set for the data block in power tool. New functions: - none Build 112 : Solved problems: - CSV File import now works fine - When choosed S7M 1.x compatible address syntax, the data type combo box was been set to a data type other that saved before. New functions: - The S7-TIME format now is supported. Use a TX-blocks and the data type identifier 'T' in the Tag's I/O address to address a double word which contains a value in S7-TIME format (e.g. D11.DB100.DBT 10). Write is also possible. Build 111 : Solved problems: - Sometimes the CPU load raised to 100% when writing values. - Read/write of the last byte of a data block failed. - Block write in manaul or auto mode failed - In data block statistics sreen sometimes "stats error windows" occured because some error codes could not be found in AGLink_Error.txt file. New functions: - none Build 110 : Solved problems: - none New functions: - Added hardware options NULLTERM and SPACEFILL to control string write. Build 109 : Solved problems: - Sometimes driver hangs after communication failed. Occured when a lot of data blocks with a very short poll time has been configured and processed. New functions: - none

1,075

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧