Click here to Skip to main content
15,906,329 members
Home / Discussions / COM
   

COM

 
AnswerRe: Getting COM Error: Scalar deleting destructor. Pin
Stephen Hewitt20-May-10 21:54
Stephen Hewitt20-May-10 21:54 
GeneralRe: Getting COM Error: Scalar deleting destructor. Pin
KTTransfer20-May-10 22:34
KTTransfer20-May-10 22:34 
GeneralRe: Getting COM Error: Scalar deleting destructor. Pin
Stephen Hewitt22-May-10 22:09
Stephen Hewitt22-May-10 22:09 
QuestionApplication attempted to perform an operation not allowed by the security policy Pin
NarVish19-May-10 1:38
NarVish19-May-10 1:38 
QuestionTROUBLE Passing BYTE Array from Client to COM OUTPROC Server [modified] Pin
K ARUN KUMAR17-May-10 18:22
K ARUN KUMAR17-May-10 18:22 
AnswerRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
Stephen Hewitt17-May-10 19:59
Stephen Hewitt17-May-10 19:59 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
K ARUN KUMAR17-May-10 21:07
K ARUN KUMAR17-May-10 21:07 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
Stephen Hewitt17-May-10 22:33
Stephen Hewitt17-May-10 22:33 
Did you register the proxy-stub? I'm betting no! Anyway I hacked this together:

The client:
#include "stdafx.h"

#import "../Server/Debug/Server.tlb" no_namespace

void DoIt()
{
	IServicerPtr p;
	HRESULT hr = p.CreateInstance(__uuidof(Servicer));
	if (SUCCEEDED(hr))
	{
		BYTE data[] = {1, 2, 3, 4, 3, 2, 1};
		p->SetData(sizeof(data), data);
	}
}

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
	CoInitialize(NULL);
	DoIt();
	CoUninitialize();

	return 0;
}


The server's IDL (extract).
[
	object,
	uuid(3D71D2F1-E297-4B26-B2AC-32EA22EFC2B4),
	helpstring("IServicer Interface"),
	pointer_default(unique)
]
interface IServicer : IUnknown{
	[helpstring("method SetData")] HRESULT SetData([in] ULONG size, [in, size_is(size)] BYTE * pData);
};


The server (extract):
STDMETHODIMP CServicer::SetData(/*[in]*/ ULONG size, /*[in, size_is(size)]*/ BYTE * pData)
{
	ostringstream oss;
	for (ULONG i=0; i<size; ++i)
	{
		oss << static_cast<int>(pData[i]) << " ";
	}

	MessageBoxA(NULL, oss.str().c_str(), "Server", MB_OK);

	return S_OK;
}

Steve

GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
K ARUN KUMAR17-May-10 23:30
K ARUN KUMAR17-May-10 23:30 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
Stephen Hewitt18-May-10 0:14
Stephen Hewitt18-May-10 0:14 
GeneralRe: TROUBLE Passing BYTE Array from Client to COM OUTPROC Server Pin
K ARUN KUMAR18-May-10 0:32
K ARUN KUMAR18-May-10 0:32 
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 
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 

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.