查看完整版本: [-- C#从Aplayer.dll文件中创建AxtiveX控件 --]

APlayer 开发者论坛 -> APlayer 讨论区 -> C#从Aplayer.dll文件中创建AxtiveX控件 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

witace 2018-07-12 11:15

C#从Aplayer.dll文件中创建AxtiveX控件


参考论坛中C#免注册调用APlayer的方法,生成的应用程序在别的电脑上死活运行不了
编译时也出现隔离COM引用的问题
帮助文档中有C++从文件创建对象的实例,可是不知道怎样转换成C#
不知有没有哪位大神有C#从dll文件中创建AxtiveX控件的方法?
感激不尽!

aplayer 2018-07-12 16:47
如果你觉得这么创建不方便,还有一种方式,就是调用 APlayerCaller.dll,这样就只要能调用动态链接库,就能创建 APlayer 了。

witace 2018-07-13 08:45
aplayer:如果你觉得这么创建不方便,还有一种方式,就是调用 APlayerCaller.dll,这样就只要能调用动态链接库,就能创建 APlayer 了。 (2018-07-12 16:47) 

这个APlayerCaller.dll是不是跟那个易语言调用的是一样的?具体应该怎样调用呢?有没有具体的代码?

aplayer 2018-07-13 11:49
APlayerCaller.dll 是把 ActiveX 调用转为普通 DLL调用的方式的工具,论坛有开源的代码,具体使用方法:

创建:返回 APlayer LONG_PTR 类型的句柄
LONG_PTR APlayer_Create(LONG_PTR            hParentWnd,
                        LONG                x,
                        LONG                y,
                        LONG                nWidth,
                        LONG                nHeight,
                        LONG            OnMessage,
                        LONG        OnStateChanged,
                        LONG        OnOpenSuccess,
                        LONG    OnSeekCompleted,
                        LONG            OnBuffer,
                        LONG    OnVideoSizeChanged,
                        LONG    OnDownloadCodec,
                        LONG            OnEvent);

销毁:传入 APlayer 句柄
BOOL APlayer_Destroy(LONG_PTR aplayer);

调用 APlayer 方法(顾名思义):
BOOL APlayer_OpenW(LONG_PTR aplayer, WCHAR* pszUrl)
BOOL APlayer_OpenA(LONG_PTR aplayer, char* pszUrl)
BOOL APlayer_Close(LONG_PTR aplayer)
BOOL APlayer_Play(LONG_PTR aplayer)
BOOL APlayer_Pause(LONG_PTR aplayer)
char* APlayer_GetVersion(LONG_PTR aplayer)
BOOL APlayer_SetCustomLogo(LONG_PTR aplayer,LONG nLogo)
LONG APlayer_GetState(LONG_PTR aplayer)
LONG APlayer_GetDuration(LONG_PTR aplayer)
LONG APlayer_GetPosition(LONG_PTR aplayer)
LONG APlayer_SetPosition(LONG_PTR aplayer, LONG nPosition)
LONG APlayer_GetVideoWidth(LONG_PTR aplayer)
LONG APlayer_GetVideoHeight(LONG_PTR aplayer)
LONG APlayer_GetVolume(LONG_PTR aplayer)
LONG APlayer_SetVolume(LONG_PTR aplayer, LONG nVolume)
LONG APlayer_IsSeeking(LONG_PTR aplayer)
LONG APlayer_GetBufferProgress(LONG_PTR aplayer)
char* APlayer_GetConfigA(LONG_PTR aplayer, LONG nConfigId)
WCHAR* APlayer_GetConfigW(LONG_PTR aplayer, LONG nConfigId)
LONG APlayer_SetConfigW(LONG_PTR aplayer, LONG nConfigId, WCHAR* strValue)
LONG APlayer_SetConfigA(LONG_PTR aplayer, LONG nConfigId, char* strValue)
LONG_PTR APlayer_GetWindow(LONG_PTR aplayer)
BOOL APlayerCaller_SetSize(LONG_PTR aplayer, LONG x, LONG y, LONG nWidth, LONG nHeight);


jfjdkkvd 2018-07-13 12:13
可以论坛搜索下啊


查看完整版本: [-- C#从Aplayer.dll文件中创建AxtiveX控件 --] [-- top --]


Powered by phpwind v8.7 Code ©2003-2011 phpwind
Time 0.007327 second(s),query:0 Gzip enabled