Results 1 to 6 of 6

Thread: Set Timer API

  1. #1

    Thread Starter
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169

    Angry

    Hi,

    Is there a problem using the SetTimer API in an NT4.0 environment? I have some code that works fine on ME, but when try it on NT I get an memory error. Is there some "tweek" I can do to it to make it work?

    Thanks

    wolf

  2. #2
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    Post some code, SetTimer should work fine under NT4....
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  3. #3

    Thread Starter
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169

    Question

    Hi,

    Thanks for trying to help me. This exact code will run in the VB IDE under ME, but not under NT. I get a VB6.exe application error that says, The instruction at 0x0012fe99 referenced memory at 0x0fc00fdc. The memory could not be written. This doesn’t mean much to me; maybe you will have a better idea about its interpretation.

    Another note: It appears to blow up at the settimer line in the BackGround Sub.

    This is in a standard module in an active X exe

    Option Explicit

    Public Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
    Public Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
    Private lTimer As Long
    Private cCollator As Collator

    Public Sub CallBackClass(lpCollator As Collator)
    If lpCollator Is Nothing Then Exit Sub
    Set cCollator = lpCollator
    End Sub

    Public Sub BackGround()
    lTimer = SetTimer(0, 0, 100, AddressOf BackOperation)
    End Sub

    Public Sub BackOperation()
    Call KillTimer(0, lTimer)
    lTimer = 0
    cCollator.CommenceJob
    Set cCollator = Nothing
    End Sub


    Do you think limited access rights maybe effecting this?

    Thanks for your help!!!

  4. #4

    Thread Starter
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169

    Question y

    I got around the problem by using a timer, but the API just wouldn't work. Does anyone have any ideas as to why? I'm just lookin for a push in the right direction. My experience on NT is limited.

    Thanks
    That which does not kill us, only makes us stronger.

  5. #5
    Guest

    Settimer error

    HI

    Funnily I also get the same error message. But the memory addresses are different and I am using Win 2000

    This is the message I get.

    The instruction at "0x0fc00f1e" referenced memory at "0x00000010". The memory could not be "written".

  6. #6

    Thread Starter
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169

    Thumbs up

    Thanks for the responce. At least I know I'm not the only one with this problem. Unless, you were just helping me test the code I posted. Anyway, I got around the problem; I was just curious about whether the API worked on NT or not.

    Thanks for the help.
    That which does not kill us, only makes us stronger.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width