com元件路径
描述公司上了一套erp客端有需要改的程序改好之后要一台一台地去更新得挺麻的。想一程序它自在客端一位置拷文件由于安安的路不一所以法取得固定路。后想到erp中的元件在注表中有注注的元件可以解析出erp安的路。一句如何安的com元件找到其存放路?
[解决办法]
http://www.delphibbs.com/keylife/iblog_show.asp?xid=12146
作者: 轻舞肥羊
标题: 列出COM+应用程序所有组件的DLL
关键字: COM+
分类: 开发技巧
密级: 公开
(评分: , 回复: 0, 阅读: 859) »»
轻舞肥羊发表于大富翁论坛
转载请标明出处,谢谢
procedure EnumDll ;stdcall;
const
SComApplicationName = 'MyApp ';
var
COMAdminCatalog : OleVariant;
Applications : OleVariant;
Components : OleVariant;
i : Integer;
j : Integer;
begin
COMAdminCatalog := CreateOleObject( 'COMAdmin.COMAdminCatalog ');
Applications :=
COMAdminCatalog.GetCollection( 'Applications ');
Applications.Populate;
for i := 0 to Applications.Count - 1 do
begin
if Applications.Item[i].Name = SComApplicationName then
begin
Components := Applications.GetCollection(
'Components ', Applications.Item[i].Key);
Components.Populate;
for j := 0 to Components.Count - 1 do
MessageBox(0, PChar(string(Components.Item[j].Value[ 'DLL '])), 'Path ', 0);
end;
end;
end;