This project is read-only.
1

Closed

新手求助,能否给一两个完整的基本例子?抛砖引玉一下

description

看了看最新版的玛雅做的非常好,想尝试一下,可惜.net下的开发不是多么熟悉,想找个例子看看具体怎么调用使用。
 
辛苦各位大大了。
 
另外为啥我不能引用MZFCWrapper.dll 和 PlatformAPIWrapper.dll?
我用VB.NET做的项目
 
下面是Form1.vb的代码。
Imports MeizuSDK.Presentation
Imports MeizuSDK.Drawing.OpenGLES
Imports MeizuSDK.Core
Imports MeizuSDK.Drawing
Imports System.Drawing
 
Public Class Form1
 
Private Shared Sub Main()
    Application.Run(New MainForm())
End Sub
 
Private Class MainForm
    Inherits Form
    Private toolbar As New ToolBar()
    Private basicControlButton As New Button()
    Public Sub New()
        Text = "MainWindow"
        toolbar.SetButton(toolbar.ButtonIndex.TOOLBARPRO_LEFT_TEXTBUTTON, True, True, "退出")
        toolbar.ButtonClick += New EventHandler(Of ToolBar.ButtonEventArgs)(AddressOf toolbar_ButtonClick)
        Controls.Add(toolbar)
        basicControlButton.Text = "基本控件"
        basicControlButton.Location = New Point(10, 10)
        basicControlButton.Click += New EventHandler(basicControlButton_Click)
        Controls.Add(basicControlButton)
    End Sub
    Private Sub toolbar_ButtonClick(ByVal sender As Object, ByVal e As ToolBar.ButtonEventArgs)
        Application.[Exit]()
    End Sub
    Private Sub listControlButton_Click(ByVal sender As Object, ByVal e As EventArgs)
        MessageBox.Show("测试")
    End Sub
End Class
End Class
 
报错如下:
------ 已启动生成: 项目: SmartDeviceProject1, 配置: Debug Any CPU ------
无法解决“System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes”和“System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”之间的冲突。正在任意选择“System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes”。
请考虑使用 app.config 将程序集“System.Drawing, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes”从版本“2.0.0.0”[]重新映射到版本“3.5.0.0”[C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Drawing.dll],以解决冲突并消除警告。
请考虑使用 app.config 将程序集“System, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes”从版本“2.0.0.0”[C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll]重新映射到版本“3.5.0.0”[C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.dll],以解决冲突并消除警告。
C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3247: 同一依赖程序集的不同版本之间出现冲突。
C:\Windows\Microsoft.NET\Framework\v3.5\Vbc.exe /noconfig /imports:MeizuSDK,MeizuSDK.Core,MeizuSDK.Drawing,MeizuSDK.Drawing.OpenGLES,MeizuSDK.Presentation,MeizuSDK.Presentation.Integration,Microsoft.VisualBasic,System /optioncompare:Binary /optionexplicit+ /optionstrict- /optioninfer+ /nostdlib /rootnamespace:SmartDeviceProject1 /sdkpath:"C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE" /netcf /define:"CONFIG=\"Debug\",DEBUG=-1,TRACE=-1,_MyType=\"WindowsFormsWithCustomSubMain\",PLATFORM=\"AnyCPU\",WindowsCE=TRUE" /reference:"C:\Users\飞雪\Desktop\M8.NET\MeizuSDK.Core.dll","C:\Users\飞雪\Desktop\M8.NET\MeizuSDK.Drawing.dll","C:\Users\飞雪\Desktop\M8.NET\MeizuSDK.Drawing.OpenGLES.dll","C:\Users\飞雪\Desktop\M8.NET\MeizuSDK.Presentation.dll","C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Data.dll",C:\Windows\assembly\GAC_MSIL\System.Deployment\2.0.0.0__b03f5f7f11d50a3a\System.Deployment.dll,"C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.dll","C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Drawing.dll","C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Windows.Forms.dll","C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Xml.dll" /debug+ /debug:full /filealign:512 /out:obj\Debug\SmartDeviceProject1.exe /resource:obj\Debug\SmartDeviceProject1.Form1.resources /target:winexe Form1.Designer.vb Form1.vb
vbc : error BC30737: 在“SmartDeviceProject1”中找不到任何具有合适签名的可访问“Main”方法。
E:\我的软件开发\M8 开发\vb.net\SmartDeviceProject1\SmartDeviceProject1\Form1.vb(19) : error BC30456: “SetButton”不是“MeizuSDK.Presentation.ToolBar”的成员。
E:\我的软件开发\M8 开发\vb.net\SmartDeviceProject1\SmartDeviceProject1\Form1.vb(19) : error BC30456: “ButtonIndex”不是“MeizuSDK.Presentation.ToolBar”的成员。
E:\我的软件开发\M8 开发\vb.net\SmartDeviceProject1\SmartDeviceProject1\Form1.vb(20) : error BC32022: “Public Event ButtonClick(sender As Object, e As MeizuSDK.Presentation.ToolBar.ButtonEventArgs)”是事件,不能直接调用。请使用“RaiseEvent”语句引发事件。
E:\我的软件开发\M8 开发\vb.net\SmartDeviceProject1\SmartDeviceProject1\Form1.vb(24) : error BC32022: “Public Event Click(sender As Object, e As System.EventArgs)”是事件,不能直接调用。请使用“RaiseEvent”语句引发事件。
E:\我的软件开发\M8 开发\vb.net\SmartDeviceProject1\SmartDeviceProject1\Form1.vb(24) : error BC32008: 委托“System.EventHandler”需要使用一个“AddressOf”表达式或 lambda 表达式作为其构造函数的唯一参数。
E:\我的软件开发\M8 开发\vb.net\SmartDeviceProject1\SmartDeviceProject1\Form1.vb(36) : error BC30460: “End Class”前面必须是匹配的“Class”。
Done building project "SmartDeviceProject1.vbproj" -- FAILED.
========== 生成: 成功或最新 0 个,失败 1 个,跳过 0 个 ==========

 

俺非常非常菜,有些问题很弱智,各位大大不要笑。能抽时间指点一下最好了。
特别想要个现场的例子看看到底怎么用
Closed Sep 9, 2010 at 9:26 AM by wpwen

comments

zllangty wrote Jul 13, 2010 at 1:49 PM

完整的把Library and Demo.zip下载好,里面有DEMO,还算完整吧。

wpwen wrote Sep 3, 2010 at 3:38 AM

MZFCWrapper.dll 和 PlatformAPIWrapper.dll是非托管类库,有C++封装MzFC而成,无法直接添加引用。它们对应的托管类库是Presentation和Core,这才是可以能够添加引用的。

wpwen wrote Sep 3, 2010 at 3:41 AM

toolbar.SetButton(toolbar.ButtonIndex.TOOLBARPRO_LEFT_TEXTBUTTON, True, True, "退出") 这代码中 toolbar.ButtonIndex.TOOLBARPRO_LEFT_TEXTBUTTON错误,应该是ButtonIndex.TOOLBARPRO_LEFT_TEXTBUTTON

wpwen wrote Sep 3, 2010 at 3:42 AM

最新代码中已经将ButtonIndex.TOOLBARPRO_LEFT_TEXTBUTTON改为ButtonIndex.LeftTextButton

wrote Sep 9, 2010 at 9:26 AM

wrote Feb 2, 2013 at 5:48 AM

wrote May 14, 2013 at 1:24 AM