<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic SetTimer and KillTimer?? in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311552#M39701</link>
    <description>in the below code i set a timer...but when i unload the timer keeps&lt;BR /&gt;
going...whats wrong??&lt;BR /&gt;
&lt;BR /&gt;
Jaime&lt;BR /&gt;
&lt;BR /&gt;
// PropTimer.cpp : Initialization functions&lt;BR /&gt;
#include "StdAfx.h"&lt;BR /&gt;
#include "StdArx.h"&lt;BR /&gt;
#include "resource.h"&lt;BR /&gt;
#include "aced.h"&lt;BR /&gt;
#include "adslib.h"&lt;BR /&gt;
#include "time.h"&lt;BR /&gt;
#include "windows.h"&lt;BR /&gt;
#include "acutads.h"&lt;BR /&gt;
#include "adsdef.h"&lt;BR /&gt;
#include "acedads.h"&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
class AsdkCommandReactor;&lt;BR /&gt;
HINSTANCE _hdllInstance =NULL ;&lt;BR /&gt;
AsdkCommandReactor* cmdr = NULL;&lt;BR /&gt;
&lt;BR /&gt;
// This command registers an ARX command.&lt;BR /&gt;
void AddCommand(const char* cmdGroup, const char* cmdInt, const char*&lt;BR /&gt;
cmdLoc,&lt;BR /&gt;
                                const int cmdFlags, const AcRxFunctionPtr&lt;BR /&gt;
cmdProc, const int idLocal = -1);&lt;BR /&gt;
&lt;BR /&gt;
// NOTE: DO NOT edit the following lines.&lt;BR /&gt;
//{{AFX_ARX_MSG&lt;BR /&gt;
void InitApplication();&lt;BR /&gt;
void UnloadApplication();&lt;BR /&gt;
//}}AFX_ARX_MSG&lt;BR /&gt;
&lt;BR /&gt;
// NOTE: DO NOT edit the following lines.&lt;BR /&gt;
//{{AFX_ARX_ADDIN_FUNCS&lt;BR /&gt;
//}}AFX_ARX_ADDIN_FUNCS&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
////////////////////////////////////////////////////////////////////////////&lt;BR /&gt;
/&lt;BR /&gt;
// DLL Entry Point&lt;BR /&gt;
extern "C"&lt;BR /&gt;
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID&lt;BR /&gt;
/*lpReserved*/)&lt;BR /&gt;
{&lt;BR /&gt;
        if (dwReason == DLL_PROCESS_ATTACH)&lt;BR /&gt;
        {&lt;BR /&gt;
        _hdllInstance = hInstance;&lt;BR /&gt;
        } else if (dwReason == DLL_PROCESS_DETACH) {&lt;BR /&gt;
&lt;BR /&gt;
        }&lt;BR /&gt;
        return TRUE;    // ok&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
class AsdkCommandReactor : public AcEditorReactor {&lt;BR /&gt;
&lt;BR /&gt;
  public:&lt;BR /&gt;
&lt;BR /&gt;
    virtual void commandWillStart(const char * cmdStr);&lt;BR /&gt;
 virtual void commandEnded(const char* cmdStr);&lt;BR /&gt;
};&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
void AsdkCommandReactor::commandWillStart(const char* cmdStr)&lt;BR /&gt;
{&lt;BR /&gt;
&lt;BR /&gt;
        if (strcmp(cmdStr,"PROPERTIES") == 0 )&lt;BR /&gt;
        {&lt;BR /&gt;
                acutPrintf("\nPROPERTIES IS OPEN\n");&lt;BR /&gt;
  }&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
VOID CALLBACK MyTimerProc(&lt;BR /&gt;
   HWND hWnd,      // handle of CWnd that called SetTimer&lt;BR /&gt;
   UINT nMsg,      // WM_TIMER&lt;BR /&gt;
   UINT nIDEvent,   // timer identification&lt;BR /&gt;
   DWORD dwTime    // system time&lt;BR /&gt;
)&lt;BR /&gt;
{&lt;BR /&gt;
&lt;BR /&gt;
 struct resbuf *Result = NULL,*cmdlist;&lt;BR /&gt;
 cmdlist = acutBuildList(RTSTR,"PROPERTIESCLOSE",RTNONE);&lt;BR /&gt;
 acedInvoke(cmdlist, &amp;amp;Result);&lt;BR /&gt;
 acutRelRb(cmdlist);&lt;BR /&gt;
 acutPrintf("Hello %s",nMsg);&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
UINT IDT;&lt;BR /&gt;
&lt;BR /&gt;
void AsdkCommandReactor::commandEnded(const char* cmdStr)&lt;BR /&gt;
{&lt;BR /&gt;
     if (strcmp(cmdStr,"PROPERTIES") == 0 )&lt;BR /&gt;
        {&lt;BR /&gt;
   acutPrintf("\nClose Properties Next");&lt;BR /&gt;
&lt;BR /&gt;
   UINT uResult;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
   uResult = SetTimer(NULL,IDT,5000,(TIMERPROC) MyTimerProc);&lt;BR /&gt;
   if (uResult == 0)&lt;BR /&gt;
   {&lt;BR /&gt;
    acutPrintf("\nNo Timer Is Available.");&lt;BR /&gt;
   }&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
     }&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
////////////////////////////////////////////////////////////////////////////&lt;BR /&gt;
/&lt;BR /&gt;
// ObjectARX EntryPoint&lt;BR /&gt;
extern "C" AcRx::AppRetCode&lt;BR /&gt;
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)&lt;BR /&gt;
{&lt;BR /&gt;
        switch (msg) {&lt;BR /&gt;
        case AcRx::kInitAppMsg:&lt;BR /&gt;
                // Comment out the following line if your&lt;BR /&gt;
                // application should be locked into memory&lt;BR /&gt;
                acrxDynamicLinker-&amp;gt;unlockApplication(pkt);&lt;BR /&gt;
                acrxDynamicLinker-&amp;gt;registerAppMDIAware(pkt);&lt;BR /&gt;
                InitApplication();&lt;BR /&gt;
                break;&lt;BR /&gt;
        case AcRx::kUnloadAppMsg:&lt;BR /&gt;
                UnloadApplication();&lt;BR /&gt;
                break;&lt;BR /&gt;
        }&lt;BR /&gt;
        return AcRx::kRetOK;&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
// Init this application. Register your&lt;BR /&gt;
// commands, reactors...&lt;BR /&gt;
void InitApplication()&lt;BR /&gt;
{&lt;BR /&gt;
&lt;BR /&gt;
        // NOTE: DO NOT edit the following lines.&lt;BR /&gt;
        //{{AFX_ARX_INIT&lt;BR /&gt;
        //}}AFX_ARX_INIT&lt;BR /&gt;
&lt;BR /&gt;
        // TODO: add your initialization functions&lt;BR /&gt;
        acutPrintf("\nProgram Loaded\n");&lt;BR /&gt;
        cmdr   = new AsdkCommandReactor();&lt;BR /&gt;
        acedEditor-&amp;gt;addReactor(cmdr);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
// Unload this application. Unregister all objects&lt;BR /&gt;
// registered in InitApplication.&lt;BR /&gt;
void UnloadApplication()&lt;BR /&gt;
{&lt;BR /&gt;
        // NOTE: DO NOT edit the following lines.&lt;BR /&gt;
        //{{AFX_ARX_EXIT&lt;BR /&gt;
        //}}AFX_ARX_EXIT&lt;BR /&gt;
&lt;BR /&gt;
        // TODO: clean up your application&lt;BR /&gt;
        acutPrintf("\nProgram Unloaded\n");&lt;BR /&gt;
        acedEditor-&amp;gt;removeReactor(cmdr);&lt;BR /&gt;
    delete cmdr;&lt;BR /&gt;
 KillTimer(NULL, IDT);&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
// This functions registers an ARX command.&lt;BR /&gt;
// It can be used to read the localized command name&lt;BR /&gt;
// from a string table stored in the resources.&lt;BR /&gt;
void AddCommand(const char* cmdGroup, const char* cmdInt, const char*&lt;BR /&gt;
cmdLoc,&lt;BR /&gt;
                                const int cmdFlags, const AcRxFunctionPtr&lt;BR /&gt;
cmdProc, const int idLocal)&lt;BR /&gt;
{&lt;BR /&gt;
        char cmdLocRes[65];&lt;BR /&gt;
&lt;BR /&gt;
        // If idLocal is not -1, it's treated as an ID for&lt;BR /&gt;
        // a string stored in the resources.&lt;BR /&gt;
        if (idLocal != -1) {&lt;BR /&gt;
&lt;BR /&gt;
                // Load strings from the string table and register the&lt;BR /&gt;
command.&lt;BR /&gt;
                ::LoadString(_hdllInstance, idLocal, cmdLocRes, 64);&lt;BR /&gt;
                acedRegCmds-&amp;gt;addCommand(cmdGroup, cmdInt, cmdLocRes,&lt;BR /&gt;
cmdFlags, cmdProc);&lt;BR /&gt;
&lt;BR /&gt;
        } else&lt;BR /&gt;
                // idLocal is -1, so the 'hard coded'&lt;BR /&gt;
                // localized function name is used.&lt;BR /&gt;
                acedRegCmds-&amp;gt;addCommand(cmdGroup, cmdInt, cmdLoc, cmdFlags,&lt;BR /&gt;
cmdProc);&lt;BR /&gt;
}</description>
    <pubDate>Tue, 20 Aug 2002 02:26:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2002-08-20T02:26:39Z</dc:date>
    <item>
      <title>SetTimer and KillTimer??</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311552#M39701</link>
      <description>in the below code i set a timer...but when i unload the timer keeps&lt;BR /&gt;
going...whats wrong??&lt;BR /&gt;
&lt;BR /&gt;
Jaime&lt;BR /&gt;
&lt;BR /&gt;
// PropTimer.cpp : Initialization functions&lt;BR /&gt;
#include "StdAfx.h"&lt;BR /&gt;
#include "StdArx.h"&lt;BR /&gt;
#include "resource.h"&lt;BR /&gt;
#include "aced.h"&lt;BR /&gt;
#include "adslib.h"&lt;BR /&gt;
#include "time.h"&lt;BR /&gt;
#include "windows.h"&lt;BR /&gt;
#include "acutads.h"&lt;BR /&gt;
#include "adsdef.h"&lt;BR /&gt;
#include "acedads.h"&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
class AsdkCommandReactor;&lt;BR /&gt;
HINSTANCE _hdllInstance =NULL ;&lt;BR /&gt;
AsdkCommandReactor* cmdr = NULL;&lt;BR /&gt;
&lt;BR /&gt;
// This command registers an ARX command.&lt;BR /&gt;
void AddCommand(const char* cmdGroup, const char* cmdInt, const char*&lt;BR /&gt;
cmdLoc,&lt;BR /&gt;
                                const int cmdFlags, const AcRxFunctionPtr&lt;BR /&gt;
cmdProc, const int idLocal = -1);&lt;BR /&gt;
&lt;BR /&gt;
// NOTE: DO NOT edit the following lines.&lt;BR /&gt;
//{{AFX_ARX_MSG&lt;BR /&gt;
void InitApplication();&lt;BR /&gt;
void UnloadApplication();&lt;BR /&gt;
//}}AFX_ARX_MSG&lt;BR /&gt;
&lt;BR /&gt;
// NOTE: DO NOT edit the following lines.&lt;BR /&gt;
//{{AFX_ARX_ADDIN_FUNCS&lt;BR /&gt;
//}}AFX_ARX_ADDIN_FUNCS&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
////////////////////////////////////////////////////////////////////////////&lt;BR /&gt;
/&lt;BR /&gt;
// DLL Entry Point&lt;BR /&gt;
extern "C"&lt;BR /&gt;
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID&lt;BR /&gt;
/*lpReserved*/)&lt;BR /&gt;
{&lt;BR /&gt;
        if (dwReason == DLL_PROCESS_ATTACH)&lt;BR /&gt;
        {&lt;BR /&gt;
        _hdllInstance = hInstance;&lt;BR /&gt;
        } else if (dwReason == DLL_PROCESS_DETACH) {&lt;BR /&gt;
&lt;BR /&gt;
        }&lt;BR /&gt;
        return TRUE;    // ok&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
class AsdkCommandReactor : public AcEditorReactor {&lt;BR /&gt;
&lt;BR /&gt;
  public:&lt;BR /&gt;
&lt;BR /&gt;
    virtual void commandWillStart(const char * cmdStr);&lt;BR /&gt;
 virtual void commandEnded(const char* cmdStr);&lt;BR /&gt;
};&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
void AsdkCommandReactor::commandWillStart(const char* cmdStr)&lt;BR /&gt;
{&lt;BR /&gt;
&lt;BR /&gt;
        if (strcmp(cmdStr,"PROPERTIES") == 0 )&lt;BR /&gt;
        {&lt;BR /&gt;
                acutPrintf("\nPROPERTIES IS OPEN\n");&lt;BR /&gt;
  }&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
VOID CALLBACK MyTimerProc(&lt;BR /&gt;
   HWND hWnd,      // handle of CWnd that called SetTimer&lt;BR /&gt;
   UINT nMsg,      // WM_TIMER&lt;BR /&gt;
   UINT nIDEvent,   // timer identification&lt;BR /&gt;
   DWORD dwTime    // system time&lt;BR /&gt;
)&lt;BR /&gt;
{&lt;BR /&gt;
&lt;BR /&gt;
 struct resbuf *Result = NULL,*cmdlist;&lt;BR /&gt;
 cmdlist = acutBuildList(RTSTR,"PROPERTIESCLOSE",RTNONE);&lt;BR /&gt;
 acedInvoke(cmdlist, &amp;amp;Result);&lt;BR /&gt;
 acutRelRb(cmdlist);&lt;BR /&gt;
 acutPrintf("Hello %s",nMsg);&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
UINT IDT;&lt;BR /&gt;
&lt;BR /&gt;
void AsdkCommandReactor::commandEnded(const char* cmdStr)&lt;BR /&gt;
{&lt;BR /&gt;
     if (strcmp(cmdStr,"PROPERTIES") == 0 )&lt;BR /&gt;
        {&lt;BR /&gt;
   acutPrintf("\nClose Properties Next");&lt;BR /&gt;
&lt;BR /&gt;
   UINT uResult;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
   uResult = SetTimer(NULL,IDT,5000,(TIMERPROC) MyTimerProc);&lt;BR /&gt;
   if (uResult == 0)&lt;BR /&gt;
   {&lt;BR /&gt;
    acutPrintf("\nNo Timer Is Available.");&lt;BR /&gt;
   }&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
     }&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
////////////////////////////////////////////////////////////////////////////&lt;BR /&gt;
/&lt;BR /&gt;
// ObjectARX EntryPoint&lt;BR /&gt;
extern "C" AcRx::AppRetCode&lt;BR /&gt;
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)&lt;BR /&gt;
{&lt;BR /&gt;
        switch (msg) {&lt;BR /&gt;
        case AcRx::kInitAppMsg:&lt;BR /&gt;
                // Comment out the following line if your&lt;BR /&gt;
                // application should be locked into memory&lt;BR /&gt;
                acrxDynamicLinker-&amp;gt;unlockApplication(pkt);&lt;BR /&gt;
                acrxDynamicLinker-&amp;gt;registerAppMDIAware(pkt);&lt;BR /&gt;
                InitApplication();&lt;BR /&gt;
                break;&lt;BR /&gt;
        case AcRx::kUnloadAppMsg:&lt;BR /&gt;
                UnloadApplication();&lt;BR /&gt;
                break;&lt;BR /&gt;
        }&lt;BR /&gt;
        return AcRx::kRetOK;&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
// Init this application. Register your&lt;BR /&gt;
// commands, reactors...&lt;BR /&gt;
void InitApplication()&lt;BR /&gt;
{&lt;BR /&gt;
&lt;BR /&gt;
        // NOTE: DO NOT edit the following lines.&lt;BR /&gt;
        //{{AFX_ARX_INIT&lt;BR /&gt;
        //}}AFX_ARX_INIT&lt;BR /&gt;
&lt;BR /&gt;
        // TODO: add your initialization functions&lt;BR /&gt;
        acutPrintf("\nProgram Loaded\n");&lt;BR /&gt;
        cmdr   = new AsdkCommandReactor();&lt;BR /&gt;
        acedEditor-&amp;gt;addReactor(cmdr);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
// Unload this application. Unregister all objects&lt;BR /&gt;
// registered in InitApplication.&lt;BR /&gt;
void UnloadApplication()&lt;BR /&gt;
{&lt;BR /&gt;
        // NOTE: DO NOT edit the following lines.&lt;BR /&gt;
        //{{AFX_ARX_EXIT&lt;BR /&gt;
        //}}AFX_ARX_EXIT&lt;BR /&gt;
&lt;BR /&gt;
        // TODO: clean up your application&lt;BR /&gt;
        acutPrintf("\nProgram Unloaded\n");&lt;BR /&gt;
        acedEditor-&amp;gt;removeReactor(cmdr);&lt;BR /&gt;
    delete cmdr;&lt;BR /&gt;
 KillTimer(NULL, IDT);&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
// This functions registers an ARX command.&lt;BR /&gt;
// It can be used to read the localized command name&lt;BR /&gt;
// from a string table stored in the resources.&lt;BR /&gt;
void AddCommand(const char* cmdGroup, const char* cmdInt, const char*&lt;BR /&gt;
cmdLoc,&lt;BR /&gt;
                                const int cmdFlags, const AcRxFunctionPtr&lt;BR /&gt;
cmdProc, const int idLocal)&lt;BR /&gt;
{&lt;BR /&gt;
        char cmdLocRes[65];&lt;BR /&gt;
&lt;BR /&gt;
        // If idLocal is not -1, it's treated as an ID for&lt;BR /&gt;
        // a string stored in the resources.&lt;BR /&gt;
        if (idLocal != -1) {&lt;BR /&gt;
&lt;BR /&gt;
                // Load strings from the string table and register the&lt;BR /&gt;
command.&lt;BR /&gt;
                ::LoadString(_hdllInstance, idLocal, cmdLocRes, 64);&lt;BR /&gt;
                acedRegCmds-&amp;gt;addCommand(cmdGroup, cmdInt, cmdLocRes,&lt;BR /&gt;
cmdFlags, cmdProc);&lt;BR /&gt;
&lt;BR /&gt;
        } else&lt;BR /&gt;
                // idLocal is -1, so the 'hard coded'&lt;BR /&gt;
                // localized function name is used.&lt;BR /&gt;
                acedRegCmds-&amp;gt;addCommand(cmdGroup, cmdInt, cmdLoc, cmdFlags,&lt;BR /&gt;
cmdProc);&lt;BR /&gt;
}</description>
      <pubDate>Tue, 20 Aug 2002 02:26:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311552#M39701</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-20T02:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: SetTimer and KillTimer??</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311553#M39702</link>
      <description>"Jaime" &lt;JFILSON&gt; wrote in message&lt;BR /&gt;
news:22C9763E1A36F7FBAE7B1649A6974FC2@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; in the below code i set a timer...but when i unload the timer keeps&lt;BR /&gt;
&amp;gt; going...whats wrong??&lt;BR /&gt;
&lt;BR /&gt;
You'll have to excuse my not answering your question,&lt;BR /&gt;
but I'm at a loss to understand what your code is&lt;BR /&gt;
attmpting to do.&lt;BR /&gt;
&lt;BR /&gt;
For one thing, you're trying to execute a command&lt;BR /&gt;
(PROPERTIESCLOSE) using acedInvoke(), which doesn't&lt;BR /&gt;
execute commands.&lt;BR /&gt;
&lt;BR /&gt;
acedCommand() executes commands, but you can't use&lt;BR /&gt;
it from a timer callback.&lt;BR /&gt;
&lt;BR /&gt;
I really don't know think I can go further without&lt;BR /&gt;
knowing what it is your code is attempting to do.&lt;/JFILSON&gt;</description>
      <pubDate>Tue, 20 Aug 2002 03:19:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311553#M39702</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-20T03:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: SetTimer and KillTimer??</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311554#M39703</link>
      <description>Ok try this, see SetTimer() help&lt;BR /&gt;
&lt;BR /&gt;
You write :&lt;BR /&gt;
&amp;gt;UINT IDT;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;void AsdkCommandReactor::commandEnded(const char* cmdStr)&lt;BR /&gt;
&amp;gt;{&lt;BR /&gt;
&amp;gt;     if (strcmp(cmdStr,"PROPERTIES") == 0 )&lt;BR /&gt;
&amp;gt;        {&lt;BR /&gt;
&amp;gt;   acutPrintf("\nClose Properties Next");&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;   UINT uResult;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;   uResult = SetTimer(NULL,IDT,5000,(TIMERPROC) MyTimerProc);&lt;BR /&gt;
&amp;gt;   if (uResult == 0)&lt;BR /&gt;
&amp;gt;   {&lt;BR /&gt;
&amp;gt;    acutPrintf("\nNo Timer Is Available.");&lt;BR /&gt;
&amp;gt;   }&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;     }&lt;BR /&gt;
&amp;gt;}&lt;BR /&gt;
&lt;BR /&gt;
Correction :&lt;BR /&gt;
void AsdkCommandReactor::commandEnded(const char* cmdStr)&lt;BR /&gt;
{&lt;BR /&gt;
     if (strcmp(cmdStr,"PROPERTIES") == 0 )&lt;BR /&gt;
        {&lt;BR /&gt;
   acutPrintf("\nClose Properties Next");&lt;BR /&gt;
&lt;BR /&gt;
   IDT = SetTimer(NULL,0,5000,(TIMERPROC) MyTimerProc);&lt;BR /&gt;
   if (IDT == 0)&lt;BR /&gt;
   {&lt;BR /&gt;
    acutPrintf("\nNo Timer Is Available.");&lt;BR /&gt;
   }&lt;BR /&gt;
&lt;BR /&gt;
     }&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
Here is SetTimer Doc (from MSDN) :&lt;BR /&gt;
&lt;BR /&gt;
UINT SetTimer(&lt;BR /&gt;
  HWND hWnd,              // handle of window for timer messages&lt;BR /&gt;
  UINT nIDEvent,          // timer identifier&lt;BR /&gt;
  UINT uElapse,           // time-out value&lt;BR /&gt;
  TIMERPROC lpTimerFunc   // address of timer procedure&lt;BR /&gt;
);&lt;BR /&gt;
&lt;BR /&gt;
-----------------------------HERE IS UR MISTAKE -------------------------&lt;BR /&gt;
nIDEvent&lt;BR /&gt;
Specifies a nonzero timer identifier. If the hWnd parameter is NULL, this&lt;BR /&gt;
parameter is ignored.&lt;BR /&gt;
&lt;BR /&gt;
-----------------------------HERE IS WHAT U HAVE TO DO-------------&lt;BR /&gt;
Return Values&lt;BR /&gt;
&lt;BR /&gt;
If the function succeeds, the return value is an integer identifying the new&lt;BR /&gt;
timer. An application can pass this value, or the string identifier, if it&lt;BR /&gt;
exists, to the KillTimer function to destroy the timer.&lt;BR /&gt;
&lt;BR /&gt;
If the function fails to create a timer, the return value is zero. To get&lt;BR /&gt;
extended error information, call GetLastError.</description>
      <pubDate>Tue, 20 Aug 2002 03:49:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311554#M39703</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-20T03:49:39Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311555#M39704</link>
      <description>well at the moment all its tring to do is kill the timer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 20 Aug 2002 04:13:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311555#M39704</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-20T04:13:37Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311556#M39705</link>
      <description>sorry but youll have to use english to explain this.i dont understand why&lt;BR /&gt;
your saying my "settimer" is wrong when that part of it works&lt;BR /&gt;
&lt;BR /&gt;
and ive stared blankly at the msdn help files for serveal hours. (which is&lt;BR /&gt;
where i got the examples im working from)</description>
      <pubDate>Tue, 20 Aug 2002 04:17:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311556#M39705</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-20T04:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: SetTimer and KillTimer??</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311557#M39706</link>
      <description>thanks for the help..but i think i figured it out (at least it works anyway)&lt;BR /&gt;
&lt;BR /&gt;
Jaime</description>
      <pubDate>Tue, 20 Aug 2002 04:26:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311557#M39706</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-20T04:26:18Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311558#M39707</link>
      <description>When "hwnd" parameter in SetTimer is NULL, you have to kill the timer by&lt;BR /&gt;
returned ID.&lt;BR /&gt;
E.g.&lt;BR /&gt;
&lt;BR /&gt;
m_uTimerId = SetTimer(NULL, NULL, 5000, ,(TIMERPROC) MyTimerProc);&lt;BR /&gt;
...&lt;BR /&gt;
...&lt;BR /&gt;
and in UnloadApplication function:&lt;BR /&gt;
&lt;BR /&gt;
KillTimer(NULL, m_uTimerId);&lt;BR /&gt;
&lt;BR /&gt;
MSDN Library says:&lt;BR /&gt;
" If the hWnd parameter is NULL, second parameter (nIDEvent) is ignored."&lt;BR /&gt;
&lt;BR /&gt;
You should declare m_uTimerId as global variable or (better) as data member&lt;BR /&gt;
of class,&lt;BR /&gt;
  in member of which you call SetTimer.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
   Vladimir Kolesnikov.&lt;BR /&gt;
&lt;BR /&gt;
"Jaime" &lt;JFILSON&gt; wrote in message&lt;BR /&gt;
news:f105210.4@WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; thanks for the help..but i think i figured it out (at least it works&lt;BR /&gt;
anyway)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Jaime&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/JFILSON&gt;</description>
      <pubDate>Wed, 21 Aug 2002 23:13:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311558#M39707</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-21T23:13:30Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311559#M39708</link>
      <description>hi,&lt;BR /&gt;
&lt;BR /&gt;
your settimer funktion only works, if there is a&lt;BR /&gt;
ontimer (...) (mfc-code)&lt;BR /&gt;
funktion in your code, which do something if your&lt;BR /&gt;
timermessage&lt;BR /&gt;
is fired.&lt;BR /&gt;
&lt;BR /&gt;
regards&lt;BR /&gt;
chris</description>
      <pubDate>Wed, 21 Aug 2002 23:52:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311559#M39708</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-21T23:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: SetTimer and KillTimer??</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311560#M39709</link>
      <description>hi,&lt;BR /&gt;
&lt;BR /&gt;
here is a litle peace of code, may it help's&lt;BR /&gt;
&lt;BR /&gt;
chris&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
////////////////////////////////////////////////////////////////////////////&lt;BR /&gt;
////&lt;BR /&gt;
&lt;BR /&gt;
void SomeFunktion()&lt;BR /&gt;
{&lt;BR /&gt;
  m_nTimer = SetTimer(1, 100, NULL); // 1/10 sec&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
void OnTimer(UINT nIDEvent)&lt;BR /&gt;
 {&lt;BR /&gt;
 TRACE0( " OnTimer() entered\n" );&lt;BR /&gt;
&lt;BR /&gt;
  if (nIDEvent == 1)//&lt;BR /&gt;
   {&lt;BR /&gt;
   Do something here = 0;&lt;BR /&gt;
   }&lt;BR /&gt;
&lt;BR /&gt;
  if (nIDEvent == 2)//&lt;BR /&gt;
   {&lt;BR /&gt;
   Do something here = 1;&lt;BR /&gt;
   }&lt;BR /&gt;
&lt;BR /&gt;
  if (nIDEvent == 3)&lt;BR /&gt;
   {&lt;BR /&gt;
   Do something here = 5;&lt;BR /&gt;
   }&lt;BR /&gt;
}</description>
      <pubDate>Thu, 22 Aug 2002 11:16:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/settimer-and-killtimer/m-p/311560#M39709</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-22T11:16:58Z</dc:date>
    </item>
  </channel>
</rss>

