-
Jan 19th, 2014, 07:48 AM
#1
Thread Starter
New Member
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
-
Jan 19th, 2014, 07:56 AM
#2
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.
-
Jan 19th, 2014, 07:59 AM
#3
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
-
Jan 19th, 2014, 08:04 AM
#4
Thread Starter
New Member
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
-
Jan 19th, 2014, 08:08 AM
#5
Thread Starter
New Member
Re: Downloaded a class library (.dll) But Not Working !!!
For the Reference
Also i tried Tostring erlier but didnt work
-
Jan 19th, 2014, 08:56 AM
#6
Re: Downloaded a class library (.dll) But Not Working !!!
Originally Posted by unpalis
Thanks jmcilhinney For your quick reply
i did what you told me to do
and i got this Message
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.
-
Jan 19th, 2014, 09:26 AM
#7
Thread Starter
New Member
Re: Downloaded a class library (.dll) But Not Working !!!
Originally Posted by jmcilhinney
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
-
Jan 19th, 2014, 10:22 AM
#8
Thread Starter
New Member
Re: Downloaded a class library (.dll) But Not Working !!!
Hi there Again thanks to you it worked
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
-
Jan 19th, 2014, 05:13 PM
#9
Thread Starter
New Member
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
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
-
Jan 19th, 2014, 07:12 PM
#10
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.
-
Jan 20th, 2014, 07:15 AM
#11
Thread Starter
New Member
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
-
Jan 20th, 2014, 07:17 AM
#12
Thread Starter
New Member
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
-
Jan 20th, 2014, 07:57 AM
#13
Thread Starter
New Member
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
-
Jan 20th, 2014, 09:36 AM
#14
Re: Downloaded a class library (.dll) But Not Working !!!
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!
-
Jan 20th, 2014, 10:23 AM
#15
Thread Starter
New Member
Re: Downloaded a class library (.dll) But Not Working !!!
Of Course there is my friend
It's God who makes things happen
-
Jan 21st, 2014, 05:48 PM
#16
Thread Starter
New Member
Re: Downloaded a class library (.dll) But Not Working !!!
Hi Can i Get Some help Here
Is there anyway to avoid this error
+
about the property in the Documentation
Public ReadOnly Property Median As Double
-
Jan 21st, 2014, 06:19 PM
#17
Re: Downloaded a class library (.dll) But Not Working !!!
Originally Posted by unpalis
Hi Can i Get Some help Here
Is there anyway to avoid this error
+
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.
-
Jan 21st, 2014, 07:03 PM
#18
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|