Variablentransfer within a class module and form

I have got a dll project which consists of a class module (cClass) and a form (formdll) (Modal)

In class Module I have got a public subroutine:

Public sub graph(x,y,z....)

This subroutine  does some basic calculations and populates an X;Y graph on the form.
---

I invoke this by Calling this subroutine from the server application
Call graph(X,Y,Z...)

As a result the graph is redrawn and everything works fine.
Now my Problem.
The form (formdll) needs to be modal and after I call the subroutine graph the focus is on this form.

In order to redraw the graph in a different scale I would like to use the variables (X,Y,Z...) again but they are out of scope by now.
So in essens I need to be able to recall the subroutine graph(X,Y,Z...) from the form with the same variables as from the server application.

One way would be to make all the different variables public wityhin the class module, but I would like to avoid this.

I hope the problem is understanable?
themrocAsked:
Who is Participating?
 
Computer101Commented:
PAQed with points refunded (250)

Computer101
EE Admin
0
 
ravs120499Commented:
You can create a method rescale() on the class to which you just pass in a scaling factor rather than x, y, z. The rescale method uses (private) member variables x, y, z to plot the new dimensions.

But if you must have x, y, z values available to the form then you will need to do something like
define a method getDimensions() that returns an array of x, y, z (or define 3 methods getX(), getY() etc.).

HTH
- Ravs
0
 
themrocAuthor Commented:
ravs,
the problem is that I can not access the variables again from the server application. So is there any way to keep the variales within the form or class module environment?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
ravs120499Commented:
I don't get the problem - you have instantiated the class module the object is in scope within the server, isn't it? So why can't you just depend on the object to keep track of x, y, and z?
0
 
themrocAuthor Commented:
Ravs:
The problem was that in my dll there is a class module and a form module.
Than variables were used in the class module and I needed to access the same variables from the form module.
The problem is that when I tried to acces the variables with MyClass.... there was no reference from the form to the class module. So as a result I set the reference with
Set Myclass = new class.
When I did this the variables were lost.

In the end I did the following which works now:
I created annother ordinary module within my dll project. Then I transfer the variables which I need to this module. Here they are dimensioned on a module level. With this methode I am able to access the variables from the form and it works.

But maybe you have an idea whether it is possible to retrive variables in a form within a dll from a class module?
Otherwise I close the Question.
Thanks
Themroc
0
 
themrocAuthor Commented:
Dan Rollins, cause I answered the Question on my own I would like to ask for a refund
themroc
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.