dcsimg
Results 1 to 18 of 18

Thread: Downloaded a class library (.dll) But Not Working !!!

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2014
    Posts
    12

    Exclamation Downloaded a class library (.dll) But Not Working !!!

    Hi EveryOne
    Two Days Ago I Downloaded many class libraries among them one from this website


    .NET random number generators and distributions - CodeProject





    and i managed to add it to Visual Studio 2013


    But the thing is none of functions are working


    for example the function IsValidAlpha supposed to return TRUE or False
    instead it does nothing at ALL


    this is a preview

    Name:  Sans titre 2.jpg
Views: 312
Size:  126.4 KB

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,917

    Re: Downloaded a class library (.dll) But Not Working !!!

    My guess would be that you're not calling it correctly and an exception is being thrown. When an exception is thrown in the Load event handler it will get swallowed without notification. Try wrapping that line in an exception handler and see if an exception is thrown and, if so, what the error message is.
    Code:
    Try
        Label1.Text = newclass3.IsValidAlpha(3)
    Catch ex As Exception
        MessageBox.Show(ex.Message)
    End Try
    You should also turn Option Strict On because, if there is a run-time exception, that possibility would probably have been flagged as an issue at compile time in that case.

  3. #3
    PowerPoster make me rain's Avatar
    Join Date
    Sep 2008
    Location
    india/Hubli
    Posts
    2,184

    Re: Downloaded a class library (.dll) But Not Working !!!

    and i managed to add it to Visual Studio 2013
    you mean you have added the reference to the .Dll file
    is the code running normal or any bugs , it is difficult (almost impossible ) to judge how the class Troz... is implemented
    try
    label1.text = newclass3.Isalpha(3).tostring
    The averted nuclear war
    My notes:

    PrOtect your PC. MSDN Functions .OOP LINUX forum
    .LINQ LINQ videous
    If some one helps you please rate them with out fail , forum doesn't expects any thing other than this

  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2014
    Posts
    12

    Re: Downloaded a class library (.dll) But Not Working !!!

    Thanks jmcilhinney For your quick reply
    i did what you told me to do
    and i got this Message
    Name:  Sans titre 1.jpg
Views: 123
Size:  25.0 KB

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2014
    Posts
    12

    Re: Downloaded a class library (.dll) But Not Working !!!

    For the Reference
    Name:  Sans titre 2.jpg
Views: 136
Size:  103.3 KB

    Also i tried Tostring erlier but didnt work

  6. #6
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,917

    Re: Downloaded a class library (.dll) But Not Working !!!

    Quote Originally Posted by unpalis View Post
    Thanks jmcilhinney For your quick reply
    i did what you told me to do
    and i got this Message
    Name:  Sans titre 1.jpg
Views: 123
Size:  25.0 KB
    Ah, OK then, I probably should have spotted that to begin with but wasn't really looking for it. You have declared all those variables but you haven't created any objects. You can't call methods on objects that don't exist. In order to create an instance of a class you have to use the New keyword.

  7. #7

    Thread Starter
    New Member
    Join Date
    Jan 2014
    Posts
    12

    Re: Downloaded a class library (.dll) But Not Working !!!

    Quote Originally Posted by jmcilhinney View Post
    Ah, OK then, I probably should have spotted that to begin with but wasn't really looking for it. You have declared all those variables but you haven't created any objects. You can't call methods on objects that don't exist. In order to create an instance of a class you have to use the New keyword.
    If you Excuse me

    Can you help with creating object just like you said
    i'm a newbie in VB

    Here is my Complete code

    Code:
    Imports MathNet.Numerics.Distributions.Normal
    Imports Troschuetz.Random.ContinuousUniformDistribution
    Imports Troschuetz.Random.NormalDistribution
    Imports dnAnalytics.Statistics.Distributions.Normal
    
    Public Class Form1
    
        Dim newclass As MathNet.Numerics.Distributions.Normal
        Dim newclass2 As Troschuetz.Random.NormalDistribution
        Dim newclass3 As Troschuetz.Random.ContinuousUniformDistribution
        Dim newclass4 As dnAnalytics.Statistics.Distributions.Normal
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Try
                Label1.Text = newclass3.IsValidAlpha(3)
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
    
        End Sub
    End Class
    as you see i tried in multiple libraries (MathNet.Numerics.Distributions,Troschuetz.Random,dnAnalytics.Statistics.Distributions)
    if you could help just with one i appreciate it
    and once more excuse me for taking your time

  8. #8

    Thread Starter
    New Member
    Join Date
    Jan 2014
    Posts
    12

    Re: Downloaded a class library (.dll) But Not Working !!!

    Hi there Again thanks to you it worked

    Name:  Sans titre.jpg
Views: 128
Size:  163.0 KB

    but i have another question if you don't mind
    In Cumulative it gives me the right result
    but in InvCumulative ilts always either '+infini' or -'infini'

    even if the function must return a Double just like the Cumulative function

    Name:  Sans titre 5.jpg
Views: 112
Size:  51.7 KB

  9. #9

    Thread Starter
    New Member
    Join Date
    Jan 2014
    Posts
    12

    Re: Downloaded a class library (.dll) But Not Working !!!

    I Solved the Problem Above
    But as always i got another problem
    when i try to Create a Object i have this error msg
    Name:  Sans titre.jpg
Views: 107
Size:  35.7 KB
    Argument Not Specified For 'mu' public sub New(mu as double,sigma as double)

    but i don't know to access them (mu and sigma) and initialize them

    Please Help
    thanks

  10. #10
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,917

    Re: Downloaded a class library (.dll) But Not Working !!!

    The reason that you have to use the New keyword to create an object is that the New keyword invokes a constructor, which is a special method that creates an object. Just like other methods, constructors can have zero, one or more parameters. When you call a method that has parameters you must pass a value to each of those parameters, i.e. the method arguments, and constructors are no different. The constructor that you're calling has two parameters so you must pass two arguments to the constructor when you call it. You don't "access" the values; you create them. It's up to you to decide what the values are based on what you want the code to do. If you don't know what the values represent then I suggest that you review the documentation for that library and/or the mathematics that it implements. Judging by the names of those parameters, they correspond directly to variables in a mathematical equation and if you're trying to do the maths then you should know what they mean.

  11. #11

    Thread Starter
    New Member
    Join Date
    Jan 2014
    Posts
    12

    Re: Downloaded a class library (.dll) But Not Working !!!

    I know what does those parameters, what i need is the user enter the 'mu' and the 'sigma' from a text-box , but the problem is i don't know how to affect those too parameters
    i don't know even how to access those parameters , that's what i asked you before in my earlier reply
    So please if you know how i will appreciate it

  12. #12

    Thread Starter
    New Member
    Join Date
    Jan 2014
    Posts
    12

    Re: Downloaded a class library (.dll) But Not Working !!!

    if you could give me an example how to pass avalue for the 'mu' and 'sigma' parametres
    thnks

  13. #13

    Thread Starter
    New Member
    Join Date
    Jan 2014
    Posts
    12

    Re: Downloaded a class library (.dll) But Not Working !!!

    I found the solution thanks to God and To you
    thank you one more time jmcilhinney

  14. #14
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,242

    Re: Downloaded a class library (.dll) But Not Working !!!

    thanks to God and To you
    There's a difference?
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  15. #15

    Thread Starter
    New Member
    Join Date
    Jan 2014
    Posts
    12

    Re: Downloaded a class library (.dll) But Not Working !!!

    Of Course there is my friend
    It's God who makes things happen

  16. #16

    Thread Starter
    New Member
    Join Date
    Jan 2014
    Posts
    12

    Re: Downloaded a class library (.dll) But Not Working !!!

    Hi Can i Get Some help Here
    Is there anyway to avoid this error

    Name:  Sans titre 3.jpg
Views: 84
Size:  43.7 KB

    +
    about the property in the Documentation

    Public ReadOnly Property Median As Double

  17. #17
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,917

    Re: Downloaded a class library (.dll) But Not Working !!!

    Quote Originally Posted by unpalis View Post
    Hi Can i Get Some help Here
    Is there anyway to avoid this error

    Name:  Sans titre 3.jpg
Views: 84
Size:  43.7 KB

    +
    about the property in the Documentation

    Public ReadOnly Property Median As Double
    You would need to the author about that. If they haven't implemented the property then you can't use it but leaving a NotImplementedException in production code is a disgrace.

  18. #18

    Thread Starter
    New Member
    Join Date
    Jan 2014
    Posts
    12

    Re: Downloaded a class library (.dll) But Not Working !!!

    Yeah i got many NotImplementedException error in different classes
    Thank you one more time

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width