Author: Dongfang Yishe
After finishing PHP4 calling JavaBean, I wanted to try calling COM again. I thought it was difficult at first. I wrote an Active Dll in VB6 and called it in PHP4. It succeeded immediately. It is much more convenient than calling JavaBean. Here are my steps.
The downloaded version is from http://www.mm4.de/.
One: Use VB6 to write Activex Dll
The code is as follows:
Option Explicit
Private MyScriptingContext As ScriptingContext
Private MyApplication As Application
Private MyRequest As Request Private MyResponse As Response
Private MyServer As Server
Private MySession As Session Public
Sub OnStartPage(PassedScriptingContext As ScriptingContext)
Set MyScriptingContext = PassedScriptingContext
Set MyApplication = MyScriptingContext.Application
Set MyRequest = MyScriptingContext.Request
Set MyResponse = MyScriptingContext.Response
Set MyServer = MyScriptingContext.Server
Set MySession = MyScriptingContext.Session
End Sub
Public Sub OnEndPage()
Set MyScriptingContext = Nothing
Set MyApplication = Nothing
Set MyRequest = Nothing
Set MyResponse = Nothing
Set MyServer = Nothing
Set MySession = Nothing
End Sub
Public Function Test_Number(num) As Variant
If num < ; 0 Then Get_Number_Attrib = -1
If num > 0 Then Get_Number_Attrib = 1
If num = 0 Then Get_Number_Attrib = 0
End Function
The specific method is as follows: Create a new VB6 project, and ActiveX Dll will The project is named P_test, and the class name is c_test
. The file content of the class is as above.
Compile and generate the p_test.dll file
Two: Register and run at the
prompt: regsvr32 p_test.dll
Third: Write the php file, the test.php4 code is as follows:
$b=new COM("p_test.c_test");
$a=$b->Test_Number(-454);
echo $a;
?>
Run php4 file -1 will be displayed
The problem you may encounter is that the project cannot be compiled. You need to reference the
Microsoft Active Server Pages Object Library
and implement "Project->References" to find the modified library. And check
In comparison, PHP4 calling com should be better than PHP4 calling javabean, because it is Ms system after all. You can also write your own controls for calling the database and use PHP4 to call them. To a certain extent, it is the same as PHP calling javabeans. It can be said that "hidden source code" is achieved.
This article comes from:

想了解更多关于开源的内容,请访问:51CTO鸿蒙开发者社区https://ost.51cto.com运行环境DAYU200:4.0.10.16SDK:4.0.10.15IDE:4.0.600一、创建应用点击File->newFile->CreateProgect。选择模版:【OpenHarmony】EmptyAbility:填写项目名,shici,应用包名com.nut.shici,应用存储位置XXX(不要有中文,特殊字符,空格)。CompileSDK10,Model:Stage。Device

如何使用Python调用百度地图API实现地理位置查询功能?随着互联网的发展,地理位置信息的获取和利用越来越重要。百度地图是一款非常常见和实用的地图应用,它提供了丰富的地理位置查询服务。本文将介绍如何使用Python调用百度地图API实现地理位置查询功能,并附上代码示例。申请百度地图开发者账号和应用首先,你需要拥有一个百度地图开发者账号,并创建一个应用。登录

楔子我们知道对象被创建,主要有两种方式,一种是通过Python/CAPI,另一种是通过调用类型对象。对于内置类型的实例对象而言,这两种方式都是支持的,比如列表,我们即可以通过[]创建,也可以通过list(),前者是Python/CAPI,后者是调用类型对象。但对于自定义类的实例对象而言,我们只能通过调用类型对象的方式来创建。而一个对象如果可以被调用,那么这个对象就是callable,否则就不是callable。而决定一个对象是不是callable,就取决于其对应的类型对象中是否定义了某个方法。如

Vue怎么通过JSX动态渲染组件?下面本篇文章给大家介绍一下Vue高效通过JSX动态渲染组件的方法,希望对大家有所帮助!

comcn和com的区别:1、comcn和com在含义等方面有区别,在访问速度上没有区别;2、comcn属于国际域名,是全球通用顶级域名,供商业机构使用,而cn是中国的公司域名,国内商业机构,国内域名,必须企业才可以备案;3、搜索的优先顺序是cn先会去搜索.cn,找到.cn服务器后,再由.cn服务器搜索.com;4、cn由cnnic中国互联网中心管理,com的管理机构在国外。

PHP摄像头调用技巧:如何实现多摄像头切换摄像头应用已经成为许多Web应用的重要组成部分,例如视频会议、实时监控等等。在PHP中,我们可以使用各种技术来实现对摄像头的调用和操作。本文将重点介绍如何实现多摄像头的切换,并提供一些示例代码来帮助读者更好地理解。摄像头调用基础在PHP中,我们可以通过调用JavaScript的API来实现摄像头的调用。具体来说,我们

在VSCode中开发Vue/React组件时,怎么实时预览组件?本篇文章就给大家分享一个VSCode 中实时预览Vue/React组件的插件,希望对大家有所帮助!

如何解决PHP开发中的外部资源访问和调用,需要具体代码示例在PHP开发中,我们经常会遇到需要访问和调用外部资源的情况,比如API接口、第三方库或者其他服务器资源。在处理这些外部资源时,我们需要考虑如何进行安全的访问和调用,同时保证性能和可靠性。本文将介绍几种常见的解决方案,并提供相应的代码示例。一、使用curl库进行外部资源调用curl是一个非常强大的开源库


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Atom editor mac version download
The most popular open source editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SublimeText3 Chinese version
Chinese version, very easy to use
