只需要将它设为nil就可以了,系统会自动释放。因为com是基于引用管理的,当它的计数为零时,会自动释放。
相关推荐
delphi中用CreateOleObject操作word的例子
delphi中用CreateOleObject操作word的例子,自己写的。可以添加,保存,修改,支持word的好几种格式,把word嵌入到pannel中等。很好用的开发程序例子。比olecontiner好用多了。需要引用单元comobj.pas 我用的是delphixe版本写的。
Delphi 控制Excel 例子,参考资料
个人收藏:Delphi 控制Excel(一) 使用动态创建的方法首先创建 Excel 对象,使用ComObj:var ExcelApp: Variant;ExcelApp := CreateOleObject( Excel.Application );1) 显示当前窗口:ExcelApp.Visible := True;2) 更改 Excel 标题栏:ExcelApp.Caption :=
HAL库STM32CubeMX+DHT11温湿度传感器模块化驱动与OLED显示实战
本文详细介绍了基于HAL库和STM32CubeMX开发DHT11温湿度传感器模块化驱动的实战过程。通过精确的时序控制和模块化封装,实现了传感器数据采集,并结合OLED显示模块实时展示温湿度信息,为嵌入式开发者提供了完整的解决方案。
delphi中关于使用CreateOleObject方法控制word的一些心得。将word放入到pannel中
delphi中关于使用CreateOleObject方法控制word的一些心得,需要引用comobj单元。我只打开的函数,供大家分享。 打开word时,处理异常。使用GetActiveOleObject方法如果存在内存存在就直接调用,否则得创建;插入数据等操作…… procedure TfrmMain.N1Click(Sender: TObject); var h:THandle
忘记安卓锁屏密码怎么办?3种方法教你用ADB恢复访问(含gesture.key解密)
本文详细解析了安卓设备锁屏密码的存储与加密机制,特别是gesture.key文件的解密原理。针对遗忘密码的常见问题,提供了三种核心恢复方法:利用ADB调试接口删除密码文件、对gesture.key进行离线分析与解密,以及应对高版本系统的替代方案。重点介绍了通过ADB工具在Recovery模式下操作的具体步骤,帮助用户在合法合规前提下恢复设备访问权限。
实战解析:利用Wireshark解密QQ通信协议
本文提供了一份利用Wireshark工具分析QQ通信协议的实战指南。文章详细介绍了从环境准备、捕获数据包到解析协议层的完整流程,重点演示了如何识别QQ号码字段、观察加密数据特征以及区分不同通信类型(如文本、文件传输)。通过此实践,读者可以深入理解网络分层模型和现代应用加密通信机制,提升网络协议分析与安全诊断能力。
在Delphi中使用CreateOleObject方法对WORD文件进行操作
使用CreateOleObject方法对WORD文档操作具有先天所具备的优势,与delphi所提供的那些控件方式的访问相比,CreateOleObject方法距离WORD核心的操作“更近”,因为它直接使用OFFICE所提供的VBA语言对WORD文档的操作进行编程。以下是我在本机上所做的实验,机器软件配置如下:Windows XP+delphi7.0+OFFICE 2003这个程序很简单,在页面上放
ClaudeCode 通过 CC Switch 配置 Ollama 本地大模型
本文介绍了如何让Claude Code使用本地免费模型qwen3.5:9b而无需Anthropic API Key的方法。主要内容包括:1)安装Claude Code、CC Switch代理工具和Ollama本地模型运行时;2)配置环境变量和设置文件将请求转发到本地服务;3)详细说明了系统架构和工作原理,展示请求如何从Claude Code经CC Switch代理到Ollama本地模型。该方案通过代理拦截和转发机制,实现了使用免费开源模型替代官方API的功能。
delphi excel 对象释放
代码如下: ... ExcelApp,workbook: Variant; ... ExcelApp:=CreateOleObject( 'Excel.Application '); workbook:=CreateOleObject( 'Excel.sheet '); 上次大家给我的代码是: workbook.close; Exc
CHNS数据库下载与使用指南:从申请到导入的全流程解析
面板数据是经济学与公共卫生实证研究的重要支撑。中国健康与营养调查(CHNS)自1989年持续追踪中国居民的家庭与个人健康、营养及经济行为,为研究者提供了跨度近三十年的纵向微观数据。理解CHNS的数据组织原理与申请机制,是高效利用该数据的前提。该数据广泛适用于健康经济学、膳食营养分析及公共政策评估等场景。围绕CHNS的下载流程,完整梳理了注册申请、数据文件解析以及Stata、R、Python三种工具的读取方法,并针对邮箱验证、文件损坏、ID匹配等常见问题提供排查建议,帮助研究者快速建立数据处理基础。
Newton & Nvidia 开源 GPU 加速机器人仿真器入门教程(一)
Newton 是一个 GPU 加速、可扩展和可微分的物理仿真引擎,专为机器人、研究和高级仿真工作流而设计。Newton 基于 NVIDIA Warp 并集成了 MuJoCo Warp,为用户和开发人员提供了高性能仿真、现代 Python API 和灵活的架构。
使用CreateOleObject时报错--'无效的类别字符串'
使用CreateOleObject时报错--'无效的类别字符串' Delphi / Windows SDK/APIhttp://www.delphi2007.net/DelphiAPI/html/delphi_20061127173640163.html 我在使用函数CreateOleObject(Purchasing.COM)时报如下的错误。在执行该语句之前,我已经用Registe...
【基于深度学习的脑电图识别】数据集篇:THE TUH EEG CORPUS: A Big Data Resource for Automated EEG Interpretation
【基于机器学习的脑电图识别】数据集篇:脑电信号自动判读的大数据摘要: 摘要: 这个数据集包括超过 25000 个脑电图研究,包括一个神经学家对测试的解释,一个简短的病人病史和关于病人的人口统计信息,如性别和年龄。这是第一次有足够的数据来支持最先进的机器学习算法的应用。在这篇论文中,我们使用了3762个语料库的会话子集,展示了从原始脑电图信号数据预测脑电图的一些基本属性的初步实验结果。在闭环测试中,...
delphi中使用词霸2005的动态库XdictGrb.dll实现屏幕取词
近日来,在网上发现关于屏幕取词技术的捷径,搜索很长时间,发现实现方式以VB出现的居多,但是通过Delphi来实现的却好象没有看到,自己参考着VB的相关代码琢磨了一下通过delphi来实现的方式。 其实也差不多,唯一不同的只有一个地方就是取词对象GrabProxy的AdviseGrab这个方法,该方法的参数是一个IXDictGrabSink的接口类型,在Vb中是AdviseGr
jdk-8u144-linux-x64.tar.gz.
该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包
深度学习工具包 DeepLearningToolbox
深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[](https://bitdeli.com/free "Bitdeli Badge")
关于CreateOleObject函数的调用问题(用友U86登陆界面调用)
关于CreateOleObject函数的调用问题(用友U86登陆界面调用) Delphi / Windows SDK/APIhttp://www.delphi2007.net/DelphiAPI/html/delphi_20061129223145148.html 我用CreateOleObject调用COM控件,跟踪发现他在使用该函数时没有问题,当调用里面的函数时,第一次调试调用成...
SIMATIC S7-1200, S7-1500 PID 控制[手册]
SIMATIC S7-1200, S7-1500 PID 控制[手册]
delphi中通过CreateOleObject操控Word
上图为最终的WORD内容,看似简单,实则不易(研究了一天才得出所要的结果)。 在开发的过程中,请配合Word中的宏与VBA帮助文档(Microsoft Office\OFFICE11\2052\VBAWD10.CHM) 开发环境:delphi7+xp+word2003 uses comobj, word2000; procedure TForm1.Button1Clic
LinePhone3.2.7(android端最新版本) sip客户端
SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/
Delphi 对象的创建(create)与释放(free/destory)
create后一定要free吗? 简单举例 procedure a; var x:TX; begin x:=TX.create; //do someting; x.free //如果我这里不free,到了这个end不就是相当于C中的}自动释放吗? 也就是说在此处这个free是多余的
delphi公用函数
{*******************************************************}{ }{ Delphi公用函数单元 }{
delphi 编写的com 对象 用delphi 的调用实例
delphi 编写的com 对象 用delphi 的调用实例COM 对象与 前一篇文章的 PHP调用的COM为同一个对象,故不例出COM. procedure TForm1.Button4Click(Sender: TObject);var myCounter, mReturn: variant;begin myCounter := CreateOleObject(
DELPHI,Office编程1
====================================================== 注:本文源代码点此下载 ====================================================== 1、可供选择的技术: (1) 通过delphi的控件tolecontainer 将office嵌入,这是最简单的ole嵌入,能够直接将offic
delphi 在多线程中使用 CreateOleObject 导致失败
原帖地址 http://bbs.youkuaiyun.com/topics/390481350 解决办法 procedure DisplayVideoInfo; var wmi, objs, obj : OleVariant; enum : IEnumVariant; value : Cardinal; beg
4068



被折叠的 条评论
为什么被折叠?



