irisbenji
09-09-2003, 04:23 AM
I feel bad as my problem lasts for too long now.
I m writing a program to create capsules in Rational Rose RT, the capsules are available from Vbasic as i have the libraries. I have problem with the necessity to create objects. (I may probably need to know more about this necessity)
Every time i need to create an object, I do. But when I execute form Rational Rose RT, i get "activeX component can t create object".
Do I miss to include a reference or something? is it really impossible to create an object inside Rational Rose, from a visual basic program ?
Thanks a lot.....
vbfan
09-09-2003, 05:58 AM
Are you doing this:
Option Explicit
Dim MyVar As RotationCls'don't know how it's called _
but you have to declare it as the classmodul you will use not as the lib name
Private Sub Form_Load()
Set MyVar = new RotationCls
myVar.Examplefunc "Test"
Set myVar = nothing
End Sub
Maybe this thread will help you:
http://www.visualbasicforum.com/showthread.php?threadid=7290
There JDT describe how to make your own Dlls and how to use them in your Projects.
(Second part is the same for 3rd Party dlls)
irisbenji
09-09-2003, 06:11 AM
no i was not doing that, i ll try, what do you mean by
myVar.Examplefunc "Test"
vbfan
09-09-2003, 06:18 AM
With that I will show you how to call then the function, subs or the other things which are there you can use. Examplefunc is only an ie function which will surely doesn't exist in your dll, but it should show how to use the dll.
irisbenji
09-09-2003, 07:05 AM
You see, actually, without yet doing what u told me, i m reading the document.
If I do
Dim aCapsule As New RoseRT.???
I want to choose capsule instead of ??? of course, but i can only choose Application or ContolableElementCollection.
(i dunno if there s a link but these possibilities are the RoseRT parameters in the function where I want to do my staff) I imagine that these 2 are ok cos activex don t need to create them as they are given in parameters...stupid or not?
With that I will show you how to call then the function, subs or the other things which are there you can use. Examplefunc is only an ie function which will surely doesn't exist in your dll, but it should show how to use the dll.
vbfan
09-09-2003, 07:20 AM
Is RoseRT the Libname or the classmodul name?
When it's the Libname you will not find the capsule(only when it's an classmodul) You have to declare your Variable as a Classmodul after that you can access the Functions|Subs which are stored their.
When you declare it as Library you can't get access to the Functions|Subs.
When it's a classmodul name you're useing the wrong one or the capsule thing is one more "step" lower. That means you have then to make something like this:
ACapsule.Application.Capsule
Let me explain that a bit more.
Your dll you like to use have at leat one classmodul you can see the name by typing this:"RoseRT." after the point, appears a list with possible Suboperators.(now you know How your Cls Modul is called.)
So lets say it's called "Rose".
then we do this in the option explicit:
Dim MyRose As Rose' or use : Dim MyRose As New Rose
Then in your Project you make this:(so let's say the class modul Rose have a Function|sub called Capsule)
private Sub Command1_Click()
MyRose.capsule ...'for the 3 dots write the Code which is needed for capsule.
When in this ClsModul isn't a name Capsule you have to see if in the dll RoseRT is any other clsModul where the Capsule(thing) is stored.
irisbenji
09-09-2003, 07:42 AM
Actually, a capsule is an element that exist in a library called RoseRT.
My class module is calles "clsmain.cls". But if i want to create a capsule, there is nothing about it in my vb code.
(a capsule is an element in the software roseRT. do you think I can create one in the visual basic program?)
You mean that i should look for the name of the class module that contains the staff about the capsules. you do not mean to use my project's class module, do you? but where can i find the name of the right class module, what kind of file is that, how can i get and use it correctly in vb? after RoseRT., there are lots RSactionkind, RSclasskind, RSRegistrationmode, as you said, i could know now how it is called but i do not., ????
But capsule is directly in the library RoseRT. anyway i want to follow your idea of class module, but i don t really manage as i said 5 lines above
Dim aCapsule As RoseRT.??? Capsule instead of ??? is possible
but Dim aCapsule As New RoseRT.??? Application or controlableElementColletion are available...if i keep the first one i ll be ask that an object is required.
Is RoseRT the Libname or the classmodul name?
When it's the Libname you will not find the capsule(only when it's an classmodul) You have to declare your Variable as a Classmodul after that you can access the Functions|Subs which are stored their.
When you declare it as Library you can't get access to the Functions|Subs.
When it's a classmodul name you're useing the wrong one or the capsule thing is one more "step" lower. That means you have then to make something like this:
ACapsule.Application.Capsule
Let me explain that a bit more.
Your dll you like to use have at leat one classmodul you can see the name by typing this:"RoseRT." after the point, appears a list with possible Suboperators.(now you know How your Cls Modul is called.)
So lets say it's called "Rose".
then we do this in the option explicit:
Dim MyRose As Rose' or use : Dim MyRose As New Rose
Then in your Project you make this:(so let's say the class modul Rose have a Function|sub called Capsule)
private Sub Command1_Click()
MyRose.capsule ...'for the 3 dots write the Code which is needed for capsule.
When in this ClsModul isn't a name Capsule you have to see if in the dll RoseRT is any other clsModul where the Capsule(thing) is stored.