Link to home
Start Free TrialLog in
Avatar of DianeCrawford
DianeCrawford

asked on

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
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

What do you mean by "problem with alignment" ?
CHeers
Avatar of DianeCrawford
DianeCrawford

ASKER

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....
a.. not sure about your problem.. hehe...
how about change your font to courier new?
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
ASKER CERTIFIED SOLUTION
Avatar of pierrecampe
pierrecampe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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' ?
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.

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....
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....
DianeCrawford
i hereby appologize for shouting at you