Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

I want to use IClipboard Interface to share data between apps. but i failed. details are:

in app A:

{
char p[]={'h','e','l','l','o','_','t','e','s','t',0x0};
IClipboard *pClipboard = NULL;
ISHELL_CreateInstance(pMe->m_pIShell,AEECLSID_CLIPBOARD,(void**)&pClipboard);
ICLIPBOARD_SetData(pClipboard,"test_data",(void*)p,11);
DBGPRINTF("set_data is hello_test");
ICLIPBOARD_Release(pClipboard);

in app B:

{
char receive_data[20] = {0};
uint8 size = 20;
IClipboard *pClipboard = NULL;
ISHELL_CreateInstance(pme->a.m_pIShell,AEECLSID_CLIPBOARD,(void**)&pClipboard);
ICLIPBOARD_GetData(pClipboard,"test_data",(void*)receive_data,&size);
DBGPRINTF("get_data is %s",receive_data);
ICLIPBOARD_Release(pClipboard);

}

then i dbg them, app A run, and set the data, then A exit, then app B run, but i found that after ICLIPBOARD_GetData, the receive_data[] still is all zero. what is the matter?

who can help me

thanks a lot

Dear frn,
what u r doing here is that u r trying to use clipboard or data stored in one app to other app. what happening here is that u r using data out of it scope. when u change app that is from A to B ant try to use clipboard in B app its all finished.
Do one thing here store that clipboard data in a file and try to get that data in to ur B app.
hope u will got what u want...
Regard
Taran

Dear frn,
what u r doing here is that u r trying to use clipboard or data stored in one app to other app. what happening here is that u r using data out of it scope. when u change app that is from A to B ant try to use clipboard in B app its all finished.
Do one thing here store that clipboard data in a file and try to get that data in to ur B app.
hope u will got what u want...
Regard
Taran

just one erreor.
suspicious code:
uint8 size = 20;
should be:
int size = sizeof(receive_data);

just one erreor.
suspicious code:
uint8 size = 20;
should be:
int size = sizeof(receive_data);

You should do a enuminit and enumnext to get the format.
Check out this link
http://brewforums.qualcomm.com/showthread.php?t=6039

You should do a enuminit and enumnext to get the format.
Check out this link
http://brewforums.qualcomm.com/showthread.php?t=6039