none
How to use clipboard in WINCE600 device driver. RRS feed

  • Question

  • Hi all,

    I have one question.

    I used clipboard in stream driver of WINCE500.

    Clipboard was working well.

    I change my platform to WINCE600 from WINCE500, but driver code are almost not changed.

    At this time, clipboard doesn't work.

    I used same code in WINCE500 and WINCE600.

    Code is like below.

    {
    	TCHAR szTemp[MAX_PATH] = _T("1234567890");
    	TCHAR *str;
    	if(OpenClipboard(NULL))
    	{
    		EmptyClipboard();
    		clipbuffer = GlobalAlloc(GHND, MAX_PATH);
    		str = (TCHAR *) GlobalLock(clipbuffer);
    		wcscpy(str, szTemp);
    		GlobalUnlock(clipbuffer);
    		if(SetClipboardData(CF_UNICODETEXT, clipbuffer))			
    			RETAILMSG(DBGZ, (_T("[BCD0]	SetClipboardData(SUCCESS)\r\n")));
    		else
    			RETAILMSG(DBGZ, (_T("[BCD0]	SetClipboardData(FAIL : %#X)\r\n"), GetLastError()));
    		CloseClipboard();
    		
    		keybd_event(VK_CONTROL, MapVirtualKey(VK_CONTROL, 0), KEYEVENTF_SILENT, 0);
    		keybd_event('V', MapVirtualKey('V', 0), KEYEVENTF_SILENT, 0);
    		keybd_event(VK_CONTROL, MapVirtualKey(VK_CONTROL, 0), KEYEVENTF_KEYUP, 0);
    	}
    }

    When I called SetClipboardData function, the function return FAIL(GetLastError is ERROR_OUTOFMEMORY).

    I guess WINCE600 have user and kernel mode so it's cause of error.

    Of course, same code work well in application level.(I tested via VS2005).

    I don't know what are difference of WINCE500 and WINCE600.

    I have no idia of how to use clipboard in device driver of WINCE600.

    Thanks.

    Regards / Jin.

    Monday, February 20, 2012 7:44 AM

All replies

  • Are you running the WINCE600 driver in kernel mode or in user mode? 


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com

    Monday, February 20, 2012 1:53 PM
  • Sorry, My reply too late.

    Driver running on kernel mode.

    Tuesday, February 21, 2012 1:06 AM
  • Try running it in user mode if it's possible modifying the .bib and .reg files


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com

    Tuesday, February 21, 2012 7:04 AM
  • I changed .reg and .bib for user mode, but driver did not activated.

    .reg file changed like below.

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\DCD1]

    "Prefix"="DCD"

    "Dll"="$(_TGTPLAT_PFX)_dcd1.dll"

    "Index"=dword:1 "Order"=dword:25

    ;;"Flags"=dword:00010000

    "Flags"=dword:00000010 ;change flags

    "UserProcGroup"=dword:00000003 ; allocate user group

    .bib file changed like below.

    $(_TGTPLAT_PFX)_dcd1.dll $(_FLATRELEASEDIR)\$(_TGTPLAT_PFX)_dcd1.dll $(OEMDRIVER) SHQ

    If i have some misstake, please let mo know.

    Thank for your advice.



    • Edited by Jin.Lee Tuesday, February 21, 2012 9:31 AM
    Tuesday, February 21, 2012 9:29 AM
  • (_TGTPLAT_PFX)_dcd1.dll $(_FLATRELEASEDIR)\$(_TGTPLAT_PFX)_dcd1.dll $(OEMDRIVER) SHQ

    is equivalent to

    k.$(_TGTPLAT_PFX)_dcd1.dll $(_FLATRELEASEDIR)\$(_TGTPLAT_PFX)_dcd1.dll $(OEMDRIVER) SHK

    $(_TGTPLAT_PFX)_dcd1.dll $(_FLATRELEASEDIR)\$(_TGTPLAT_PFX)_dcd1.dll $(OEMDRIVER) SH

    (see http://msdn.microsoft.com/en-US/library/ee478797(v=winembedded.60).aspx)

    Try only

    $(_TGTPLAT_PFX)_dcd1.dll $(_FLATRELEASEDIR)\$(_TGTPLAT_PFX)_dcd1.dll $(OEMDRIVER) SH


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com

    Tuesday, February 21, 2012 10:03 AM
  • Dear Luca.

    Thank for your kindly advice.

    The driver running on user mode at then clipboard working well.

    Thank you.

    Tuesday, February 21, 2012 12:55 PM