• Programming a Universal Remote

    Posted on December 20th, 2008 Alan No comments

    RCARemote
    I have an inexpensive RCA universal remote we use with an old Magnavox TV.  It stopped working for some reason so I needed to try reprogramming it.  Searching on the Internet I found this advice:

    1. Remove the battery cover on the back of the remote and look for the model number ("RCR6124609P" for instance)
    2. Consult list of TV codes for your model via: search online

    Sure enough, on the back of the battery cover I found the code RCR311B. Searching online I found these instructions which worked for the remote:

    1. Manually turn on the TV
    2. Press and hold the TV button The illuminated ON•OFF key turns on and remains on.
    3. While holding the component key down, press and hold the ON•OFF key. The illuminated ON•OFF key turns off.
    4. After holding down both keys for three seconds, the illuminated ON•OFF key turns back on.
    5. Release both keys. The illuminated ON•OFF key remains on. TIP:
    Throughout the programming of each key, be sure to keep the remote
    pointed at the IR sensor of the component you are currently programming
    the remote to control.
    6. Press and release the ON•OFF key
    repeatedly until your component turns off. Each time you press the
    ON•OFF key, the illuminated ON•OFF key blinks, and the next
    code
    in the list is sent. This process continues until all of the codes in
    the Code Lists have been searched. If your component turns off, you
    have found the correct code.
    TIP: Because there are so many codes, you may have to press the ON•OFF key many times-possibly up to 200 times.
    7. Once you have found the correct code, you must save the new code by
    pressing and releasing the STOP key. The illuminated ON•OFF key turns
    off. You must press the STOP key to save the code or the correct code
    will not be stored!
    8. To confirm that the component key is
    programmed with the correct code for maximum functionality, test the
    component. Attempt to control a variety of the component's functions
    with the remote. If some of the features of your components do not
    work, try programming the remote with a different code in the list
    until you find the code that allows the remote to control the majority
    of your component's functions. Different codes can provide different
    levels of functionality.

  • Link problems with static library

    Posted on December 17th, 2008 Alan No comments

    An application is generating the following errors:

    1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _malloc already defined in libcmtd.lib(dbgmalloc.obj)
    1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _free already defined in libcmtd.lib(dbgfree.obj)
    1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: __endthreadex already defined in libcmtd.lib(threadex.obj)
    1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: __beginthreadex already defined in libcmtd.lib(threadex.obj)
    1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _fprintf already defined in libcmtd.lib(fprintf.obj)
    1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
    1>.\Debug/MyApp.exe : fatal error LNK1169: one or more multiply defined symbols found

    Q148652 explains the problem and ways to solve it.

    I found that I was linking a static library that was compiled with the C/C++…Code Generation…Runtime Library option set to Multi-threaded Debug DLL (/MDd).

    My application was using Multi-threaded Debug (/MTd).

    The problem went away once I created a version of the static library that was compiled using Multi-threaded Debug (/Mtd) to match the application.

  • Adding items to the Send To context menu

    Posted on December 16th, 2008 Alan No comments

    Right-drag the application icon or application shortcut icon from the start menu to your desktop and choose "Create shortcut here" from the menu that  displays when you release the right mouse button.  Rename the shortcut as appropriate.

    In Vista, paste the following into a Windows Explorer addressbar:

    %APPDATA%\Microsoft\Windows\SendTo

    Move the shortcut you recreated to the SendTo folder you just opened up.

  • How to enjoy Home Videos

    Posted on December 16th, 2008 Alan No comments

    I recently cut up and edited 3 1/2 hours of video shot in 2000-2001.  This includes Kristen’s birth and some of the cutest footage of the kids when they were young.

    My goal was to create small clips that can be viewed one at a time or in a playlist.  This has the best chance of friend and family being interested in watching.  So much of what ends up at home  is LONG footage where only a fraction is actually viewable outside of the immediate family.

    My second goal was for the final files to be viewable on Windows, Mac, and an  XBOX.  I would like to able to  browse and play video in our Living room  on our HDTV which has an XBOX hooked up to it.

    I”m struggling to find just the right settings/format/codec to use that will  result in good  quality and not take up tons  of space.  I had captured the original footage from  tape using a USB capture device and software which created a 7Gig MPEG-PS file.  For now, I am exporting to MPEG2 which appears to be the best balance of quality size and compatibilty.  However my XBOX360 can’t stream MPEG2 for some reason so I’ve also been exporting to MPEG4.  This streams on my XBOX but is highly compressed and not very good quality

    I use Sony Vegas to cut up and create individual clips.  I export to MainConcept MPEG-2.

    Jeff describes his setup to playback Blu-ray from his HD.

    Converting video for your video iPod

  • Debugging LoadModule

    Posted on December 16th, 2008 Alan No comments

    I just finished spending a couple days troubleshooting a problem with a Win32 non-mfc DLL failing a LoadLibrary().  Actually, the post build step for my DLL ran regsvr32 to register it and it started failing with the following message:

    Regsvr32Failure

    RegSvr32.exe calls the following Win32 functions in this order:

    • OleInitialize
    • LoadLibrary to load the DLL
    • DllRegisterServer or DllUnregisterServer
    • FreeLibrary
    • OleUninitialize

    A common reason for failure is that there are dependent DLL's missing.  Dependency Walker is good for checking this.  Unfortunately, this lead me down a rat hole when I saw that there was a complaint about MSVCR90D.dll.  It also led me to erroneously try various things to modify the manifest used and the Code Generation…Library Used settings. 

    I was unable to break in the DLLMain of the library so I assumed there was a problem in the way I was building  it.  I even installed the latest Vista SP1 and Visual  Studio SP1 to try to make the "build" problem go away.

    Ultimately,  what worked was for me to create a simple program that called LoadLibrary() on my dll.  I then set the  Debug…Exceptions options to catch all  exceptions.  As soon as the test program called  LoadLibrary() (on my debug build) it went right to the  line of  code that was causing an "Invalid access to  memory",  just like the message said!  I guess that's the danger of giving too much information in a message, users will  erroneously choose the wrong symptom.

    This worked because the problem  was in some  code that was called during the construction of a C++ object, which was instantiated prior to calling the main entry point of the DLL.

    Lesson learned:  When a module fails on startup,  check your global  objects' construction code, and don't forget to turn on catching all exceptions in the debugger!