none
How to load second display driver in windows Mobile 6.1 RRS feed

  • Question

  • I wrote a virtual display driver in Windows Mobile 6.1, which uses main memory as display memory. (As I understand, Windows Mobile 6.1 is based on Windows CE  5.0).
    I am trying to load the display driver as second display driver.

    According to Platform Builder for Microsoft Windows CE 5.0 Help,
    "A dedicated process can load secondary display driver by calling CreateDC with 'MyDDI.dll' as the first parameter."

    I am using the following code, but I always get error code: ERROR_INVALID_PARAMETER (87),  could you please help ? I need your help urgently, your kind help will be really appreciated.


    DEVMODE initData;
    DEVMODE * lpInitData = &initData;

    ZeroMemory(lpInitData, sizeof(initData));
    initData.dmSize = sizeof(DEVMODE);
    initData.dmFields = DM_ORIENTATION | DM_COLOR | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYORIENTATION;
    initData.dmOrientation = DMORIENT_LANDSCAPE;
    initData.dmColor = DMCOLOR_COLOR;
    initData.dmBitsPerPel = 16;
    initData.dmPelsWidth  = 1024;
    initData.dmPelsHeight = 1024;
    initData.dmDisplayOrientation = DMDO_0;

    //VDDS.dll is the display driver dll, I already registered it.

    hdc = CreateDC(TEXT("VDDS.dll"),NULL,NULL,lpInitData);

     




    Monday, April 18, 2011 10:09 AM

Answers

All replies

  • Did you try with the full path to your DLL? Does the call reach your DLL
    or does it fail before any code is executed inside your DLL?
     

    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: http://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.
    Tuesday, April 19, 2011 1:51 AM
    Moderator
  • Thanks for the kind reply.

    Did you try with the full path to your DLL?

    I tried the full path like the following, still got ERROR_INVALID_PARAMETER(87, the parameter is incorrect.).

    hdc = CreateDC(TEXT("\\Windows\\VDDS.dll"),NULL,NULL,lpInitData);

    I put a wrong path as the following for test purpose, I got a different error code ERROR_MOD_NOT_FOUND ( 126, the specified module could not be found. ).  So I guess the path should be right.

    hdc = CreateDC(TEXT("\\Windows1\\VDDS.dll"),NULL,NULL,lpInitData);

    Does the call reach your DLL or does it fail before any code is executed inside your DLL?

    I think the call didn't reach my dll. Because if DisplayInit(I think it is the first function called by GWES in my dll) is called, it should write some debug info to registration. The code is as following.

    BOOL APIENTRY
    DisplayInit(LPCTSTR pszInstance, DWORD dwNumMonitors)
    {
     BOOL fOk = FALSE;

     setDebugStep(101);    //write 101 to registration

     if(pszInstance != NULL) {
            _tcsncpy(gszBaseInstance, pszInstance, dim(gszBaseInstance));
      }

     fOk = TRUE;
     return fOk;
    }

     Your kind help will be really appreciated as always.

    Tuesday, April 19, 2011 3:35 AM
  • Can someone help take at this?   Thanks in advance.

     

    The link about the secondary display driver is here:

    http://msdn.microsoft.com/en-us/library/ms893979.aspx

    Thursday, April 21, 2011 10:57 AM
  • hdc = CreateDC(TEXT("\\Windows\\VDDS.dll"),NULL,NULL,lpInitData);

     

    Is everything valid with  lpInitData ?

    Have you tried this

    hdc = CreateDC(TEXT("VDDS.dll"),NULL,NULL,NULL);

     

    ---Misbah


    Senior Design Engineer T.E.S Electronic Solutions (Bangalore-India) www.tesbv.com email-misbah.khan@tesbv.com
    Thursday, April 21, 2011 11:42 AM
  • Thanks to Michel and Misbah.

    With your kind help and hit, I could find the problem. The problem is in setDebugStep which didn't write debug info to registry. Although, still have other bugs, but I could see CreateDC are trying to load my DLL.

    Thanks again.

    • Marked as answer by Wanghy Monday, April 25, 2011 7:32 AM
    Monday, April 25, 2011 7:32 AM