Click here to Skip to main content
15,946,956 members
Home / Discussions / COM
   

COM

 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
Stephen Hewitt18-May-10 0:37
Stephen Hewitt18-May-10 0:37 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
K ARUN KUMAR18-May-10 0:54
K ARUN KUMAR18-May-10 0:54 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
Stephen Hewitt18-May-10 5:25
Stephen Hewitt18-May-10 5:25 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
K ARUN KUMAR18-May-10 18:13
K ARUN KUMAR18-May-10 18:13 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
Stephen Hewitt18-May-10 18:22
Stephen Hewitt18-May-10 18:22 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
K ARUN KUMAR18-May-10 18:46
K ARUN KUMAR18-May-10 18:46 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
Stephen Hewitt18-May-10 18:53
Stephen Hewitt18-May-10 18:53 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
K ARUN KUMAR18-May-10 19:02
K ARUN KUMAR18-May-10 19:02 
IDL File Entry:
[id(5),helpstring("method SetData")] HRESULT SetData([in] ULONG size, [in,size_is(size)] BYTE *pData);

Method Override:

STDMETHODIMP CDataProvider::SetData(ULONG size, BYTE* bytArray)
{
// TODO: Add your implementation code here

BYTE byt[6];
int i=0;
for(;*bytArray!=0;i++)
{
byt[i]=*bytArray;

::MessageBox(NULL,(LPCTSTR)"he","Msg",MB_OK);
bytArray++;
}
byt[i]=0;


return S_OK;
}

Client:

IDataProvider* pServer=NULL;
HRESULT hr=::CoCreateInstance(CLSID_CDataProvider,NULL,CLSCTX_LOCAL_SERVER,IID_IDataProvider,(LPVOID*)&pServer);

short sSize = 5;
BYTE* pBytes;

//Allocate the shared Memory
pBytes = reinterpret_cast<byte *="">(CoTaskMemAlloc(sSize * sizeof(BYTE)));
if(pBytes == NULL)
return;

::memset(pBytes, 0, sSize);
pBytes[0]='K';
pBytes[1]='K';
pBytes[2]='R';
pBytes[3]='D';
pBytes[4]=NULL;
pServer->SetData(5,pBytes);

CoTaskMemFree(pBytes); //Free the shared Memory
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
Stephen Hewitt18-May-10 19:17
Stephen Hewitt18-May-10 19:17 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
K ARUN KUMAR18-May-10 20:03
K ARUN KUMAR18-May-10 20:03 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
Stephen Hewitt18-May-10 20:19
Stephen Hewitt18-May-10 20:19 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
K ARUN KUMAR18-May-10 20:29
K ARUN KUMAR18-May-10 20:29 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
Stephen Hewitt18-May-10 20:37
Stephen Hewitt18-May-10 20:37 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
K ARUN KUMAR18-May-10 21:01
K ARUN KUMAR18-May-10 21:01 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
Stephen Hewitt18-May-10 21:16
Stephen Hewitt18-May-10 21:16 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
K ARUN KUMAR18-May-10 21:30
K ARUN KUMAR18-May-10 21:30 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
Stephen Hewitt18-May-10 21:40
Stephen Hewitt18-May-10 21:40 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
K ARUN KUMAR18-May-10 22:51
K ARUN KUMAR18-May-10 22:51 
QuestionProblem with ActiveX control Pin
NarVish17-May-10 1:44
NarVish17-May-10 1:44 
AnswerRe: Problem with ActiveX control Pin
Cool_Dev18-May-10 1:59
Cool_Dev18-May-10 1:59 
GeneralRe: Problem with ActiveX control Pin
NarVish21-May-10 0:05
NarVish21-May-10 0:05 
QuestionCan we call dynamically COM exposed methods inhertied from IUnknow? Pin
glitteringsound14-May-10 2:07
glitteringsound14-May-10 2:07 
QuestionWhy Exception occured getting address of COM function ? [modified] Pin
glitteringsound12-May-10 21:21
glitteringsound12-May-10 21:21 
Questionlanguage localization using XML in VC++ Pin
punyah20108-May-10 9:03
punyah20108-May-10 9:03 
AnswerRe: language localization using XML in VC++ Pin
Cool_Dev18-May-10 2:04
Cool_Dev18-May-10 2:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.