Padding UDT's in VB

I have a VB4 project and I have migrated to VB6. The app lication is making use of UDT's and I seem to have a problem with alignment. Can anyone help me here??

This is an example of one of the UDT's:-

Type typInvestCbl
   
    intVInvSeqNo                    As Integer
    intMVInvNumber                  As Integer
   
    dblMVInvBase                    As Double           'Curr I/O - updated by CBL
    dblMVPremAllocation             As Double           'I/O
    dblMVUnitValue                  As Double           'Curr I/O - updated from UV tbl
    dblMVUnitValueGainLoss          As Double
   
    dblMVUnitValueLast              As Double
    dblVInvUnits                    As Double
    dblVLastInvBase                 As Double
    dblVUpdInvBase                  As Double
    dblVInvEarnings                 As Double
    dblVLoanGuarInt                 As Double
    dblVAdjInvBase                  As Double
   
    dblVIntFactor                   As Double
    dblVSplitNIP                    As Double
    dblVMortCharge                  As Double
    dblVAdminCharge                 As Double
    dblVMortGiveback                As Double
    dblVGuarMinDeathBen             As Double
    dblVBenPremium                  As Double
    dblVSalesCharge                 As Double
    dblVExpenseCharge               As Double
    dblVUPBCharge                   As Double
    dblVRdrMlyTerMchg               As Double
    dblVNetGainLoss                 As Double
End Type

Type typInvestInputCbl
    strVStart                       As String * 8
    intMVInvDivCounter              As Integer
    ProductInvestCbl(20)            As typInvestCbl
End Type
DianeCrawfordAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
pierrecampeConnect With a Mentor Commented:
in the Type typInvestInputCbl
strVStart As String * 8
is actually 16 bytes long in vb6
in vb1-4 it was 8 bytes (i think)
so maybe the external dll expects 8 bytes and gets 16 ?
   
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
What do you mean by "problem with alignment" ?
CHeers
0
 
DianeCrawfordAuthor Commented:
I have padding issue.....VB4 uses WORD alignment and VB6 uses DWord alignment so my UDT's not aligned properly when passed to an external dll....
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
yongyihCommented:
a.. not sure about your problem.. hehe...
how about change your font to courier new?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Yes, VB4 is 16bit and VB6 32bit. I guess that the external dll is also only 16bit, which explains the problem.
To solve, I would try to get the external dll also as 32-bit...
CHeers
0
 
pierrecampeCommented:
HEY, whats with the 'C' grade
if you dont like a comment then DO NOT accept it as an answer
so WHY is the 'C' ?
0
 
Computer101Commented:
Please read below.  Due to no explanation, grade changed.

Computer101
E-E Moderator


How Do I Know What Grade to Give?
Although we use an A-D scale here at Experts Exchange, it works differently than, say, school grades. If one or more Experts' proposals are accepted as answers, they should usually be given an A or B grade, since they have taken the time to provide you with a working solution. If a possible solution is incomplete - ask for clarification or details before accepting the answer and grading it. People should not be given lower grades because of incorrect grammar or because you just accepted their answer or comment to close the question. Keep in mind, your question and any follow-up comments should be focused so that there can be a specific answer. The following is a good guideline to follow when grading:

A: The Expert(s) either provided you with a thorough answer or they provided you with a link to information that thoroughly answered your question. An "A" can also be given to any answer that you found informative or enlightening beyond the direct question that you asked.

B: The Expert(s) provided an acceptable solution, or a link to an acceptable solution, that you were able to use, although you may have needed a bit more information to complete the task.

C: Because Experts' reliability are often judged by their grading records, many Experts would like the opportunity to clarify if you have questions about their solutions. If you have given the Expert(s) ample time to respond to your clarification posts and you have responded to each of their posts providing requested information; or if the answers, after clarification, lack finality or do not completely address the issue presented, then a "C" grade is an option. You also have the option here of just asking Community Support to delete the question.

Remember, the Expert helping you today is probably going to be helping you next time you post a question. Give them a fair chance to earn an 'Excellent!' grade and they'll provide you with some amazing support.

0
 
DianeCrawfordAuthor Commented:
Sorry Experts,

I was unaware that I gave a grade C and I didn't know until today that there was a grading system.....

Sorry this will not happen again.....

Thanks for everyone help in the past and I hope I can get help in the future....
0
 
DianeCrawfordAuthor Commented:
Sorry Experts,

I was unaware that I gave a grade C and I didn't know until today that there was a grading system.....

Sorry this will not happen again.....

Thanks for everyone help in the past and I hope I can get help in the future....
0
 
pierrecampeCommented:
DianeCrawford
i hereby appologize for shouting at you
0
All Courses

From novice to tech pro — start learning today.