【delphi通过函数名动态调用函数的方法】教程文章相关的互联网学习教程文章

在.net中调用Delphi dll的Pchar转换【代码】

Pchar是非托管代码,要在.net中调用Delphi dll中的功能,请使用MarshalAs属性告知.net调用PInvoke去转换.net中标准的string类型。如果Delphi dll是Delphi2007以前的版本编译的,则Pchar是Ansi类型;如果Delphi dll是Delphi2009以后的版本编译的,则Pchar是Unicode类型。请看以下实例。Ansi类型:[DllImport("my.dll")] [return: MarshalAs(UnmanagedType.LPStr)] publicstaticextern String GetMyNickName( [MarshalAs Unmanaged...

问题-[Delphi]SendMessageTimeout调用后卡住点击任务栏还会出现窗体处理

问题现象:在使用SendMessageTimeout函数后,5秒后WIN把进程挂在起。这时把程序最小化(原因就是不想让用户看到卡的界面),但点击任务栏按钮界面还原了,拦截消息失败(原因是挂起后消息都放在队排中了),怎么才能不接收还原呢?处理方法:最小化前把界面的Application.MainForm.BorderStyle:= bsNone;设置一下就可以了。原文:http://www.cnblogs.com/FKdelphi/p/4654671.html

Delphi DLL文件的动态调用【图】

樊伟胜原文:https://www.cnblogs.com/fanweisheng/p/11378833.html

Delphi按名字调用方法高级解决方案

Delphi按名字调用方法高级解决方案 博客分类: 编程基础DelphiJ#ASPDOS数据结构 按名字调用方法似乎一直以来都是大家比较关注的技术,在论坛上有一个经典的答复: type TProcedure = procedure(Test: string) of object; procedure ExecuteRoutine(Obj: TObject; Name, Param: string); var PMethod: TMethod; AProcedure: TProcedure; begin PMethod.Data := Pointer(Obj); PMethod.Code := Obj.MethodAddre...

转:Delphi10.3 中通过JNI调用 Java 函数

现在很多SDK都提供了JAVA接口。但是没有Delphi接口。没有办法只好曲线救国。我们可以通过 JNI 的方式在 Delphi10.3 中调用 Java 的函数。第一步:创建 Java 虚拟机和运行环境procedure TForm1.FormCreate(Sender: TObject);var Options: array [0 .. 4] of JavaVMOption; VM_args: JavaVMInitArgs; ErrCode: Integer;begin { 创建 Java 虚拟机 } FJavaVM := TJavaVM.Create(JNI_VERSION_1_8); Options[0]...

?Delphi开发WebService给ASP.NET调用【图】

Delphi开发WebService给ASP.NET调用说明:1、本文档分3个部分,分别为:用Delphi编写WebService在IIS下部署WebService在ASP.NET中调用webservice2、开发环境为Windows XP SP2、Delphi 7.0、IIS 5.1、VS 2008(C#) 一、用Delphi编写WebService第1步:File → New → Other → WebServices → SOAP Server Application 第2步:选择ISAPI/NSAPI Dynami Link Library 第3步:选择Yes第4步:输入接口的名称,这里用Main,其他选项不用改...

Delphi调用C++写的dll示例【代码】

最近做一个读市民卡的项目,读卡器公司提供的读市民卡dll是用C++写的。下面记录一些自己的心得,供需要的朋友参考。声明dll函数要加上stdcall关键字,否则可能会报地址非法的错误。 代码:unit cMain;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, DB, ADODB, StdCtrls, ComCtrls,ActiveX, ExtCtrls;typeTForm1 = class(TForm)btnReadICard: TButton;Memo1: TMemo; proc...

Mixing Delphi and C++(相互调用)

Mixing Delphi and C++You have a TStringList and <algorithm>. What can you do? Quite a lot, actually. Did you know that as of RAD Studio 10.1 Berlin, Delphi‘s inbuilt containers, such as TList, the Generics. Collections containers, all enumerable types, and arrays, can be used from C++ using standard algorithms, iterators, and range-based for loops? This blog post contains a Youtube video of the C...

Delphi的Win32的API调用简单介绍

转载自:https://www.cnblogs.com/xumenger/p/4319354.html1. 介绍Win32 API和Win32系统。还要讨论Win32系统的功能以及它与16位系统在功能上的几个主要区别。只是让对Win32系统有一个基本的了解。当已经基本了解Win32操作后,就可以在任何需要的时候使用Win32系统提供的高级功能了。2. Win32环境中有两种基本的对象类型:内核对象和GDI/用户对象。 内核对象是Win32系统原有的,包括事件、文件映射、文件、邮件槽、互...

Delphi里可将纯虚类实例化,还可调用非虚函数

这是与Java/C++的巨大不同。目前还没仔细想这个特征与TClass之间的联系,先记住结论再说。以后再回来修改这个帖子。 unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } en...

Delphi调用webservice总结【图】

Delphi调用C#写的webservice 用delphi的THTTPRIO控件调用了c#写的webservice。下面是我调试时遇到的一些问题:1:导入wsdl文件:file--new----other----webservice---WSDLimporter---输入wsdl地址:如下:http://127.0.0.1/ WebService/WebServiceCall.asmx?wsdl注意末尾的:‘?wsdl‘不能少。要不可能会说找不到。2:设置THTTPRIO控件的属性:把http:// 127.0.0.1 /WebService/WebServiceCall.asmx?wsdl赋给URL属性,而不是赋给wsd...

Delphi调用C#动态链接库DLL(摘自网络)

实现步骤:1、生成密钥文件用于给程序集强名称签名(必须)sn -k MyKey.snk 2、使用强名称签名的Key编译成类库Tester.DLLcsc /t:library /keyfile:MyKey.snk Tester.cs3、生成类型库 (此tlb文件提供给Delphi导入, 使用OLE方式调用此步可省略了)tlbexp Tester.dll /out:Tester.tlb 4、生成注册DLL的注册表文件regasm Tester.DLL /regfile:Tester.reg5、运行Tester.reg将上面四个步骤打包成一个BAT文件自动生成DLL, 在运行Delphi程序前请...

Delphi7调用DelphiXE编写的DLL问题【图】

http://bbs.csdn.net/topics/380045353用DelphiXE在WIN2008下编写一个访问WebServices的DLL ws.dll,只有一个输出函数,如下:function Login(URL:PAnsiChar; UserName: PAnsiChar; UserPass: PAnsiChar; LocalLogin: Boolean):PAnsiChar;var tStr:String;begin try Result := PAnsiChar(GetLoginSoap(True,URL + WSDL_Login,nil).Login(UserName,UserPass,LocalLogin)); tStr := ‘成功‘; ...

delphi通过函数名动态调用函数的方法

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TMyCacl = class(TObject) public { Public declarations } function DynamicFun(funName: string; const a, b: integer): integer; published function add(const a, b: integer): integer; function dec(const a, b: integer): integer; end; TNewMyCacl = class(TMyCacl) ...

delphi 双击dbgrid 调用另一窗体的例子

unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids, DBGrids, DB, ADODB, StdCtrls;type TForm1 = class(TForm) DataSource1: TDataSource; ADOTable1: TADOTable; DBGrid1: TDBGrid; Button1: TButton; procedure DBGrid1DblClick(Sender: TObject); private { Private declarations } public { Public declarations } // var ...