Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

obj() problem in a function caused by xp sp2?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    obj() problem in a function caused by xp sp2?

    Ok folks, I have an interesting one for you.

    I created a function called centerform in A5V4 and it has worked in all subsequent versions til now.

    My desktop is running xp pro with sp 1. The autoexec line centerform("main menu") works correctly.

    My laptop is running xp home with sp2. Today, I installed A5V7 on it, copied all my folders from desktop so paths and everything would be the same, and started the adb that I have been working on. Low and behold, I received the following message:

    command f=formload(fname)
    object does not support requested inteface

    here are autoexec lines and the function code:

    Autoexec:
    Centerform("Main Menu")

    Centerform function

    function Centerform as L(fname as C)
    ' type your code here
    dim hscreen as n
    dim wscreen as n
    dim height as n
    dim width as n
    wscreen=ui_info(0)
    hscreen=ui_info(1)
    f=obj(fname)
    if is_object(f) then restore
    else
    f=form.load(fname)
    end if
    width=f.width
    height=f.height
    f.top=iif(height<hscreen,(hscreen-height)/2,0)
    f.left=iif(width<wscreen,(wscreen-width)/2,0)
    f.show()
    f.activate()
    centerform=.t.
    end function

    Anyone have any idea why this function works all the way from A5V4 thru A5V7 (xp pro w/sp1) and not on xp home w sp2?


    My two cents worth :)

    Oran

    #2
    Oran,

    I have xp profession, sp2 and your code works fine there. There must be some kind of conflict in the xp home .... I guess.

    I would suggest searching the microsoft knowledgebase and see if you can find the differences between the home and professional versions.

    Edited: maybe the home version does not allow for manipulation of windows.
    Cheryl
    #1 Designs By Pagecrazy
    http://pagecrazy.com/

    Comment


      #3
      I know you state that this function works on different windows versions but I'm puzzled by this part of your function...

      Code:
      if is_object(f) then restore
      else
            f=form.load(fname) 
      end if
      The usual structure is

      Code:
      if logicalexpression then
            some code
      else
            other code
      end if
      Also confused by "restore". I don't recognize that as an Alpha command/function/etc.
      There can be only one.

      Comment


        #4
        I found the following:

        http://support.alphasoftware.com/alp....RESTORE().htm

        perhaps the code has changed and it was restore back in the DOS days, without the '.' before it
        Cheryl
        #1 Designs By Pagecrazy
        http://pagecrazy.com/

        Comment


          #5
          Originally posted by Cheryl Lemire
          I found the following:

          http://support.alphasoftware.com/alp....RESTORE().htm

          perhaps the code has changed and it was restore back in the DOS days, without the '.' before it
          Ok, fine. So the code ought to be

          Code:
          if is_object(f) then 
                f.restore()
          else
                f=form.load(fname) 
          end if
          There can be only one.

          Comment


            #6
            Oran

            May I suggest you bypass the Autoexec, set the form as Startup in Database properties and place the following on the form's OnActivate event

            dim pObj as p

            pObj = topparent.this

            pObj.window_position("Center","Center")

            Code easily set up in action scripting - Window commands/window position

            My two pennyworth

            Colin

            Comment


              #7
              I just noticed that the code I posted is the exact code that has been working all along but I don't have () after restore. I will add that to the function and see if that is why it isn't working.

              Thanks, will let you know
              My two cents worth :)

              Oran

              Comment


                #8
                :( Didn't have any affect still have same error message.

                Any other ideas?


                TIA
                My two cents worth :)

                Oran

                Comment


                  #9
                  Sorry if it looks like I'm doing all the posting. Colin, the app I am working on has many, many forms. Most of them I hide when the user moves to another form but I want the main menu as a button on all forms. If it doesn't work in autoexec, it won't work as a button on a form in xp home with sp2.
                  My two cents worth :)

                  Oran

                  Comment


                    #10
                    Oran,

                    Did you try Stan's suggestion and change your code to the following:

                    Code:
                    if is_object(f) then 
                          f.restore()
                    else
                          f=form.load(fname) 
                    end if
                    Cheryl
                    #1 Designs By Pagecrazy
                    http://pagecrazy.com/

                    Comment


                      #11
                      Hi Cheryl,

                      I fixed the initial problem by adding the () after restore and then moving the f=formload(fname) up to the same line as the else.

                      Now it appears I have problems with the code following end if. Shaking my head over this, I don't understand why it works everywhere (without changes) except on my new laptop with xp home sp2. You even tested it on xp pro sp2 and found it worked.

                      It may be that home doesn't allow windows manipulation. I am hoping Selwyn or Richard may have an answer to this as the App I am developing MUST work on either.
                      My two cents worth :)

                      Oran

                      Comment


                        #12
                        Oran,

                        Why not post your new code and error and I can test again on my end.
                        Cheryl
                        #1 Designs By Pagecrazy
                        http://pagecrazy.com/

                        Comment


                          #13
                          Oran,
                          If you are getting an error,
                          Code:
                          command f=formload(fname)
                          object does not support requested inteface
                          then you have an error in your code, or some other code that you're not posting. The proper syntax is
                          Code:
                          f=form.load(fname)
                          which is what you appear to have in the autoexec code. Do you have other code somewhere that uses the wrong syntax?
                          Try putting a debug(1) at the top of your autoexec script and see where your program errors out.
                          I don't believe it's a Windows xp issue.
                          - Peter

                          Comment


                            #14
                            I am reposting the coding and the problem so others may see what is happening.

                            last 3 lines of autoexec first:

                            'controlpanel.hide() 'it is remarked at this point to work on problem
                            Centerform("Main Menu")

                            END

                            Coding for Centerform function

                            function Centerform as L(fname as C)
                            dim hscreen as n
                            dim wscreen as n
                            dim height as n
                            dim width as n
                            wscreen=ui_info(0)
                            hscreen=ui_info(1)
                            f=obj(fname)
                            if is_object(f) then restore
                            else f=form.load(fname)
                            end if
                            width=f.width
                            height=f.height
                            f.top=iif(height<hscreen,(hscreen-height)/2,0)
                            f.left=iif(width<wscreen,(wscreen-width)/2,0)
                            f.show()
                            f.activate()
                            centerform=.t.

                            end function

                            As originally stated, the function has worked since A5V4 on win98, winMe, winNT, and XP Pro SP1 without any problem. When I installed A5V7 to my new laptop running XP Home SP2, copied all the files to the laptop and then started the db, it is erroring out. Originally, it errored out when it hit the if f=form.load(fname) which I corrected by placing the code on the same line as the ELSE. Now it appears that the window sizing for the form is also a problem with XP Home.

                            Cheryl, in an earlier post, said that she ran the function on a computer with XP Pro SP2 and it worked correctly, so the problem really appears to be with XP Home and the SP may or may not be causing the problem.

                            Last edited by masteralone; 06-25-2006, 03:38 PM.
                            My two cents worth :)

                            Oran

                            Comment


                              #15
                              Oran,

                              Copy your "Main Menu" form and rename it to main_menu, then change your autoexec to: Centerform("Main_Menu")

                              If that does not work, change your function code to the following:
                              Code:
                              function Centerform as L(fname as C)
                               dim hscreen as n
                               dim wscreen as n
                               dim height as n
                               dim width as n
                              [COLOR=Red]dim newtop as n
                              dim newleft as n[/COLOR]
                               wscreen=ui_info(0)
                               hscreen=ui_info(1)
                               f=obj(fname)
                               [COLOR=Red]if is_object(f) then 
                                    f.restore()
                              else
                                    f=form.load(fname) 
                              end if[/COLOR] width=f.width
                               height=f.height
                              [COLOR=Red]newtop = (a5_height - height)/2
                              newleft = (a5_width - width)/2[/COLOR]
                               f.top=[COLOR=Red]newtop[/COLOR]
                               f.left=[COLOR=Red]newleft[/COLOR]
                               f.show()
                               f.activate()
                              [COLOR=Red]'[/COLOR]centerform=.t.  [COLOR=Red]'commented out, should not be needed[/COLOR]
                               end function
                              Cheryl
                              #1 Designs By Pagecrazy
                              http://pagecrazy.com/

                              Comment

                              Working...
                              X