将C#代码转换为vb6.0 [英] converting C# code to vb6.0

查看:125
本文介绍了将C#代码转换为vb6.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,



我在C#中有这样的东西:



Dear All,

I have got something like this in C#:

public static Cursor CreateCursor(Bitmap bmp, int xHotSpot, int yHotSpot)
        {
            IconInfo tmp = new IconInfo();
            GetIconInfo(bmp.GetHicon(), ref tmp);
            tmp.xHotspot = xHotSpot;
            tmp.yHotspot = yHotSpot;
            tmp.fIcon = true;
            return new Cursor(CreateIconIndirect(ref tmp));
        }







public struct IconInfo
        {
            public bool fIcon;
            public int xHotspot;
            public int yHotspot;
            public IntPtr hbmMask;
            public IntPtr hbmColor;
        }





有人可以帮我转换成VB6.0代码吗?



谢谢,

推荐答案

嗨Raj,



我不知道为什么要将C#代码转换为VB6.0 ;-)

我想建议的是,尝试将C#代码转换为VB.Net最初将VB.Net代码转换为VB6.0。

可能你很容易做到这一点。

我已经将C#代码转换为VB。您的净代码

Hi Raj,

I do not know why you want to convert C# code to VB6.0 ;-)
What I would like to suggest is, try to convert the C# code to VB.Net initially then convert VB.Net code to VB6.0.
Probably it would be easy for you to do it.
I have converted C# code to VB.Net code for you
Public Shared Function CreateCursor(bmp As Bitmap, xHotSpot As Integer, yHotSpot As Integer) As Cursor
    Dim tmp As New IconInfo()
    GetIconInfo(bmp.GetHicon(), tmp)
    tmp.xHotspot = xHotSpot
    tmp.yHotspot = yHotSpot
    tmp.fIcon = True
    Return New Cursor(CreateIconIndirect(tmp))
End Function




Public Structure IconInfo
	Public fIcon As Boolean
	Public xHotspot As Integer
	Public yHotspot As Integer
	Public hbmMask As IntPtr
	Public hbmColor As IntPtr
End Structure



现在你的工作是将这个概念从VB.Net重写为VB6.0

希望这会对你有所帮助。



问候,

RK


Now its your work to rewrite the concept from VB.Net to VB6.0
Hope this helps you a bit.

Regards,
RK


这篇关于将C#代码转换为vb6.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆