[Delphi] 调用ocx
function RegisterDllServer(FileName: string): boolean;
var
nDllAddr: integer;
bstr: string;
ProcAddr: Pointer;
str: PAnsiChar;
begin
Result := False;
if not FileExists(FileName) then
exit; nDllAddr:=LoadLibrary(PChar(FileName));
if nDllAddr <> then
begin
bstr:='DllRegisterServer'+chr(); str := PAnsiChar(AnsiString(bstr));
ProcAddr := GetProcAddress(nDllAddr,str);
if ProcAddr<>nil then
begin
CallWindowProc(ProcAddr,nDllAddr,,,);
Result := True;
end;
FreeLibrary(nDllAddr);
end;
end; procedure Tfrmexceltoocx.Button1Click(Sender: TObject);
var
ocx: objclass;
begin
try
CoInitialize(nil);
ocx := CreateOleObject('aaa.objclass') as objclass;
except
RegisterDllServer('D:\Documents\aaa.ocx');
Exit;
end;
end;
记录一下,脑子记不住
[Delphi] 调用ocx的更多相关文章
- Delphi开发OCX详细步骤总结
首先要弄明白你要写的OCX是用在客户端还是用在服务器端 假如用在客户端: 1.创建 打开delphi 7,选择菜单"new"->"other"- ...
- Delphi开发ocx插件的调试
Delphi开发ocx苦于调试,网上看了下大概配置: IE调用ocx调试配置,在当前ocx工程 run-->parameters-->host application 里面配置IE的程序 ...
- Delphi 调用C# DLL(包含委托)
例子 C# Dll: using System; using System.Collections.Generic; using System.Text; using System.Diagnosti ...
- Delphi调用REST
Delphi调用REST很简单,首先在界面上放上: RESTClient1: TRESTClient; RESTRequest1: TRESTRequest; RESTResponse1: TREST ...
- delphi调用web service出现 Unable to retrieve the URL endpoint for Service/Port .....
delphi调用web service出现 Unable to retrieve the URL endpoint for Service/Port, 错误截图如下 查了很长时间, 发现在DataM ...
- Delphi 调用外部程序并等待其运行结束
转自:http://blog.csdn.net/xieyunc/article/details/4140620 如何让Delphi调用外部程序并等待其运行结束 1. uses Window ...
- fastscript调用delphi方法和DELPHI调用FASTSCRIPT方法
fastscript调用Delphi过程: 1. 先创建事件处理方法:TfsCallMethodEvent 2. 然后再用调用TfsScript.AddMethod方法,第一个参数为Delphi方法 ...
- 【转】Delphi调用webservice总结
原文:http://www.cnblogs.com/zhangzhifeng/archive/2013/08/15/3259084.html Delphi调用C#写的webservice 用delph ...
- Delphi 调用netsh命令修改IP地址
Delphi 调用netsh命令修改IP地址 先介绍一下Netsh命令的使用方法: 在这里跟大家介绍几个简单的指令 1.Show IP 1.1Cmd Mode 直接在cmd下面输入 netsh int ...
随机推荐
- python学习笔记(locust性能测试模块)
locust是基于python的性能测试工具.支持python2.7及其以上的版本.相对于主流的LR与Jmeter工具使用的方式不一样.locust是通过编写python代码来完成性能测试的. 通过L ...
- Solaris11 Vsphere client tool 的鼠标问题
Mouse does not function on a Solaris 11 virtual machine (2040498) http://kb.vmware.com/selfservice/m ...
- Android------实现图片双击放大,缩小,左右滑动的多种方式
项目中常常有图片浏览功能.像微信朋友圈图片浏览,QQ空间照片浏览 的功能. 实现图片双击放大,缩小,左右滑动等效果. 来看看我的效果图,希望能满足你的要求 前三个button按钮是参考网上的多种实 ...
- Leetcode 62
//从理解二维dp到简化成一维dp我用了一年的时间class Solution { public: int uniquePaths(int m, int n) { vector<); ;i &l ...
- 网路防火墙iptables
linux操作系统自身可以充当交换机,还可以当路由器,也就是说linux多网卡之间拥有互相转发数据包的能力,这种能力的实现主要依靠的是防火墙的功能进行数据包的转发和入站. 路由选择点,就是在一个点分辨 ...
- C语言----------链表的简单实现与操作
链表是一种物理存储单元上非连续.非顺序的存储结构,数据元素的逻辑顺序是通过链表中的指针链接次序实现的. 链表由一系列结点(链表中每一个元素称为结点)组成,结点可以在运行时动态生成. 每个结点包括两个部 ...
- 【LeetCode 232_数据结构_队列_实现】Implement Queue using Stacks
class Queue { public: // Push element x to the back of queue. void push(int x) { while (!nums.empty( ...
- java中可以让程序暂停几秒执行的代码
//n为毫秒数 try { Thread.sleep ( n ) ; } catch (InterruptedException ie){} try { TimeUnit.SECONDS.sleep( ...
- LR 解压缩函数(wgzMemDecompressBuffer)失败 Code=-5
用LR做压力测试的时候有时会报错 “解压缩函数(wgzMemDecompressBuffer)失败 返回Code=-5”. Google了一把,也没有解决掉. 因为有些脚本运行时没有问题,感觉可能和请 ...
- Linux:shell脚本字符显示特殊颜色效果
shell脚本字符显示颜色和特殊效果 (一) 颜色显示 1)字符颜色显示 #!/bin/bash #字符颜色显示 #-e:允许echo使用转义 #\[:开始位 #\[0m:结束位 #\033等同于\e ...