Click here to Skip to main content
15,886,067 members
Home / Discussions / COM
   

COM

 
AnswerRe: pass character string to COM Pin
MKUser2-Jul-08 19:53
MKUser2-Jul-08 19:53 
GeneralRe: pass character string to COM Pin
CPallini2-Jul-08 21:18
mveCPallini2-Jul-08 21:18 
GeneralRe: pass character string to COM Pin
MKUser2-Jul-08 21:56
MKUser2-Jul-08 21:56 
GeneralRe: pass character string to COM Pin
CPallini2-Jul-08 22:08
mveCPallini2-Jul-08 22:08 
GeneralRe: pass character string to COM Pin
MKUser2-Jul-08 22:58
MKUser2-Jul-08 22:58 
GeneralRe: pass character string to COM Pin
Vi22-Jul-08 22:08
Vi22-Jul-08 22:08 
GeneralRe: pass character string to COM Pin
MKUser2-Jul-08 23:02
MKUser2-Jul-08 23:02 
GeneralRe: pass character string to COM Pin
Vi22-Jul-08 17:38
Vi22-Jul-08 17:38 
If i want to return any variable length string from COM then i can allocate memory in COM and return it to exe (return BSTR*). Finall exe which's using the COM will free the memory. Is this OK?

Yes.
String Manipulation Functions Descriptions 
------------------------------------------
SysAllocString        Creates and initializes a string. 
SysAllocStringByteLen Creates a zero-terminated string of a specified length (32-bit only). 
SysAllocStringLen     Creates a string of a specified length. 
SysFreeString         Frees a previously created string. 
SysReAllocString      Changes the size and value of a string. 
SysReAllocStringLen   Changes the size of an existing string. 
SysStringByteLen      Returns the length of a string in bytes (32-bit only). 
SysStringLen          Returns the length of a string. 

There are some C++ classes working with BSTR: CComBSTR, _bstr_t.
How to make same parameter as input/output in COM function?

You can specify [in] for input parameter and [out] for output. I have shown this recently.
How to return more than one string through COM function. suppose if i have function
int func(BSTR inputstring, BSTR* outstring1, BSTR* outstring 2);
Here i want to return 2 strings from this function.

Simple answer is:
int func([in] BSTR inputstring, [out] BSTR* outstring1, [out] BSTR* outstring 2)

But this code will not be working with some scripts, because the basic data for script is VARIANT and not all IDispatch handler can process these data. Moreover, for example, Jscript cannot receive any [out] data at all, but only with [out, retval].

With best wishes,
Vita

GeneralRe: pass character string to COM Pin
CPallini1-Jul-08 22:08
mveCPallini1-Jul-08 22:08 
GeneralRe: pass character string to COM Pin
CPallini1-Jul-08 3:25
mveCPallini1-Jul-08 3:25 
QuestionHow to add another activex control to web page dynamically. Pin
vies0028-Jun-08 22:28
vies0028-Jun-08 22:28 
AnswerRe: How to add another activex control to web page dynamically. Pin
pascal9181-Mar-10 16:48
pascal9181-Mar-10 16:48 
QuestionDefine a enum type variable on the Interface (ATL project) ? Pin
iman_kh27-Jun-08 10:31
iman_kh27-Jun-08 10:31 
AnswerRe: Define a enum type variable on the Interface (ATL project) ? Pin
Stephen Hewitt1-Jul-08 15:03
Stephen Hewitt1-Jul-08 15:03 
AnswerRe: Define a enum type variable on the Interface (ATL project) ? Pin
Vi21-Jul-08 17:33
Vi21-Jul-08 17:33 
QuestionPassing an array from an ActiveX class Pin
Hampus@foi26-Jun-08 2:55
Hampus@foi26-Jun-08 2:55 
AnswerRe: Passing an array from an ActiveX class Pin
KarstenK26-Jun-08 3:22
mveKarstenK26-Jun-08 3:22 
GeneralRe: Passing an array from an ActiveX class Pin
Hampus@foi26-Jun-08 3:39
Hampus@foi26-Jun-08 3:39 
AnswerRe: Passing an array from an ActiveX class Pin
Lim Bio Liong26-Jun-08 7:21
Lim Bio Liong26-Jun-08 7:21 
GeneralRe: Passing an array from an ActiveX class Pin
Hampus@foi26-Jun-08 20:40
Hampus@foi26-Jun-08 20:40 
GeneralRe: Passing an array from an ActiveX class Pin
Lim Bio Liong26-Jun-08 21:26
Lim Bio Liong26-Jun-08 21:26 
QuestionAutomation, COM, server destruction Pin
ON_Vlad23-Jun-08 9:07
ON_Vlad23-Jun-08 9:07 
AnswerRe: Automation, COM, server destruction Pin
KarstenK26-Jun-08 3:29
mveKarstenK26-Jun-08 3:29 
GeneralRe: Automation, COM, server destruction Pin
ON_Vlad26-Jun-08 5:19
ON_Vlad26-Jun-08 5:19 
QuestionCOM Addin registery setting on Terminal server Pin
manisghouri23-Jun-08 1:06
manisghouri23-Jun-08 1:06 

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.