Visual C++, existing app, no documentation, targeting a ppc CE based device RRS feed

  • Question

  • I recently started working for a company and the prior tech guy left no documentation.  I have not had time to get all the pieces together for this, but now am in a corner with an ASAP project and need to work with a previously little researched Visual C++ app targeted for a 66MHz Motorola 823 power PC for CE.  I not highly versed in C++ nor the whole CE development scenario. However, the required changes are minimal so I should be able to do those.

    My first goal was to recompile the code for the app, to ensure the behaviour is the same as what is in production. I think I have found most of the pieces for an app, but something appears to be missing. I was attempting to use Visual Tools Visual C++ 3.0, along with the installed SDK from the manufacturer. It compiles, but some functions won't run which are called on UP/DOWN arrow keys. If I were to guess, I would guess that keystrokes (UpArrow and DownArrow for certain) are not being intercepted and directed properly for special functions which should be running.  Rather than performing their "normal" function within the app, the return the & and ( characters to the screen, which I suspect may be default behavior?

    I suspect there is a library perhaps missing? I did notice the former developer had a library link for aygshell.lib however I cannot find that file, which I am guessing should be processor specific? I have not receved a response as of yet from the device manufacturer either.  I can compile the application, but receive the following warnings. Are these related to any standard libraries which should be included?

    C4013 ‘KernelIoControl’ undefined. Assuming extern returning int.

    ...SendCom.c(25) : warning C4013: 'KernelIoControl' undefined; assuming extern returning int

     i also for some reason had to add the following in a .h file to get the program to even compile:

    #ifdef __cplusplus  // added dgw: per
       #ifndef _PRIV_KFUNCS_H__
     extern "C"
    #endif  // added dgw: per

    Any assistance (hopefully very soon!) would be greatly appreciated!

    Thursday, February 17, 2011 4:31 PM

All replies

  • What OS version is on the device?  Aygshell is not processor specific, although it is processor architecture specific.  It is a library that came originally as part of the PocketPC/Windows Mobile version of the operating system, then portions ported to regular CE (at CE5, I think) for better application portability between WM and CE.  If you are building applications, it should be part of the SDK if it is supported on your particular device. 

    The UP/DOWN arrow key behavior is going to be dependent on the keyboard driver on your device.  The keyboard driver will return a particular key code for that key, and it is up to your application to handle that as needed.  It might return the keycode for an Up/Down arrow, but it might return something else entirely.  You'll need to do a little more investigation to determine how this application handles keys, then intercept the key code returned by these keys to do whatever your application is expecting.

    KernelIoControl is a function that is available in coredll, you just don't have the header file that defines it.  It is defined in pkfuncs.h as

    BOOL KernelIoControl(DWORD dwIoControlCode, LPVOID lpInBuf, DWORD nInBufSize, LPVOID lpOutBuf, DWORD nOutBufSize, LPDWORD lpBytesReturned);

    The extern "C" statement is typical when you've mixed C and C++ files.  Routines in C++ files incorporate name mangling algorithms that aren't understood by C compiler, so they can't be linked directly.  The extern "C" statement tells the compiler to export them using the normal "C" language rules.

    Dean Ramsier eMVP BSQUARE Corporation
    Monday, February 21, 2011 2:29 PM