x64 v x86

Windows specific forum
User avatar
sirrab
Enthusiast
Enthusiast
Posts: 106
Joined: Thu Dec 07, 2006 8:52 am
Location: New Zealand

x64 v x86

Post by sirrab »

If this has been asked before sorry :)

when I run the same program under 4.60 x86 and x64 I ge an invaid memory error when using 4.60 64bit.

Here is the code .

Code: Select all

Procedure setformfont()
     Restore setgadgetfont
     Repeat
          Read fhandle
          If fhandle <> -1
              SetGadgetFont(fhandle,FontID(formgadgetfont))
          EndIf
     Until fhandle = -1    
EndProcedure

and here is the datasection it requries

Code: Select all

datasection
 setgadgetfont:
  Data.l #currentstatement,#customers,#invaccountname,#invaccountno,#invoicenumber,#invoiceaddress,#invoicedate,#invcurrentbal
  Data.l #servicecode1,#servicetext1,#serviceamount1,#servicecode2,#servicetext2,#serviceamount2
  Data.l #servicecode3,#servicetext3,#serviceamount3,#servicecode4,#servicetext4,#serviceamount4,#invoicetotal
  Data.l #displayaccountname,#customeraccount,#paymentslist,#savepayclose
  Data.l #savepaynew,#paycancel,#invsaveclose,#invsavenew,#cancelinvoice,#accountname,#accountnumber
  Data.l #firstname,#lastname,#phonenumber,#cellnumber,#email,#cutaddress,#postaladdress,#copyaddress,#customercomfirm
  Data.l #customercancel,#chequedate,#chequeno,#chequesupplier,#chequeexpense,#chequeamount,#chequesave,#chequecancel
  Data.l #depositdate,#depositnumber,#depositamount,#depositref,#undeposited,#depositsave,#depositcancel
  Data.l #outstandiniginvoices,#todeposit,#invsummarylist,#bankbalance,#totalcustomers
  Data.l #tasktitle,#taskdate,#tasktype,#tasknotes,#taskstatus
  Data.l #supplieraddress,#supplierphone,#supplieremail,#suppliercontact,#customerbalance,#customerinvtype,#depositpaidto
  Data.l #emailaddress, #emailattachment, #emailbcc,#emailbody,#emailcustomername,#emailsubject,#emailtype,#customeractive
  Data.l #taskrepeat,#taskcompleteaction,#taskfilter,#taskfiltert,#customerlistfilter,#invnextcut,#invoiceaccountoverdue
  Data.l #stockcode,#stockdesc,#stockcodetype,#stockcost,#stocksell,#stocklist
  Data.l #setupcompanyname,#setupcompanydb,#addupdatecompany,#canceladdupdatecompany
  Data.l -1

enddatasection
am I doing something wrong. I just got my first 64bit pc so new to all this 64bit :)

Thanks
Craig
Ramihyn_
Enthusiast
Enthusiast
Posts: 314
Joined: Fri Feb 24, 2006 9:40 am

Re: x64 v x86

Post by Ramihyn_ »

sirrab wrote:

Code: Select all

          Read fhandle

Code: Select all

datasection
 setgadgetfont:
  Data.l #currentstatement,#customers,#invaccountname,#invaccountno,#invoicenumber,#invoiceaddress,#invoicedate,#invcurrentbal
Default type is .i which is the same 32-bit size as .l in x86 but 64bit in x64. Your Data is defined as 32-bit .l and your "Read fhandle" uses the default type which is 64-bit in x64.

Try replacing your "Read fhandle" with "Read.l fhandle" or better use "Data.i" instead of "Data.l" in your datasection.
User avatar
sirrab
Enthusiast
Enthusiast
Posts: 106
Joined: Thu Dec 07, 2006 8:52 am
Location: New Zealand

Re: x64 v x86

Post by sirrab »

Thanks Ramihyn_,

Learned something today :)

Now to go though and change all my data statements :)

Thanks again
Craig
Post Reply