两种DCOM的注册问题? (200分)

  • 主题发起人 主题发起人 lccc
  • 开始时间 开始时间
L

lccc

Unregistered / Unconfirmed
GUEST, unregistred user!
查了很多资料,没有一个说清楚的!现在此高分求解DCOM的分发和注册问题的答案。不要告
诉我使用DCOMCNFG.EXE,我的程序的配置需要做到安装程序中去!只对说明注册表设置的给
分,不够再加!!!!
1、关于远程进程内服务器的问题:
A、要求在客户端只分发tlb文件; B、要求DLL文件只能在服务器上。
问:
(1)、客户端的注册表如何设置? (2)、服务器端的注册表又如何设置?
2、关于远程进程外服务器的问题:
A、要求在客户端只分发tlb文件; B、要求EXE文件只能在服务器上。
问:
(1)、客户端的注册表如何设置?(2)、服务器端的注册表又如何设置?
 
告诉你吧,其实你什么错也没有,错的是微软,随便你怎么装都对,只可惜DCOM天生受网关,域,防火墙等等原因的控制,你要想连通非的掉一层皮不可,在XP上你就不要抱希望了,设置的复杂程度不亚于,你重写一编程序。解决方法有一个,不知你办的到吗。
Server端 win2000 server Client端 win2000 pro 把所有client端的用户加到server上
最好都是power user ,客户端运行以下server程序即可,然后把连接指向服务器即可。
其实就是一种把安全协议降到最低的做法,除此之外别无出路,现在大家都用SocketCom来做三层,你怎么还用DCOM?可以说DCOM的安全协议基本上是跟windows捆绑在一起的,
 
抱歉,停电,今天才答复!
肯定是比较困难的,不然怎么没一个答案!
另外,ADO与SQLServer都是采用了COM,但从
客户端使用ADO连接SQL还是很容易的!查了一
下MSDN上的问题,查到一条关于DCOM设置的比较
直接的说明:
Follow these steps to change the registration of an out-of-process OLE server manually from remote automation to DCOM:
Remove the LocalServer32 and InprocServer32 subkeys of the component's CLSID key.
Change the client registry as follows:
[HKEY_CLASSES_ROOT/CLSID/{ Put Component CSLID Here }]
"AppID"="{ Put Component CSLID Here }"
[HKEY_CLASSES_ROOT/APPID/{ Put Component CSLID Here }]
="Put Component App Name Here"
[HKEY_CLASSES_ROOT/APPID/{ Put Component CSLID Here }]
"RemoteServerName"="Put Remote Server name Here"
[HKEY_CLASSES_ROOT/APPID/Put Component File Name Here]
"APPID"="{ Put Component CSLID Here }"
Use the DCOMCNFG.EXE tool in the server's Windows NT 4.0 or Windows 2000 system32 directory to specify access and launch permissions for the server.
我按照这个要求设置了,还是无法连接!
 
我也找了很久了,帮你提前,DCOM不行
 
A、要求在客户端只分发tlb文件;
OLECheck();
B、要求DLL文件只能在服务器上。
Dll 是 Com+的吗?? 这个要装在组件服务里面,具体改了那些注册表
我也不知道,跟踪一便应该知道的,好像他连接扣方法都注册啦,不但是
一个guid。
还是比较麻烦,但是服务器都不用来自己装怕是有点小气拉!
 
to 人在昆明:
之所以限制DLL文件不能放到客户端,主要是不想让DLL文件或EXE文件
未经允许的散发。
另外,我们的客户公司的操作人员的素质较低,50岁的大妈不少,而客户
的数量又比较多,老是派人到客户处安装和配置,工作量实在是太大,我们的
想法是:直接写在安装程序中,在安装中配置:安装服务端时输入客户端机器
名称等信息,安装客户端输入服务器名称等信息即可。另外为防备机器改名称
等意外情况,再写了一个客户-服务器连接维护程序,都需要直接操作注册表,
所以需要了解DCOM配置与注册表的对应关系!

急急急急!
 
限制或者因为安装客户端麻烦,可以把dll 都存到数据库中,
然后做一个最简单的安装程序,检查客户机器本地是否有dll,
是否有权限,dll 版本是否比数据库中的旧,来决定是否把
dll下载到客户机,com 服务器应该没有几台吧,估计这个东西
不用手工安装可能比较麻烦,这种没试验过,还有,好像客户机
改机器名等等 不会影响com访问。
 
资料上有的
 
应该是权限的问题.我也遇到过.
 
To 魔鬼大师:
资料何在????
我的邮箱:lccclgb@sina.com
 
帮你UP,确实没有太好的办法。
 
我也要 netup@163.com
 
是不是微软的DCOM有什么安全漏洞,不敢公开DCOM的设置。
详细说明一下(如何修改注册表)对微软肯定是非常简单的事
情,因为微软必定在各种操作系统之间进行过DCOM的测试!
 
为什么不用SocketConnection控件?
 
To Xianguo:
我比较喜欢夸过去,而不是绕过去!!
而且Delphi的连接组件需要分发一些Dll文件,可能出现问题(如别人的
程序使用更新的DLL,而我的不能使用等等。安装了一个程序,另外一个程序
就不能运行的情况是比较常见的),解决起来比较麻烦!使用纯粹的DCOM,客
户端除了客户程序,一般不再需要分发其它文件,我比较喜欢!!!
 
我做的也是没办法,只能手工配置dcom
 
真的没有答案吗?????????????
????????????????????
 
!!!!!我也要资料!!!!
!!!!!我也要答案!!!!
 
富翁们到哪里去了??????
大富翁上难道没有高手????????
 
if (State <> bsDisabled) and (Ord(State) >= NumGlyphs) then
State := bsUp;
Result.B := True;
Result.I := FIndexs[True, State];
if Result.I = -1 then
begin
Result.B := False;
Result.I := FIndexs[False, State];
end;
if Result.I <> -1 then
Exit;
if FImageList = nil then
begin
if (FOriginal.Width = 0) or (FOriginal.Height = 0) then
Exit;
UsesMask := (FOriginalMask.Width <> 0) and (FOriginalMask.Height <> 0);
end
else
begin
if (FImageIndex < 0) or (FImageIndex >= FImageList.Count) then
Exit;
UsesMask := False;
end;
B := State <> bsDisabled;
{ + AddPixels is to make sure the highlight color on generated disabled glyphs
do
esn't get cut off }
if FImageList = nil then
begin
IWidthA := FOriginal.Width div FNumGlyphs;
IHeightA := FOriginal.Height;
end
else
begin
IWidthA := TCustomImageListAccess(FImageList).Width;
IHeightA := TCustomImageListAccess(FImageList).Height;
end;
IRectA := Rect(0, 0, IWidthA, IHeightA);
AddPixels := Ord(State = bsDisabled);
IWidth := IWidthA + AddPixels;
IHeight := IHeightA + AddPixels;
IRect := Rect(0, 0, IWidth, IHeight);
if FGlyphList = nil then
begin
if GlyphCache = nil then
GlyphCache := TGlyphCache.Create;
FGlyphList := GlyphCache.GetList(IWidth, IHeight);
end;
{$IFDEF TB97D3}
IsHighColorDIB := (FImageList = nil) and (FOriginal.PixelFormat > pf4bit);
{$ENDIF}
OriginalBmp := nil;
OriginalMaskBmp := nil;
TmpImage := nil;
MaskBmp := nil;
try
OriginalBmp := TBitmap.Create;
OriginalBmp.Assign (FOriginal);
OriginalMaskBmp := TBitmap.Create;
OriginalMaskBmp.Assign (FOriginalMask);
TmpImage := TBitmap.Create;
TmpImage.Width := IWidth;
TmpImage.Height := IHeight;
TmpImage.Canvas.Brush.Color := clBtnFace;
if FImageList = nil then
TmpImage.Palette := CopyPalette(OriginalBmp.Palette);
I := State;
if Ord(I) >= NumGlyphs then
I := bsUp;
SourceRect := Bounds(Ord(I) * IWidthA, 0, IWidthA, IHeightA);
if FImageList <> nil then
begin
MaskBmp := TBitmap.Create;
MaskBmp.Monochrome := True;
MaskBmp.Width := IWidthA;
MaskBmp.Height := IHeightA;
ImageList_Draw (FImageList.Handle, FImageIndex, MaskBmp.Canvas.Handle,
0, 0, ILD_MASK);
end;

if State <> bsDisabled then
begin
if FImageList = nil then
begin
TmpImage.Canvas.CopyRect (IRectA, OriginalBmp.Canvas, SourceRect);
if not UsesMask then
begin
{$IFDEF TB97D3}
{ Use clDefault instead of FTransparentColor whereever possible to
ensure compatibility with all video drivers when using high-color
(> 4 bpp) DIB glyphs }
FIndexs[B, State] := FGlyphList.AddMasked(TmpImage, clDefault);
{$else
}
FIndexs[B, State] := FGlyphList.AddMasked(TmpImage, FTransparentColor);
{$ENDIF}
end
else
begin
MonoBmp := TBitmap.Create;
try
MonoBmp.Monochrome := True;
MonoBmp.Width := IWidth;
MonoBmp.Height := IHeight;
MonoBmp.Canvas.CopyRect (IRectA, OriginalMaskBmp.Canvas, SourceRect);
FIndexs[B, State] := FGlyphList.Add(TmpImage, MonoBmp);
finally
MonoBmp.Free;
end;
end;
end
else
begin
ImageList_Draw (FImageList.Handle, FImageIndex, TmpImage.Canvas.Handle,
0, 0, ILD_NORMAL);
FIndexs[B, State] := FGlyphList.Add(TmpImage, MaskBmp);
end;
end
else
begin
MonoBmp := nil;
DDB := nil;
try
MonoBmp := TBitmap.Create;
{ Uses the CopyBitmapToDDB to work around a Delphi 3 flaw. If you copy
a DIB to a second bitmap via Assign, change the HandleType of the
second bitmap to bmDDB, then
try to read the Handle property, Delphi
converts it back to a DIB. }
if FImageList = nil then
DDB := CopyBitmapToDDB(OriginalBmp)
else
begin
DDB := TBitmap.Create;
DDB.Width := IWidthA;
DDB.Height := IHeightA;
ImageList_Draw (FImageList.Handle, FImageIndex, DDB.Canvas.Handle,
0, 0, ILD_NORMAL);
end;
if NumGlyphs > 1 then
with TmpImage.Canvasdo
begin
CopyRect (IRectA, DDB.Canvas, SourceRect);
{ Convert white to clBtnHighlight }
if not IsHighColorDIB then
GenerateMaskBitmap (MonoBmp, DDB, SourceRect.TopLeft,
IRectA.BottomRight, [GetNearestColor(OriginalBmp.Canvas.Handle, clWhite)])
else
GenerateMaskBitmapFromDIB (MonoBmp, OriginalBmp, SourceRect.TopLeft,
IRectA.BottomRight, [clWhite]);
ReplaceBitmapColorsFromMask (MonoBmp, TmpImage, IRectA.TopLeft,
IRectA.BottomRight, clBtnHighlight);
{ Convert gray to clBtnShadow }
if not IsHighColorDIB then
GenerateMaskBitmap (MonoBmp, DDB, SourceRect.TopLeft,
IRectA.BottomRight, [GetNearestColor(OriginalBmp.Canvas.Handle, clGray)])
else
GenerateMaskBitmapFromDIB (MonoBmp, OriginalBmp, SourceRect.TopLeft,
IRectA.BottomRight, [clGray]);
ReplaceBitmapColorsFromMask (MonoBmp, TmpImage, IRectA.TopLeft,
IRectA.BottomRight, clBtnShadow);
if not UsesMask then
begin
{ Generate the transparent mask in MonoBmp. The reason why
itdo
esn't just use a mask color is because the mask needs
to be of the glyph -before- the clBtnHighlight/Shadow were
translated }
if not IsHighColorDIB then
GenerateMaskBitmap (MonoBmp, DDB,
SourceRect.TopLeft, IRectA.BottomRight, FTransparentColor)
else
GenerateMaskBitmapFromDIB (MonoBmp, OriginalBmp,
SourceRect.TopLeft, IRectA.BottomRight, [-1]);
end
else
MonoBmp.Canvas.CopyRect (IRectA, OriginalMaskBmp.Canvas, SourceRect);
with MonoBmpdo
begin
Width := Width + AddPixels;
Height := Height + AddPixels;
{ Set the additional bottom and right row on disabled glyph
masks to white so that it always shines through, since the
bottom and right row on TmpImage was left uninitialized }
Canvas.Pen.Color := clWhite;
Canvas.PolyLine ([Point(0, Height-1), Point(Width-1, Height-1),
Point(Width-1, -1)]);
end;

FIndexs[B, State] := FGlyphList.Add(TmpImage, MonoBmp);
end
else
begin
{ Create a disabled version }
if FOldDisabledStyle then
begin
{ "Old" TSpeedButton style }
if FImageList = nil then
begin
if not UsesMask then
begin
if IsHighColorDIB then
GenerateMaskBitmapFromDIB (MonoBmp, OriginalBmp,
SourceRect.TopLeft, IRectA.BottomRight, [clBlack])
else
begin
with MonoBmpdo
begin
Assign (DDB);
{ must be a DDB for this to work right }
Canvas.Brush.Color := clBlack;
Monochrome := True;
end;
end;
end
else
begin
MonoBmp.Assign (DDB);
{ must be a DDB for this to work right }
with TBitmap.Createdo
try
Monochrome := True;
Width := OriginalMaskBmp.Width;
Height := OriginalMaskBmp.Height;
R := Rect(0, 0, Width, Height);
Canvas.CopyRect (R, OriginalMaskBmp.Canvas, R);
DC := Canvas.Handle;
with MonoBmp.Canvasdo
begin
BitBlt (Handle, 0, 0, IWidthA, IHeightA, DC,
SourceRect.Left, SourceRect.Top, ROP_DSna);
BitBlt (Handle, 0, 0, IWidthA, IHeightA, DC,
SourceRect.Left, SourceRect.Top, SRCPAINT);
end;
finally
Free;
end;
MonoBmp.Canvas.Brush.Color := clBlack;
MonoBmp.Monochrome := True;
end
end
else
begin
with MonoBmpdo
begin
Width := IWidthA;
Height := IHeightA;
Canvas.Brush.Color := clWhite;
Canvas.FillRect (IRectA);
ImageList_Draw (FImageList.Handle, FImageIndex, Canvas.Handle,
0, 0, ILD_TRANSPARENT);
Canvas.Brush.Color := clBlack;
Monochrome := True;
end;
end;
end
else
begin
{ The new Office 97 / MFC look }
if not UsesMask and (FImageList = nil) then
begin
with TmpImage.Canvasdo
begin
if not IsHighColorDIB then
GenerateMaskBitmap (MonoBmp, DDB, IRectA.TopLeft,
IRectA.BottomRight, [FTransparentColor, clWhite, clSilver])
else
GenerateMaskBitmapFromDIB (MonoBmp, OriginalBmp,
SourceRect.TopLeft, IRectA.BottomRight, [-1, clWhite, clSilver]);
end;
end
else
begin
{ Generate the mask in MonoBmp. Make clWhite and clSilver transparent. }
if not IsHighColorDIB then
GenerateMaskBitmap (MonoBmp, DDB, SourceRect.TopLeft,
IRectA.BottomRight, [clWhite, clSilver])
else
GenerateMaskBitmapFromDIB (MonoBmp, OriginalBmp, SourceRect.TopLeft,
IRectA.BottomRight, [clWhite, clSilver]);
if FImageList = nil then
UseMaskBmp := OriginalMaskBmp
else
UseMaskBmp := MaskBmp;
{ and all the white colors in UseMaskBmp }
with TBitmap.Createdo
try
Monochrome := True;
Width := UseMaskBmp.Width;
Height := UseMaskBmp.Height;
R := Rect(0, 0, Width, Height);
Canvas.CopyRect (R, UseMaskBmp.Canvas, R);
DC := Canvas.Handle;
with MonoBmp.Canvasdo
begin
BitBlt (Handle, 0, 0, IWidthA, IHeightA, DC,
SourceRect.Left, SourceRect.Top, ROP_DSna);
BitBlt (Handle, 0, 0, IWidthA, IHeightA, DC,
SourceRect.Left, SourceRect.Top, SRCPAINT);
end;
finally
Free;
end;
end;
end;

with TmpImage.Canvasdo
begin
Brush.Color := clBtnFace;
FillRect (IRect);
Brush.Color := clBtnHighlight;
DC := Handle;
SetTextColor (DC, clBlack);
SetBkColor (DC, clWhite);
BitBlt (DC, 1, 1, IWidthA, IHeightA,
MonoBmp.Canvas.Handle, 0, 0, ROPs[FOldDisabledStyle]);
Brush.Color := clBtnShadow;
DC := Handle;
SetTextColor (DC, clBlack);
SetBkColor (DC, clWhite);
BitBlt (DC, 0, 0, IWidthA, IHeightA,
MonoBmp.Canvas.Handle, 0, 0, ROPs[FOldDisabledStyle]);
end;

FIndexs[B, State] := FGlyphList.AddMasked(TmpImage, clBtnFace);
end;
finally
DDB.Free;
MonoBmp.Free;
end;
end;
finally
MaskBmp.Free;
TmpImage.Free;
OriginalMaskBmp.Free;
OriginalBmp.Free;
end;
 
后退
顶部