又一个Delphi翻译成BCB的问题(100分)

  • 主题发起人 主题发起人 Town
  • 开始时间 开始时间
T

Town

Unregistered / Unconfirmed
GUEST, unregistred user!
以下是一段Delphi程序,麻烦各位帮忙转成CBuilder的语言,
我对set不太懂的说,对照学习可能掌握的快一些 :)
interface
uses
......,ShlObj;
type
TBrowseFlag = (
bf_BrowseForComputer,
bf_BrowseForPrinter,
bf_DontGoBelowDomain,
bf_ReturnFSanceStors,
bf_ReturnOnlyFSDIRS,
bf_StatusText);
TBrowseFlags = set of TBrowseFlag;
{略去......................................}
procedure TBrowseForFolder.SetOperFlag( F :Cardinal;
V :Boolean );
begin
{略去}
end;
procedure TBrowseForFolder.SetFlags( Value :TBrowseFlags );
{
SetOperFlag(BIF_BROWSEFORCOMPUTER,bf_BROWSEFORCOMPUTER in Value);
{略去}
}
........................................
function TBrowseForFolder.GetOperFlag( F :Cardinal ):boolean;
begin
{略去}
end;
function TBrowseForFolder.GetFlags;
begin
result := [];
if GetOperFlag(BIF_BROWSEFORCOMPUTER) then
include( result,bf_BROWSEFORCOMPUTER);
end
 
// make byte alignment
#pragma option push -b-
enum TBrowseFlag { bf_BrowseForComputer, bf_BrowseForPrinter, bf_DontGoBelowDomain, bf_ReturnFSanceStors,
bf_ReturnOnlyFSDIRS, bf_StatusText };
// make previous alignment
#pragma option pop
typedef Set<TBrowseFlag, bf_BrowseForComputer, bf_StatusText> TBrowseFlags;
void __fastcall TBrowseForFolder.SetOperFlag(unsigned F, bool V)
{
}
void __fastcall TBrowseForFolder.SetFlags(TBrowseFlags Value)
{
SetOperFlag(bf_BrowseForComputer,
Value.Contains(bf_BrowseForComputer));
}
bool __fastcall TBrowseForFolder.GetOperFlag(unsigned F)
{
}
TBrowseFlags __fastcall TBrowseForFolder.GetFlags(void)
{
TBrowsFlags bf;
if(GetOperFlags(bf_BrowseForComputer))
bf << bf_BrowseForComputer;
return bf;
}
 
搞定,呵呵.谢谢lhz :)
满分归你了 :)
 
接受答案了.
 
后退
顶部