e股脑电脑教程网
  • 首 页
  • 操作系统
  • 应用软件
  • 下载工具
  • 影音视频
  • 办公软件
  • 媒体制作
  • 网站建设
  • 平面设计
  • 数据库
  • 程序开发
  • 视频教程
编辑推荐: | 文章搜索:
您现在的位置: e股脑 >> 程序开发 >> PowerBuilder教程 >> PB API调用原型 >> 教程正文
 
教程搜索
 
 
相关教程
  • 在PowerBuilder中利用DataStore实现查
  • 什么是“pbcat表?
  • 修改PB6的PBL,使之在PB5中可用
  • 使用日期格式时的一些问题
  • 如何存取二进制大对象(BLOBs)
  • 关于PowerBuilder的补丁包
  • 如果在isql中建立表或者增加表字段或者
  • PB高级开发环境配置
  • 动态设置Win95和NT的缺省打印机
  • PowerBuilder6.0运行环境文件列表
  • PowerBuilder、InfoMaker和HTML DataW
  • PB API调用原型
  • 如何用VC创建可在PB中调用的DLL
  • PB应用技巧——数据窗口自动折行
  • 为PB加入具有布局功能的容器组件
  • PB7.0通用选字段查询窗口的设计
 
 

图文教程


  • Windows抢了谁的饭碗 非主流操作系统To

  • 地球还是火星 平常心看“非主流”

  • 综合运用Office 2007批量制作奖状

  • 没有系统盘如何才能修复受损系统?

  • 巧妙运用Excel中边界的附加功能!
 
 
赞 助 商
 
 
PB API调用原型
  • 来源:e股脑
  • 点击次数:
  • 更新时间:2007-8-9
ason why Microsoft named the functions this way was to differentiate between (A)-Ascii and (W)-Unicode format. The MSDN does not always list the proper names for the functions. For example: GetFileVersionInfo is listed as a 32 bit function but it is in fact GetFileVersionInfoA.

5. Global versus Local External Function declaration. If the function is declared globally it can be called from anywhere in your application. If you declare the function as a Local External Function it can only be called from that window where it's declared. Local Function use less resources then globals but the difference is very minimal.


Error Messages and what they mean:

1. Error: Error opening DLL library <filename> for external function at line <line_number> in the <event name> event of object <object_name> of <window_name>.

Possible causes:

> DLL is 16 bit and thus incompatible.

> DLL is not in a searchable directory.

> DLL connects to another DLL that cannot be found.

> DLL has the same name as another already loaded into memory.

> DLL is corrupted or in an incompatible format.

2. Error: Error calling external function <function_name> at line <line_number> in the <event name> event of object <object_name> of <window_name>.

This is probably the result of an incorrectly spelt function name. Be sure to verify that the function name matches what is in the DLL exactly, including the case of the letters.

3. Error: Specified argument type differs from required argument type at runtime in DLL function <function_name>. (Invalid stack pointer on return from function call) at line <line_number> in <event_name> event of object <object_name> of <window_name>.

This error usually indicates the datatypes do not match what the DLL function is expecting.

4. PB050: Caused an Invalid Page Fault in module PBSHR050.DLL @ 0137:1111163e

This error can occur either immediately upon calling the function or when the application closes. The module and memory address may vary but the reason for this is usually the same. If PB is receiving a string and memory isn't allocated in advance using the SPACE( ) that string will overflow into another memory area. To allocate 12 characters to the string "ls_filename" the following code would be used.


ls_filename = space(13) // You may want to give it an extra space just to be safe.

5. Receiving garbage from the DLL. i.e. Last name populated as: "*#^&Ryan"

This problem is most likely the result of the byte alignment being set incorrectly. PowerBuilder expects the byte alignment to be set to one and if you are using MSVC++ compiler the default setting is four. To set the byte alignment to one you would need to do the following prior to compiling to a dll.

- Select the desired target

- Right mouse click and select Settings

- Select the C/C++ tabpage

- Select Code Generation from the Category dropdown list

- Select desired byte alignment from the Struct Member Alignment dropdown list.

The DOS switch to set the byte alignment to one is: /zp1

A handy trick to find functions quickly:

1. On Win95,Win98 or NT 4.0 click on the START button and select "Find", then "Files or Folders".

2. In the SLE entitled "Named" enter "c:\*.dll". If this is a Windows DLL that you'll be calling enter "c:\windows\*.dll".

3. Click on the "Advanced" tab and in the "Containing Text" SLE enter the exact function name you are looking for. For example: FindWindowA

4. There will usually be a lot of DLL's that contain the function you are looking for but try to use the main Windows DLL's whenever possible since they are already loaded into memory.


Related Faxlines:

47626 - External Functions Calls to the DLLs created using Visual C++

44596 - 16 Bit - Windows API Calls for PowerBuilder 4.0, 5.0 & 6.0

44545 - 32 Bit - Windows API Calls for PowerBuilder 5.0

44648 - Prototyping API Calls for PowerBuilder 4.0, 5.0 and 6.0

44588 - Dynamically Closing a Non-PowerBuilder Application

47703 - GPF's and The PowerBuilder Memory Defragger

47704 - Windows 3.10 and 3.11 Functions - Krnl386.exe, User.exe, Gdi.exe

47707 - 16 Bit - Win95 and NT Functions - Krnl386.exe, User.exe, Gdi.exe

47705 - 32 Bit - Win95 and NT Functions - Kernel32.dll, User32.dll, Gdi32.dll

44474 - Exter

上一页  1 2 3 4 下一页
  • 上一篇教程: 如何用VC创建可在PB中调用的DLL
  • 下一篇教程: PowerBuilder、InfoMaker和HTML DataWindow的配置文件
  •  

    关于本站 | 广告联系 | 版权声明 | 使用帮助

    Copyright © 2004-2008 www.egunao.com All rights reserved.