var
  UserLog, UserData: olevariant; 
  userid:String;
begin
   UserLog := createoleobject('UFSoft.U8.Framework.Login.UI.clsLogin');
  if UserLog.login_2('DP') then
  begin
    UserData := createoleobject('UFSoft.U8.Framework.LoginContext.UserData');
    UserData := UserLog.GetLoginInfo;
    userid := UserData.UserId; 
  end;
end;
这是调用用友登录框的代码。希望可以帮转换下BCB。
那边每人反映

解决方案 »

  1.   

    Variant   UserLog,UserData; 
    AnsiString   userid; 
    UserLog   =   CreateOleObject( "UFSoft.U8.Framework.Login.UI.clsLogin"); 
    if (UserLog.login_2("DP"))
    {
      UserData = CreateOleObject( "UFSoft.U8.Framework.LoginContext.UserData");
      UserData = UserLog.GetLoginInfo;
      userid = UserData.UserId;
    }
      

  2.   

    提示我。[C++ Error] Main.cpp(33): E2316 'login_2' is not a member of 'Variant'
    但是delphi可以正常调用神马的
      

  3.   

    大概是这个样子:
    Variant UserLog, UserData;
    String UserID;
    UserLog = CreateOleObject("UFSoft.U8.Framework.Login.UI.clsLogin");
    if (UserLog.OleFunction("login_2", "DP"))
    {
        UserData = CreateOleObject("UFSoft.U8.Framework.LoginContext.UserData");
        UserData = UserLog.OleFunction("GetLoginInfo");
        UserID = UserData.OlePropertyGet("UserId");
    }
      

  4.   

    晕。代码修饰错了,应该用C++风格。
    Variant UserLog, UserData;
    String UserID;
    UserLog = CreateOleObject("UFSoft.U8.Framework.Login.UI.clsLogin");
    if (UserLog.OleFunction("login_2", "DP"))
    {
        UserData = CreateOleObject("UFSoft.U8.Framework.LoginContext.UserData");
        UserData = UserLog.OleFunction("GetLoginInfo");
        UserID = UserData.OlePropertyGet("UserId");
    }