Thread: ATL COM Proxy DLL difficulties (windows ce 5.0)

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    6

    ATL COM Proxy DLL difficulties (windows ce 5.0)

    Hi All,

    I have managed to build an ATL Proxy DLL for my out of process com server. The server its self runs fine fine on the Window CE enviroment. Also the SAME server runs prefectly fine on windows, but when i ported the project and built the proxy DLL for Windows CE the proxy dll wont register, heres the basic outline of my proxy DLL.

    #ifndef REGISTER_PROXY_DLL
    #define REGISTER_PROXY_DLL
    #endif

    #include "Windows.h"

    //These files are generate by my ATL server project.
    #include "..\Server\MainServer_p.c"
    #include "..\Server\dlldata.c"
    #include "..\Server\MainServer.h"
    #include "..\Server\MainServer_i.c"

    Now i have the follow preprocessor options to get it to build ok.

    $(ARCHFAM);
    $(_ARCHFAM_);
    PROXY_DELEGATION;
    _WIN32_DCOM;
    WINCE;
    _WIN32_WCE=$(CEVER)

    It builds fine but fails to load using Load Library, or regsrvce on the device, with error 45a.

    If i dont have REGISTER_PROXY_DLL defined and i define my own DllRegisterServer etc, the DLL will load and register but obviously my CoCreateInstance calls fail with E_INTERFACE.

    Im thinking its some kind of dependancy missing on the device, but using dependancy walker i dont see anything thats no available.

    Heres the output when i try to register it.....

    Load module: regsvrce.exe
    Load module: aygshell.dll
    Load module: commctrl.dll
    Load module: lpcrt.dll
    Load module: rpcrt4.dll
    Load module: ole32.dll
    Load module: coredll.dll
    Load module: oleaut32.dll
    Load module: stub.dll
    Data Abort: Thread=87cae400 Proc=81cfe440 'regsvrce.exe'
    AKY=00000101 PC=01ba12d4(stub.dll+0x000012d4) RA=01ba2140(stub.dll+0x00002140) BVA=13ba36d0 FSR=0000000f
    Unload module: oleaut32.dll
    Unload module: stub.dll

    Any help would be greatly appreciated.....ive been on this for 2 days now.

    Cheers,
    Simon
    Last edited by shamelessnet; 05-25-2010 at 03:58 PM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Windows CE: Finding the cause of a Data Abort
    One of many on how to deal with data abort.

    Is stub.dll your code?
    I'd say it has a bug and is trying to access memory (that's a data abort) which doesn't exist.

    > Also the SAME server runs prefectly fine on windows
    Well it was a minimum requirement, but just because it worked once doesn't immediately guarantee success everywhere.
    When you find the bug on the CE environment, look to see if you were just being "lucky" on windows proper (the same bug there, but it didn't crash).
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    6
    Thanks for your reply. Yep i have the code for the Stub dll, however the stub code, i.e DLLDATA.c etc etc, is automatically generated by the Server project. I simply createa DLL project and include these files that are auto generated (by MIDL) and build them into a dll.

    Its definately somewhere in the registration functions , DllRegisterServer etc, that the is automatically provided by REGISTER_PROXY_DLL. Issue is , i dont have the code for these as they are provided by a core rpc dll.


    Also my stub dll project, doesnt seem to be generating *.map files as mentioned in those articles..... (stratch that, ive got this generating now!)

    Address Publics by Value Rva+Base Lib:Object

    0000:00000000 ___safe_se_handler_count 00000000 <absolute>
    0000:00000000 ___safe_se_handler_table 00000000 <absolute>
    0001:00000000 _ATLXP_IID_Lookup 10001000 f main.obj
    0001:00000100 GetProxyDllInfo 10001100 f main.obj - So based on those articles this would make it this function?
    0001:00000178 DllGetClassObject 10001178 f main.obj
    0001:00000210 DllCanUnloadNow 10001210 f main.obj
    0001:0000023c CStdStubBuffer_Release 1000123c f main.obj
    0001:00000274 CStdStubBuffer2_Release 10001274 f main.obj
    0001:000002ac _purecall 100012ac f main.obj
    0001:000002b0 DllMain 100012b0 f main.obj
    0001:000002f8 DllRegisterServer 100012f8 f main.obj
    0001:00000378 DllUnregisterServer 10001378 f main.obj

    Now, WINCECOD=1 doesnt seem to give me a COD file.


    The first thing that springs to mind, is that on WinCE with the stub, i had to define PROXY_DELEGATION, if not i get linking errors.......but i wasnt sure WHY i had to do this, so maybe its related , without it.......

    Error 1 error LNK2001: unresolved external symbol CStdStubBuffer2_Release main.obj


    Si
    Last edited by shamelessnet; 05-26-2010 at 03:53 AM.

  4. #4
    Registered User
    Join Date
    May 2010
    Posts
    6
    ? bump, still an issue

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    So did you discover anything new in the past couple of months?

    You know, snippets of information you managed to figure out, which might just give someone here that "aha!" recognition of the problem and it's solution.

    Otherwise, just saying "bump" is a complete waste of time and effort.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    May 2010
    Posts
    6
    A fair and just point!

    Well unfortunately i had to bench this for a month or 2, and im now trying to fix the code before we have to cut our losses on windows ce 5 and do it differently.

    At the moment, an in process com server works just fine, including registration etc, but the Stub still fails to register for an out of process COM server. As both methods read/write to the registry when registering, this rules out a permission problem at least.

    Dependancy walker shows nothing of interest for the Stub dll, so im at a loss how to track down the reason for its failure. I have try the same thing in many simple projects and get the same result......

    Its looking likely ill have to bench this and do it a different way not using COM (or atleast not an out of process one)....on windows ce.

  7. #7
    Registered User valaris's Avatar
    Join Date
    Jun 2008
    Location
    RING 0
    Posts
    507
    Was your OS built with DCOM libraries? You will probably need this or at least windows rpc for COM to be able to marshal.

    Also from a quick search this seams to be the consensus on ce out of proc servers. It looks like DCOM is necessary.

  8. #8
    Registered User
    Join Date
    May 2010
    Posts
    6
    Quote Originally Posted by valaris View Post
    Was your OS built with DCOM libraries? You will probably need this or at least windows rpc for COM to be able to marshal.

    Also from a quick search this seams to be the consensus on ce out of proc servers. It looks like DCOM is necessary.
    Hi thanks for your reply,

    Yep ive got the DCOM libs etc, i had to get the supplier to add these in as i concluded the same as you above. (However im not sure if i have both COM and DCOM in the platform now....shall have to ask).

  9. #9
    Registered User
    Join Date
    May 2010
    Posts
    6
    Response from supplier of Kernel,

    "You do not have the minimal COM (No OLE support), however I would think that the full COM support should include anything there, although I could be wrong!! with platform builder you never really know."

    Any ideas? is this the case?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. FlashWindowEx not declared?
    By Aidman in forum Windows Programming
    Replies: 3
    Last Post: 05-17-2003, 02:58 AM
  2. .lib vs .h vs .dll
    By Shadow12345 in forum C++ Programming
    Replies: 13
    Last Post: 01-01-2003, 05:29 AM
  3. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 05:31 PM
  4. Windows CE
    By civix in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 08-04-2002, 01:21 AM
  5. Windows CE
    By Shiro in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 03-11-2002, 01:14 PM