Solved

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

Posted on 2009-04-14
6
3,652 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

706 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

19 Experts available now in Live!

Get 1:1 Help Now