Advertisement

11.21.2008 at 08:26AM PST, ID: 23925550
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.2

VB6 Datatype to VB.Net AKA:How to use  System.Runtime.InteropServices.MarshalAs

Asked by GeekHipster in Btrieve 4GL Database, Visual Basic Programming, Microsoft Visual Basic.Net

I have this VB6 Datatype that I need to convert to VB.NET I have no clue how to handle the arrays...  Little help??

Type BVInventoryRecord
    InvWhse                            As String * 6
    InvPartCode                        As String * 34
    InvDescription                     As String * 80
    InvProductCode                     As String * 10
    InvLocation                        As String * 20
    InvOnHoldFlag                      As String * 1
    InvCurrentCost                     As String * 17          'Mask ±##########.#####
    InvAverageCost                     As String * 17          'Mask ±##########.#####
    InvSellingPrice(1 To 20)           As String * 17          'Mask ±##########.#####
    InvPromoStartDate                  As String * 8
    InvPromoEndDate                    As String * 8
    InvPromoFlag                       As String * 1
    InvPromoMandatoryFlag              As String * 1
    InvPromoSellingPrice               As String * 17          'Mask ±##########.#####
    InvQuantityBreak(1 To 9)          As BVQuantityBreaks
    InvTaxFlag(1 To 4)                 As String * 1
    InvMeasure                         As String * 10
    InvCurrentPONo                     As String * 10
    InvPODueDate                       As String * 8
    InvMinBuyQty                       As String * 11
    InvDiscountableFlag                As String * 1
    InvSerializedFlag                  As String * 1
    InvSalesAccount                    As String * 4
    InvOnHandQty                       As String * 17          'Mask ±##########.#####
    InvReorderPointQty                 As String * 17          'Mask ±##########.#####
    InvCommittedQty                    As String * 17          'Mask ±##########.#####
    InvBackOrderQty                    As String * 17          'Mask ±##########.#####
    InvOnOrderQty                      As String * 17          'Mask ±##########.#####
    InvAltPartWarehouse                As String * 6
    InvAltPartCode                     As String * 34
    InvMisc1                           As String * 30
    InvMisc2                           As String * 17          'Mask ±##########.#####
    InvSalesByPeriod                   As BVSalesByPeriod
    InvType                            As String * 1
    InvImageFileName                   As String * 261
    InvWeight                          As String * 13          'Mask ±######.#####
    InvECommerceFlag                   As String * 1
    InvUPCCode                         As String * 40
    InvPreferredVendor                 As String * 20
    InvXtdDesc                         As String * 5000
    InvUomDesc                         As String * 80
    InvAllowBackOrders                 As String * 1
    InvAllowReturns                    As String * 1
End Type

So far I have:
Structure BVInventoryRecord
            <VBFixedString(6), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst:=6)> Private sInvWhse As Char()
            <VBFixedString(34), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst:=34)> Private sInvPartCode As Char()
            <VBFixedString(80), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst:=80)> Private sInvDescription As Char()
            <VBFixedString(10), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst:=10)> Private sInvProductCode As Char()
            <VBFixedString(20), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst:=20)> Private sInvLocation As Char()
            <VBFixedString(1), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst:=1)> Private sInvOnHoldFlag As Char()
            <VBFixedString(17), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst:=17)> Private sInvCurrentCost As Char()
            <VBFixedString(17), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst:=17)> Private sInvAverageCost As Char()


But then I hit the arrays and Im not sure how to represent themStart Free Trial
[+][-]11.21.2008 at 04:27PM PST, ID: 23018221

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Btrieve 4GL Database, Visual Basic Programming, Microsoft Visual Basic.Net
Sign Up Now!
Solution Provided By: lludden
Participating Experts: 1
Solution Grade: B
 
 
[+][-]11.27.2008 at 06:30AM PST, ID: 23050145

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.16.2008 at 11:29AM PST, ID: 23186971

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628