Author Topic: Windows programming  (Read 3113 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Windows programming
« on: December 19, 2010, 11:52:35 AM »
Deleted
« Last Edit: April 14, 2015, 03:32:59 AM by Peter »

Charles Pegge

  • Guest
Re: Windows programming
« Reply #1 on: December 19, 2010, 01:37:09 PM »

Will do! Thanks Peter.

Charles

Charles Pegge

  • Guest
Re: Windows programming
« Reply #2 on: December 19, 2010, 11:24:49 PM »

Peter,

I checked low level bind for CreateFont and found it worked correctly but I agree that declaring this function is more satisfactory.

Code: [Select]
a=fw_bold or fw_light
hFont = CreateFont (80,16,0,0,a,0,0,0,0,0,0,0,0,"times")

With low level binding:

1 You are restricted to passing variable and constants of the matching type.

2 Array variables, Functions and expressions cannot be passed as parameters.

3 Dynamic strings must be passed with the correct indirection - usually *string.

4 There is no automatic check that the binding was successful (typos etc).

Charles

Charles Pegge

  • Guest
Re: Windows programming
« Reply #3 on: December 20, 2010, 09:23:39 AM »
Ah yes,

you need alias CreateFontA for ansi fonts

Code: [Select]
CreateFont       CreateFontA

You can check for run time errors after binding like this

Code: [Select]
string e
e=error
if e then
  print e
  '... termination procdures
end if

if there is a runtime problem then error() returns a string listing the errors then automatically clears the error buffer.

Charles