• 12591阅读
  • 14回复

c# 隔离 COM 引用“APlayer3Lib”时出现问题 [复制链接]

上一主题 下一主题
离线aplayer

只看该作者 10楼 发表于: 2018-01-05
你看下这个帖子:http://ask.csdn.net/questions/155260, 其中提到:“以管理员权限运行VS,重新引用下Office.Interop.Word”。
你试试以管理员启动 VS,重新引用下 APlayer 控件。
离线aplayer

只看该作者 11楼 发表于: 2020-06-13
回 wangyixin 的帖子
wangyixin:我也遇到相同问题 (2020-06-11 13:19)

C# 用免注册方式调用 APlayer 吧,完全不用注册,真正拷贝绿色运行,使用论坛提供的 APlayerCaller.dll 即可, 代码片段如下:


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{

    public partial class Form1 : Form
    {

        [DllImport("APlayerCaller.dll", EntryPoint = "APlayer_OpenA")]
        public static extern bool APlayer_OpenA(int aplayer, string pszUrl);

        [DllImport("APlayerCaller.dll", EntryPoint = "APlayer_Create")]
        public static extern int APlayer_Create(
            int hParentWnd,
            int x,
            int y,
            int nWidth,
            int nHeight,
            int OnMessage,
            int OnStateChanged,
            int OnOpenSuccess,
            int OnSeekCompleted,
            int OnBuffer,
            int OnVideoSizeChanged,
            int OnDownloadCodec,
            int OnEvent);


        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            int hand = this.Handle.ToInt32();
            int playhand = APlayer_Create(hand, 10, 10, 500, 500, 0, 0, 0, 0, 0, 0, 0, 0);

            string str = "http://aplayer.open.xunlei.com/test.mp4";
            APlayer_OpenA(playhand, str);
        }
    }
}

离线zzvzz

只看该作者 12楼 发表于: 2021-05-05
我也遇到,不过把独立换成False就可以运行
离线cdtesscd

只看该作者 13楼 发表于: 2022-01-02
这个问题有兄弟解决了吗??
离线aplayer

只看该作者 14楼 发表于: 2022-01-05
回 medeor 的帖子
medeor:设置了,我很认真的按照您说的做了相应设置
[图片]
您看下, 应该还是哪里我没理解透,缺少相应的设置 (2017-12-21 16:13) 

建议用免注册(调用 APlayerCaller.dll),只要知道窗口句柄和能调用 Windows 普通 DLL 的导出函数就行,绿色环保,复制过去就可以跑,免注册调用方法是开源的,见帖子:http://aplayer.open.xunlei.com/bbs/read.php?tid=22190
快速回复
限100 字节
如果您提交过一次失败了,可以用”恢复数据”来恢复帖子内容
 
上一个 下一个