Solved

Conversion to DOT NET of Microsft.VisualBasic.PowerPacks.LineShape and Microsoft.VisualBasic.PowerPacks.ShapeContainer

Posted on 2009-04-14
6
3,688 Views
Last Modified: 2013-11-08
hello,
I have migarted a VB6.0 Project to VB.Net. There was a code as Microsoft.VisualBasic.PowerPacks.LineShape and Microsoft.VisualBasic.PowerPacks.ShapeContaine. The type no more exists in DOT NET environment. Can anyone please tell me the equivalent to be used in DOT NET or how to proceed to achieve the same.
Thanks
Public WithEvents linSize As Microsoft.VisualBasic.PowerPacks.LineShape

Public WithEvents ShapeContainer1 As Microsoft.VisualBasic.PowerPacks.ShapeContainer

Open in new window

0
Comment
Question by:MPakeezah
  • 4
  • 2
6 Comments
 
LVL 39

Expert Comment

by:abel
ID: 24136521
You can still use them. Include a reference to Microsoft.VisualBasic.PowerPacks.Vs (rightclick project, click Add Reference, search on the .NET tab for the right name) and then add an Imports statement on the top of your class:

Imports Microsoft.VisualBasic.PowerPacks

after that you can port your code the same way you ported the other code. Recent reference for .NET 3.5 about ShapeContainer: http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.powerpacks.shapecontainer.aspx

-- Abel --
0
 

Author Comment

by:MPakeezah
ID: 24136542
I forgot to mention that all references to Visual Basic Needs to be removed. The  code will be future migrated to C#.Net.
Please provide me with another solution.
Thanks.
0
 
LVL 39

Expert Comment

by:abel
ID: 24136585
This is not a reference to VisualBasic. It is a reference to a .NET library that is part of the .NET framework (and will stay part of it in the distant future, just like System or Windows.Forms).

It is always available and Microsoft suggests you use it. The name of "VisualBasic" in the library is to make migration easier, but it has nothing to do with VB6 (which uses COM object and not managed .NET objects).

Why reinvent the wheel if it has already been reinvented (i.e., ported) for you?
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 39

Expert Comment

by:abel
ID: 24136600
PS: you do not even need to add extra libraries to your final package, it is part of the Common Language Runtime. This is the note of MS about it:
The Microsoft.VisualBasic.PowerPacks namespace contains classes for the Visual Basic Power Packs controls. Visual Basic Power Packs controls are additional Windows Forms controls. They were originally released as free add-ins and are now included in Visual Studio.
0
 

Author Comment

by:MPakeezah
ID: 24136648
Thanks, will get back after confirming if this Dot NET Reference can be kept.
Regards.
0
 
LVL 39

Accepted Solution

by:
abel earned 500 total points
ID: 24136682
ok.

Note that where I said "Imports", you should use "using", like so, which is the way to make programming with namespaces easier:

using Microsoft.VisualBasic.PowerPacks;

(and send a message to MS to complain about the ill-naming of the package containing the name VisualBasic, assuming it cannot be used by other languages, which is ridiculous, you can just use it)
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

930 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

8 Experts available now in Live!

Get 1:1 Help Now