Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Mojo  
#1 Posted : 20 July 2011 16:16:50(UTC)
Mojo

Rank: Newbie

Groups: Registered
Joined: 16/05/2011(UTC)
Posts: 4
Location: Berlin

Hello Friends!

I just tried out the PDF tutorial. As I'm using SMath 0.89 I changed the code from (0,88) to (0,89). When I re-build the project I get several warnings but no errors. So I decided to test my plugin (combin) and put the dll and pdb file in the SMath folder (as describt in the tutorial). As soon as I click on the Plugin I get a warning :

Code:

************** Ausnahmetext **************
System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei SMath.Desktop.PluginsDialog.lbPluginsList_SelectedIndexChanged(Object sender, EventArgs e)
   bei System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)
   bei System.Windows.Forms.ListBox.set_SelectedIndex(Int32 value)
   bei SMath.Desktop.PluginsDialog.PluginsDialog_Load(Object sender, EventArgs e)
   bei System.Windows.Forms.Form.OnLoad(EventArgs e)
   bei System.Windows.Forms.Form.OnCreateControl()
   bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   bei System.Windows.Forms.Control.CreateControl()
   bei System.Windows.Forms.Control.WmShowWindow(Message& m)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   bei System.Windows.Forms.ContainerControl.WndProc(Message& m)
   bei System.Windows.Forms.Form.WmShowWindow(Message& m)
   bei System.Windows.Forms.Form.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Geladene Assemblys **************
mscorlib
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3623 (GDR.050727-3600).
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll.
----------------------------------------
SMathStudio_Desktop
    Assembly-Version: 0.89.3856.7126.
    Win32-Version: 1.1.15.0.
    CodeBase: file:///C:/Programme/SMath/SMath%20Studio/SMathStudio_Desktop.exe.
----------------------------------------
System.Windows.Forms
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3623 (GDR.050727-3600).
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll.
----------------------------------------
System
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3620 (GDR.050727-3600).
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll.
----------------------------------------
System.Drawing
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3053 (netfxsp.050727-3000).
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.
----------------------------------------
ioman
    Assembly-Version: 0.89.3856.7122.
    Win32-Version: 0.89.3856.7122.
    CodeBase: file:///C:/Programme/SMath/SMath%20Studio/ioman.DLL.
----------------------------------------
System.Windows.Forms.resources
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.42 (RTM.050727-4200).
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_de_b77a5c561934e089/System.Windows.Forms.resources.dll.
----------------------------------------
CombineFunction
    Assembly-Version: 1.0.0.25260.
    Win32-Version: 1.0.0.*.
    CodeBase: file:///C:/Programme/SMath/SMath%20Studio/plugins/CombineFunction.dll.
----------------------------------------
Microsoft.VisualBasic
    Assembly-Version: 8.0.0.0.
    Win32-Version: 8.0.50727.3053 (netfxsp.050727-3000).
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll.
----------------------------------------
HTMLFileType
    Assembly-Version: 1.2.3856.6720.
    Win32-Version: 1.2.3856.6720.
    CodeBase: file:///C:/Programme/SMath/SMath%20Studio/plugins/HTMLFileType.dll.
----------------------------------------
canvas
    Assembly-Version: 0.89.3856.7124.
    Win32-Version: 0.89.3856.7124.
    CodeBase: file:///C:/Programme/SMath/SMath%20Studio/canvas.DLL.
----------------------------------------
SpecialFunctions
    Assembly-Version: 1.2.3856.6823.
    Win32-Version: 1.2.3856.6823.
    CodeBase: file:///C:/Programme/SMath/SMath%20Studio/plugins/SpecialFunctions.dll.
----------------------------------------
XMCDFileType
    Assembly-Version: 1.2.3856.6795.
    Win32-Version: 1.2.3856.6795.
    CodeBase: file:///C:/Programme/SMath/SMath%20Studio/plugins/XMCDFileType.dll.
----------------------------------------
System.Configuration
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3053 (netfxsp.050727-3000).
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll.
----------------------------------------
System.Xml
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3082 (QFE.050727-3000).
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll.
----------------------------------------
mscorlib.resources
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3623 (GDR.050727-3600).
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll.
----------------------------------------


If I click on NEXT, I find the new Plugin in the List, but the warning is permanently popping up.
I would be very glad, if somebody could help me to fix it.
Regards,
MoJo

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline TheWizEd  
#2 Posted : 23 July 2011 04:10:55(UTC)
TheWizEd


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2010(UTC)
Posts: 178
Man
United States

Was thanked: 19 time(s) in 13 post(s)
Mojo,

I'm not experienced enough to decifer the problem from what you've posted. But I've developed several plug-ins using the following environment without problems.

Windows 7 Pro SP1
Microsoft Visual Web Developer Express 2010 10.0.30319.1
SMath 0.89

Post your source code, I'm sure you've checked it but sometimes a fresh eye will spot something.
Ed
Offline Mojo  
#3 Posted : 25 July 2011 11:14:19(UTC)
Mojo

Rank: Newbie

Groups: Registered
Joined: 16/05/2011(UTC)
Posts: 4
Location: Berlin

Code:

Imports SMath.Manager
Imports SMath.Math
Public Class Class1
    Implements IPluginHandleEvaluation, IPluginLowLevelEvaluation


    Dim termInfos() As TermInfo
    Dim asseblyInfos() As AssemblyInfo


    Public ReadOnly Property Dependences As SMath.Manager.AssemblyInfo() Implements SMath.Manager.IPlugin.Dependences
        Get
            Return Me.asseblyInfos
        End Get
    End Property

    Public Sub Initialize() Implements SMath.Manager.IPlugin.Initialize
        Me.termInfos = New TermInfo() {
            New TermInfo("combin", TermType.Function, 2, "(n,k) - Returns the...", FunctionSection.Unknown, True)
        }
        Me.asseblyInfos = (New AssemblyInfo() {
            New AssemblyInfo("Smath Studio", New Version(0, 89), New Guid("a37cba83-b69c-4c71-9992-55ff666763bd"))
        })

    End Sub

    Public ReadOnly Property TermsHandled As SMath.Manager.TermInfo() Implements SMath.Manager.IPluginHandleEvaluation.TermsHandled
        Get

        End Get
    End Property

#Region "IDisposable Support"
    Private disposedValue As Boolean ' So ermitteln Sie überflüssige Aufrufe

    ' IDisposable
    Protected Overridable Sub Dispose(ByVal disposing As Boolean)
        If Not Me.disposedValue Then
            If disposing Then
                ' TODO: Verwalteten Zustand löschen (verwaltete Objekte).
            End If

            ' TODO: Nicht verwaltete Ressourcen (nicht verwaltete Objekte) freigeben und Finalize() unten überschreiben.
            ' TODO: Große Felder auf NULL festlegen.
        End If
        Me.disposedValue = True
    End Sub

    ' TODO: Finalize() nur überschreiben, wenn Dispose(ByVal disposing As Boolean) oben über Code zum Freigeben von nicht verwalteten Ressourcen verfügt.
    'Protected Overrides Sub Finalize()
    '    ' Ändern Sie diesen Code nicht. Fügen Sie oben in Dispose(ByVal disposing As Boolean) Bereinigungscode ein.
    '    Dispose(False)
    '    MyBase.Finalize()
    'End Sub

    ' Dieser Code wird von Visual Basic hinzugefügt, um das Dispose-Muster richtig zu implementieren.
    Public Sub Dispose() Implements IDisposable.Dispose
        ' Ändern Sie diesen Code nicht. Fügen Sie oben in Dispose(ByVal disposing As Boolean) Bereinigungscode ein.
        Dispose(True)
        GC.SuppressFinalize(Me)
    End Sub
#End Region

    Public Function ExpressionEvaluation(ByVal root As SMath.Manager.Term, ByVal args()() As SMath.Manager.Term, ByRef store As SMath.Manager.Store, ByRef result() As SMath.Manager.Term) As Boolean Implements SMath.Manager.IPluginLowLevelEvaluation.ExpressionEvaluation
        If root.Type = TermType.Function And root.Text = "combin" And root.ChildCount = 2 Then
            Dim arg1 As Term() = Decision.Preprocessing(args(0), store)
            Dim arg2 As Term() = Decision.Preprocessing(args(1), store)

            Dim answer As New List(Of Term)
            answer.AddRange(arg1)
            answer.Add(New Term([Operator].Factorial, TermType.Operator, 1))
            answer.AddRange(arg2)
            answer.Add(New Term([Operator].Factorial, TermType.Operator, 1))
            answer.AddRange(arg1)
            answer.AddRange(arg2)
            answer.Add(New Term([Operator].Substraction, TermType.Operator, 2))
            answer.Add(New Term([Operator].Factorial, TermType.Operator, 1))
            answer.Add(New Term([Operator].Multiplication, TermType.Operator, 2))
            answer.Add(New Term([Operator].Division, TermType.Operator, 2))

            result = answer.ToArray()
            Return True

        End If
        Return False
    End Function
End Class

Code:

Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices

' Allgemeine Informationen über eine Assembly werden über die folgenden 
' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
' die mit einer Assembly verknüpft sind.

' Die Werte der Assemblyattribute überprüfen

<Assembly: AssemblyTitle("Combination Function")> 
<Assembly: AssemblyDescription("Plugin")> 
<Assembly: AssemblyCompany("")> 
<Assembly: AssemblyProduct("Combins Function")> 
<Assembly: AssemblyCopyright("Copyright ©  2011")> 
<Assembly: AssemblyTrademark("")> 

<Assembly: ComVisible(False)>

'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
<Assembly: Guid("d97bde52-da0b-4c9a-8987-58cb16d054de")> 

' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
'
'      Hauptversion
'      Nebenversion 
'      Buildnummer
'      Revision
'
' Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern 
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")> 

<Assembly: AssemblyVersion("1.0.0.*")> 
<Assembly: AssemblyFileVersion("1.0.0.*")> 
Offline TheWizEd  
#4 Posted : 25 July 2011 23:06:53(UTC)
TheWizEd


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2010(UTC)
Posts: 178
Man
United States

Was thanked: 19 time(s) in 13 post(s)
Mojo,

I noticed you missed the Return Me.terminfos in TermHandled Property.

Public ReadOnly Property TermsHandled As SMath.Manager.TermInfo() Implements SMath.Manager.IPluginHandleEvaluation.TermsHandled
Get
Return Me.terminfos ' <- missing
End Get
End Property

Hope that does it for you.
Ed
Offline maweilian  
#5 Posted : 12 August 2011 07:44:26(UTC)
maweilian


Rank: Advanced Member

Groups: Registered
Joined: 09/01/2010(UTC)
Posts: 102
Man
United States
Location: Oregon, USA

Was thanked: 5 time(s) in 5 post(s)
Mojo,

I am curious to know if Ed's suggestion solved your problem. Post and let us know.

Thanks, Will
Will Massie
Mechanical Engineer
Oregon, USA
Offline Mojo  
#6 Posted : 15 September 2011 06:53:28(UTC)
Mojo

Rank: Newbie

Groups: Registered
Joined: 16/05/2011(UTC)
Posts: 4
Location: Berlin

Dear Ed, dear Will,

it seems that you found out my problem. I didn't tried it yet, but I will do on weekend, when I'm out of daily business.

If Ed posted the right solution, the answer will be up in the next post.

Thank you so far,
Mojo
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.