Solved

Converting a program into a reusable class

Posted on 2008-06-25
7
167 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

635 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