实现IObjectSafety接口问题

gxboy 2006-05-26 11:21:29
网上找到两篇这方面的文章,一篇是c#的,一篇是vb的。但就是没有vb.net的代码。请大侠出手相助,本人不是太懂应用程序编程,请尽量写明白一点,谢谢。
...全文
255 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
yinweihong 2006-05-30
  • 打赏
  • 举报
回复
http://support.microsoft.com/default.aspx?scid=kb;en-us;182598
照着做,我保准你能做好,,,赫赫
gxboy 2006-05-30
  • 打赏
  • 举报
回复
各位??MVP呢?
gxboy 2006-05-30
  • 打赏
  • 举报
回复
这是vb6的啊。我需要vb.net的。我对应用程序编程不熟,还望能简洁明了的回答。
gxboy 2006-05-27
  • 打赏
  • 举报
回复
请高手继续讲解!
gxboy 2006-05-26
  • 打赏
  • 举报
回复
谢了,兄弟
copico 2006-05-26
  • 打赏
  • 举报
回复
不说了
献丑
gxboy 2006-05-26
  • 打赏
  • 举报
回复
到不是翻译,主要是实现问题。现在的接口还没实现代码呢
copico 2006-05-26
  • 打赏
  • 举报
回复
最好是一个函数一个函数的去翻译,这样成功率比较高
copico 2006-05-26
  • 打赏
  • 举报
回复
http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx
自己去翻译吧
博客打开的慢
gxboy 2006-05-26
  • 打赏
  • 举报
回复
关键是这里还有些实现的代码没有啊。

老兄帮我看看http://vboy.cnblogs.com/articles/165080.html

这里的vb6代怎么用vb.net表示
gxboy 2006-05-26
  • 打赏
  • 举报
回复
good man
copico 2006-05-26
  • 打赏
  • 举报
回复
#region IObjectSafety 成员

public void GetInterfacceSafyOptions(Int32 riid, out Int32 pdwSupportedOptions, out Int32 pdwEnabledOptions)
{
// TODO: 添加 WebCamControl.GetInterfacceSafyOptions 实现
pdwSupportedOptions = 1;
pdwEnabledOptions = 2;
}

public void SetInterfaceSafetyOptions(Int32 riid, Int32 dwOptionsSetMask, Int32 dwEnabledOptions)
{
// TODO: 添加 WebCamControl.SetInterfaceSafetyOptions 实现
}

#endregion
======================================================================
Public Sub GetInterfacceSafyOptions(ByVal riid As Int32, ByRef pdwSupportedOptions As Int32, ByRef pdwEnabledOptions As Int32)
pdwSupportedOptions = 1
pdwEnabledOptions = 2
End Sub

Public Sub SetInterfaceSafetyOptions(ByVal riid As Int32, ByVal dwOptionsSetMask As Int32, ByVal dwEnabledOptions As Int32)
End Sub
gxboy 2006-05-26
  • 打赏
  • 举报
回复
就是说我要在vb.net内实现这些东西需要怎么做。
copico 2006-05-26
  • 打赏
  • 举报
回复
#region IObjectSafety 成员

public void GetInterfacceSafyOptions(Int32 riid, out Int32 pdwSupportedOptions, out Int32 pdwEnabledOptions)
{
// TODO: 添加 WebCamControl.GetInterfacceSafyOptions 实现
pdwSupportedOptions = 1;
pdwEnabledOptions = 2;
}

public void SetInterfaceSafetyOptions(Int32 riid, Int32 dwOptionsSetMask, Int32 dwEnabledOptions)
{
// TODO: 添加 WebCamControl.SetInterfaceSafetyOptions 实现
}

#endregion
======================================================================
Public Sub GetInterfacceSafyOptions(ByVal riid As Int32, ByRef pdwSupportedOptions As Int32, ByRef pdwEnabledOptions As Int32)
pdwSupportedOptions = 1
pdwEnabledOptions = 2
End Sub

Public Sub SetInterfaceSafetyOptions(ByVal riid As Int32, ByVal dwOptionsSetMask As Int32, ByVal dwEnabledOptions As Int32)
End Sub
copico 2006-05-26
  • 打赏
  • 举报
回复
[Guid("CB5BDC81-93C1-11CF-8F20-00805F2CD064"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IObjectSafety
{
// methods
void GetInterfacceSafyOptions(
System.Int32 riid,
out System.Int32 pdwSupportedOptions,
out System.Int32 pdwEnabledOptions);
void SetInterfaceSafetyOptions(
System.Int32 riid,
System.Int32 dwOptionsSetMask,
System.Int32 dwEnabledOptions);
}
==================================================
<Guid("CB5BDC81-93C1-11CF-8F20-00805F2CD064"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
Public Interface IObjectSafety

Sub GetInterfacceSafyOptions(ByVal riid As System.Int32, ByRef pdwSupportedOptions As System.Int32, ByRef pdwEnabledOptions As System.Int32)

Sub SetInterfaceSafetyOptions(ByVal riid As System.Int32, ByVal dwOptionsSetMask As System.Int32, ByVal dwEnabledOptions As System.Int32)
End Interface
copico 2006-05-26
  • 打赏
  • 举报
回复
public void ShowMessage(string msg)
{
if(msg != null)
{
MessageBox.Show(msg);
}
}
=======================================
Public Sub ShowMessage(ByVal msg As String)
If Not (msg Is Nothing) Then
MessageBox.Show(msg)
End If
End Sub
copico 2006-05-26
  • 打赏
  • 举报
回复
哪一部分要翻译?
gxboy 2006-05-26
  • 打赏
  • 举报
回复
http://homer.cnblogs.com/archive/2005/01/08/88780.html

这是c#的代码,请翻译翻译成vb.net 的

16,553

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧