Loading ...
Sorry, an error occurred while loading the content.

Re: [libertybasic] (unknown)

Expand Messages
  • Doyle Whisenant
    ... Nothing scary will happen. If you don t delete dcs, they will be released when you restart your computer. Actually, I ve very seldom had any problems at
    Message 1 of 37 , May 1 3:34 AM
    • 0 Attachment
      bwilsonnow wrote:

      >I am a bit nervous about this since I am supposed to release DC's and
      >delete DC's and a bitmap and wondering if I don't do it right will my
      >computer crash and burn or what kind of scarry things could happen.
      >
      >

      Nothing scary will happen. If you don't delete dcs, they will be
      released when you restart your computer. Actually, I've very seldom had
      any problems at all.

      A couple of comments as I don't have time to debug this now:

      > print #clock, "place 20 20; This is a Print Test"
      >
      I get an error in the line above.

      >
      >
      >' 1. Get the DC of the graphics window.
      >hw = hwnd(#clock)
      >open "user32.dll" for dll as #user
      >calldll #user, "GetDC", hw as word, hdc as word
      >
      >' 2. Create a compatible DC
      >calldll #gdi32, "CreateCompatibleDC", comdc as long, dcmemory as long
      >
      >

      You get the hdc above with "GetDC" and need to use it in the
      "CreateCompatibleDC" call.

      Try:

      calldll #gdi32, "CreateCompatibleDC", hdc as long, dcmemory as long


      >' 3. Create a compatible bitmap in memory.
      >calldll #gdi32, "CreateCompatibleBitmap", combitdc as long,_
      >nWidth as long, nHeight as long, handleBMP as long
      >
      >
      I think "combitdc" above should be "hdc"

      <big snip>

      >
      >' 8. Delete the memory DC.
      >calldll #gdi32, "deleteDC", dcmemory as long, as boolean 'deletes
      >memory dc.
      >
      >

      You absolutely must spell the API calls exactly as shown in the
      documentation and you don't have a value for the return boolean!

      "deleteDC" must be "DeleteDC"

      Try:

      calldll #gdi32, "DeleteDC", dcmemory as long, r as boolean


      TIP: When doing API calls, use debug to check for the return values from
      each call. Most of the calls above will return greater than zero if
      successful and zero if not. If you get zero then find out why before you
      move on to the next call. Each call will depend on the preivious correct
      return before the next API call will work correctly. Of course you need
      to know what will be returned. Some calls will return zero for a correct
      return. It depends on the particular API call.

      HTH

      --
      Doyle Whisenant
      mechanic@...
      http://www.mechanic.0catch.com/
    • Chergarj@cs.com
      In a message dated 9/26/2006 5:11:58 PM Pacific Daylight Time, ... Most of Liberty BASIC is relatively easy to learn; but the study is demanding. Still, most
      Message 37 of 37 , Sep 26, 2006
      • 0 Attachment
        In a message dated 9/26/2006 5:11:58 PM Pacific Daylight Time,
        lendesouza@... writes:
        > I wrote a program in QB 4.5 a few months
        > ago and would like to convert it to LB because LB is Windows based. How
        > difficult would it be to make this conversion? I
        >

        Most of Liberty BASIC is relatively easy to learn; but the study is
        demanding. Still, most of LB is easier to learn than QB. You should be able to
        convert almost any program from QB to LB. Also check the LB ConForums for a section
        about QB-LB conversions.

        tooanalytical


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.