找回密码
 注册账号

QQ登录

只需一步,快速开始

手机号码,快捷登录

手机号码,快捷登录

初学者课程:T3自学|T6自学|U8自学软件下载课件下载工具下载资料:通资料|U8资料|NC|培训|年结积分规则 | 使用常见问题Q&A
知识库:U8 | | NC | U9 | OA | 政务U8|U9|NCC|NC65|NC65客开|NCC客开新手必读 | 任务 | 快速增金币用友QQ群[微信群]
查看: 7517|回复: 12

[求助] 郁闷滴求助:关于门户集成时,不实现接口成员的问题~

[复制链接]
发表于 2010-4-13 14:02:07 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册账号

×
今天本打算按照用友二次开发手册的介绍,实现自己的可与门户集成的.NET UserControl,但是却一直被一个问题卡住动不了:

错误 1 “UFIDA.U8.Portal.NetProductSample.MyUserControl”不实现接口成员“UFIDA.U8.Portal.UAPFacade.IUserControl.CreateControl(U8Login.clsLogin, string, string)”。“UFIDA.U8.Portal.NetProductSample.MyUserControl.CreateControl(U8Login.clsLogin, string, string)”无法实现“UFIDA.U8.Portal.UAPFacade.IUserControl.CreateControl(U8Login.clsLogin, string, string)”,因为它没有匹配的返回类型“System.Windows.Forms.Control”。

这个错误我调了很久,不管怎么样还是顽强地一直出现~~

现贴出我的相关代码,请大家帮助看看到底是哪里出了问题呢?先谢谢大家了~~~
...
using System.Windows.Forms;

namespace UFIDA.U8.Portal.NetProductSample
{
    class MyUserControl:UFIDA.U8.Portal.UAPFacade.IUserControl
    {
         public System.Windows.Forms.Control CreateControl(U8Login.clsLogin login, string MenuID, string Paramters)
        {
            try
            {
                Control myControl = new Control();
                return myControl;
            }
            catch
            {
                throw new NotImplementedException();
            }
        }
    }
}
发表于 2010-4-13 14:45:46 | 显示全部楼层
https://www.oyonyou.com/forum-76-1.html

里面貌似有你需要的例子的,但要找找
 楼主| 发表于 2010-4-13 15:11:57 | 显示全部楼层
回复 2# naojin


    好的,我去找找,谢谢naojin版主的帮助~
 楼主| 发表于 2010-4-13 16:45:40 | 显示全部楼层
回复 2# naojin


    呃...没找到耶~~你能不能告诉我是哪个贴子呀? 我找了又找还是没看到...
发表于 2010-4-13 16:56:58 | 显示全部楼层
可能我记错了。
发表于 2010-4-13 16:57:16 | 显示全部楼层
如有需要,我再另外开贴发吧
 楼主| 发表于 2010-4-14 11:27:20 | 显示全部楼层
回复 6# naojin


    希望naojin版主能赶快开贴~~~我折腾了两天都没解决这个问题,555
发表于 2010-4-14 12:07:57 | 显示全部楼层
回复 7# zss0114


    你把你的问题再详细的说下呢
发表于 2010-4-14 12:11:36 | 显示全部楼层
晕,是你的代码写得不对
 楼主| 发表于 2010-4-14 12:57:26 | 显示全部楼层
回复 9# naojin


    我的代码哪里写得不对呢?我看了好久都没看出来呀...

    我的问题是这样的:我新建了一个类MyUserControl,用来实现U8中已经定义了的接口UFIDA.U8.Portal.UAPFacade.IUserControl,开发平台是VS.NET 2008。当我在我的类中实现接口中的成员函数时,除了CreateControl函数,其他的函数都可以实现,但就是CreateControl函数实现不了,系统总是会报这样的错误——

“...MyUserControl不实现接口成员UFIDA.U8.Portal.UAPFacade.IUserControl.CreateControl(U8Login.clsLogin, string, string)。...MyUserControl.CreateControl(U8Login.clsLogin, string, string)”无法实现UFIDA.U8.Portal.UAPFacade.IUserControl.CreateControl(U8Login.clsLogin, string, string),因为它没有匹配的返回类型“System.Windows.Forms.Control。”

可是我检查了好久也没发现我的程序的错误在哪里~~求大大的指点。。。

这是我写的相关程序
--------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using U8Login;
using UFIDA.U8.Portal.Proxy.editors;
namespace UFIDA.U8.Portal.NetProductSample
{
    class MyUserControl:UFIDA.U8.Portal.UAPFacade.IUserControl
    {
          public System.Windows.Forms.Control CreateControl(U8Login.clsLogin login, string MenuID, string Paramters)
        {
            try
            {
                Control myControl = new Control();
                return myControl;
            }
            catch
            {
                throw new NotImplementedException();
            }
        }
......
    }
}

这是接口的代码
------------------------------
using System;
using System.Windows.Forms;
using U8Login;
using UFIDA.U8.Portal.Proxy.editors;
namespace UFIDA.U8.Portal.UAPFacade
{
     ......
     Control CreateControl(clsLogin login, string MenuID, string Paramters);
     ......
}

类型Control属于System.Windows.Forms.Control类,
---------------------------------
namespace System.Windows.Forms
{
    //     定义控件的基类,控件是带有可视化表示形式的组件。
    public class Control : Component, IBindableComponent, IComponent, IDisposable
    {
        //     用默认设置初始化 System.Windows.Forms.Control 类的新实例。
        public Control();
    ......
}


请求大家的帮助~~
发表于 2010-4-14 16:40:43 | 显示全部楼层
 楼主| 发表于 2010-4-14 20:41:23 | 显示全部楼层
再次感谢~~嘻嘻
发表于 2014-4-9 14:08:57 | 显示全部楼层
好东西啊 顶起来~~
回复 点赞 拍砖

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

QQ|站长微信|Archiver|手机版|小黑屋|用友之家 ( 蜀ICP备07505338号|51072502110008 )

GMT+8, 2024-6-7 19:20 , Processed in 0.077068 second(s), 9 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表