Keeping Hardware Alive

Discussion in 'Questions (Windows Mobile)' started by corwinckler, Dec 18, 2007.

  1. corwinckler

    corwinckler Member Licensed User

    Hi

    Erel you mentioned hardware.keepalive
    Is this a device setting or something that can be done in the program?

    Regards
    --Cor
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. ashrafidkaidek

    ashrafidkaidek Member Licensed User

    Keep alive error message

    i have tried to use the keepalive exactly as the example in the Basic4ppc documentation, but unfortunately i keep receive an error after 5 second from running the exe file in my PPC (LG Incite), i believe the error message show right after the hardware1.keepalive command handling, any help will be highly appreciated
     
  4. klaus

    klaus Expert Licensed User

    What error do you get ?

    Best regards.
     
  5. ashrafidkaidek

    ashrafidkaidek Member Licensed User

    KeepAlive error

    please see attached image for full error description
    Thank you very much in advance for your help
     
  6. specci48

    specci48 Well-Known Member Licensed User

    You are trying to run this program on your desktop!

    Excerpt from the help file of the hardware.dll:

    This library is only functional on the device.
    If you like to build the application on the desktop you can use the HardwareDesktop.dll file.
    It is a shallow copy of the Hardware library (without any functionality).


    So the error in your screenshot is not that one you'll get on your device.


    specci48
     
    Last edited: Mar 21, 2010
  7. Zenerdiode

    Zenerdiode Active Member Licensed User

    Ah, you're getting there. From your screen shot, I see you have the help file for the Hardware library open. See the line:

    Hardware1.New1

    This initialises the hardware object. I think you need to read the Libraries Tutorial.

    To get you started very quickly, in the IDE, use 'Tools>Components' and add the Hardware.dll to the Device side and the HardwareDesktop.dll to the Desktop side. Then create your object. To do this, its 'Tools>Add object' and you will see 'HardWare'. Call it 'HardWare1'

    Now in your AppStart sub, add a line Hardware1.New1 before your timer enabling and you should be up and running. But I must stress you should have a read of the tutorial, because the more you get into Basic4PPC - the more you will experience the need for libraries. :)
     
  8. ashrafidkaidek

    ashrafidkaidek Member Licensed User

    KeepAlive error

    Thank you everybody for your replies, unfortunately all what you have mentioned was already done:

    Dear specci48, I never tried to run the exe from my PC, I have ran the file from PPC (LG Incite) as I mentioned before, and the Hardware.dll included in the same directory as the exe

    Dear Zenerdiode, I’m not a new Basic4PPC user, actually I have already done what you have recommended, please see the new attached image

    Any new ideas folks … thank you in advance
     
  9. ashrafidkaidek

    ashrafidkaidek Member Licensed User

    KeepAlive error

    here is what i have tried so far, please take a look and let me know what do you think ...

    Thank you
     
  10. klaus

    klaus Expert Licensed User

    You haven't initialized the Harware1 object ?!
    You are missing the line in red!

    Code:
    [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]
    [SIZE=
    2][FONT=Courier New][COLOR=#0000ff]Sub [/COLOR][/FONT][/SIZE][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]App_Start[/SIZE][/FONT]
    [SIZE=
    2][FONT=Courier New] [COLOR=red]Hardware1.New1[/COLOR][/FONT][/SIZE]
    [SIZE=
    2][FONT=Courier New] Form1.show[/FONT][/SIZE]
    [SIZE=
    2][FONT=Courier New] Timer1.Enabled = [/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]True[/COLOR][/SIZE][/FONT]
    [/COLOR][/SIZE][/
    FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]End Sub[/COLOR][/SIZE][/FONT]
     
    [/COLOR][/SIZE][/
    FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Sub [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Timer1_Tick[/SIZE][/FONT]
    [SIZE=
    2][FONT=Courier New] Hardware1.KeepAlive [/FONT][/SIZE]
    [/SIZE][/
    FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]End Sub[/COLOR][/SIZE][/FONT]
    [/COLOR][/SIZE][/
    FONT][/COLOR][/SIZE][/FONT]
    Best regards.
     
  11. ashrafidkaidek

    ashrafidkaidek Member Licensed User

    KeepAlive error

    Thank you klaus, finally it's working ... :)
     
Loading...