Click here to Skip to main content
15,891,431 members
Home / Discussions / COM
   

COM

 
AnswerRe: How to fetch ULONG from variant in VB application Pin
Rama Krishna Vavilala16-May-02 14:43
Rama Krishna Vavilala16-May-02 14:43 
GeneralCOM/DCOM Development Pin
15-May-02 12:44
suss15-May-02 12:44 
GeneralRe: COM/DCOM Development Pin
Rama Krishna Vavilala16-May-02 14:46
Rama Krishna Vavilala16-May-02 14:46 
GeneralRe: COM/DCOM Development Pin
28-May-02 4:21
suss28-May-02 4:21 
GeneralPassing PVOID through VARIANT Pin
Hans Ruck15-May-02 6:29
Hans Ruck15-May-02 6:29 
GeneralRe: Passing PVOID through VARIANT Pin
Not Active15-May-02 6:32
mentorNot Active15-May-02 6:32 
GeneralRe: Passing PVOID through VARIANT Pin
Hans Ruck15-May-02 7:11
Hans Ruck15-May-02 7:11 
GeneralRe: Passing PVOID through VARIANT Pin
soptest15-May-02 8:22
soptest15-May-02 8:22 
First define structure in IDL file (Example):

typedef struct MY_STRUCT
{
	long lVal;
	BSTR wsVal;
} _s1;
	[
		object,
		uuid(BC922B3D-682B-11D6-A110-00B0D0C3D9BD),
		dual,
		helpstring("ITest Interface"),
		pointer_default(unique)
	]
	interface ITest : IDispatch
	{
		[id(1), helpstring("method Foo")] HRESULT Foo([in,out] _s1 *sOut);
	};

[
	uuid(BC922B31-682B-11D6-A110-00B0D0C3D9BD),
	version(1.0),
	helpstring("ForVB 1.0 Type Library")
]
library FORVBLib
{
	importlib("stdole32.tlb");
	importlib("stdole2.tlb");
	[
		uuid(BC922B3E-682B-11D6-A110-00B0D0C3D9BD),
		helpstring("Test Class")
	]
	coclass Test
	{
		[default] interface ITest;
	};
};


C++ implementation of the function returning that structure to VB app.

STDMETHODIMP CTest::Foo(_s1 *sOut)
{
	if(!sOut) 
		return E_POINTER;

	sOut->lVal = 12345;
	sOut->wsVal = ::SysAllocString(L"Some string.");

	return S_OK;
}


This is VB code to get the structured data:

Private Sub Command1_Click()
Dim s As FORVBLib.MY_STRUCT

Dim obj As FORVBLib.Test

Set obj = New FORVBLib.Test

obj.Foo s

End Sub


soptest
GeneralRichEditCtrl Failed to create Pin
ssirisha15-May-02 4:28
ssirisha15-May-02 4:28 
GeneralRe: RichEditCtrl Failed to create Pin
Carlos Antollini15-May-02 5:54
Carlos Antollini15-May-02 5:54 
GeneralRe: RichEditCtrl Failed to create Pin
Carlos Antollini15-May-02 5:54
Carlos Antollini15-May-02 5:54 
GeneralRe: RichEditCtrl Failed to create Pin
ssirisha15-May-02 5:50
ssirisha15-May-02 5:50 
QuestionPlugins for IE? Pin
14-May-02 9:57
suss14-May-02 9:57 
GeneralProblem registrering DLL Pin
ssirisha14-May-02 9:23
ssirisha14-May-02 9:23 
GeneralRe: Problem registrering DLL Pin
Jason Henderson15-May-02 5:29
Jason Henderson15-May-02 5:29 
GeneralRe: Problem registrering DLL Pin
ssirisha15-May-02 5:32
ssirisha15-May-02 5:32 
GeneralCreating A/X control in frame window with ATL Pin
soccerdad14-May-02 7:55
soccerdad14-May-02 7:55 
GeneralRe: Creating A/X control in frame window with ATL Pin
soptest14-May-02 8:56
soptest14-May-02 8:56 
GeneralATL alternative Pin
Ulf Öhlén14-May-02 4:27
Ulf Öhlén14-May-02 4:27 
GeneralRe: ATL alternative Pin
Joao Vaz14-May-02 6:36
Joao Vaz14-May-02 6:36 
GeneralRe: ATL alternative Pin
Ulf Öhlén14-May-02 21:18
Ulf Öhlén14-May-02 21:18 
GeneralCOM running twice Pin
Gavin_Mannion14-May-02 1:30
Gavin_Mannion14-May-02 1:30 
GeneralATL7 Pin
Mazdak12-May-02 23:34
Mazdak12-May-02 23:34 
GeneralRe: ATL7 Pin
safepage13-May-02 3:01
safepage13-May-02 3:01 
QuestionHow can I get an array of datas from COM server? Pin
magicast12-May-02 22:53
magicast12-May-02 22:53 

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.