Solved

Converting a program into a reusable class

Posted on 2008-06-25
7
161 Views
Last Modified: 2013-11-26
I have a project which consists of a form into which an invoice number is entered. This invoice number is then passed to a module which in turn calls a report which prints the invoice.

I am trying to develop some method by which I can pass the invoice number from any project and produce a report. Ideally the "method" will be some stand-alone class which I can then add to any project and get the functionality. To start with I would like to change my current project to call this new entity to prove that it works.

Any suggestions anyone?
0
Comment
Question by:grwallace
  • 4
  • 3
7 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 21866676
It sounds like you need to create a DLL project, with a reusable class that has a method that takes the arguments that you need.  Are you saying that you don't have any experience creating DLL projects and classes?
0
 

Author Comment

by:grwallace
ID: 21866827
The answer to that has to be Yes, as I had no idea that this is what needed to be done.
How would I go about doing this in VB.Net 2008?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 21866892
SWAG:

1) Create a DLL project
2) Add a class to the project
3) Add method to the class
4) Take the code from the form, and put into the method.

The specific steps are dependent on what you are really trying to accomplish.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:grwallace
ID: 21866964
In  the VB6 days I simply held the .bas in the programs folder and added it to the differenct projects along with the report.

This approach would be OK if I could do it here, but I can't add the report.
Is it possible to change the module - which callse the report - to a class and reference it from other projects? if this was the case then it might be simpler. Otherwise I will have a go with the DLL idea

0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 21868132
You could do the same thing with VB.NET that you could with VB6.
0
 

Author Comment

by:grwallace
ID: 21882001
I have spent some time looking at this. I can indeed add the reports to a different project, but this would appear to make a copy, which means multiple version which is completly undesirable.

If i try to add as link then it adds the report but not the designer and the system doesn;'t work.

I would now like to try the DLL option mentioned earlier.
Currently the form consistes only the following code:-
 Private Sub Button1_Click(etc etc)
        BlUdt.Blinvoice.ThisBlmasId = 36833
        BlUdt.Blinvoice.ThisBlinvId = 32276
        Dim bilprt As New BilPrt
        bilprt.Do_Printout()
end sub
Bludt is a structure

I would now like to convert the BilPrt class into a dll and call it from the form. How do I go ablut this?
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 21887573
<P>>>I can indeed add the reports to a different project, but this would appear to make a copy</P><P>If you dragged and dropped the reports from one project to another, then it will make a copy, unless you hold down the shift key when you drag and drop.</P>
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now