Click here to Skip to main content
15,914,820 members
Home / Discussions / COM
   

COM

 
QuestionIPC through COM? Pin
27-Apr-02 3:54
suss27-Apr-02 3:54 
AnswerRe: IPC through COM? Pin
Paul M Watt28-Apr-02 6:47
mentorPaul M Watt28-Apr-02 6:47 
GeneralActiveX Control: Strange RichEdit related linker errors Pin
Chen Venkataraman26-Apr-02 4:42
Chen Venkataraman26-Apr-02 4:42 
GeneralRe: ActiveX Control: Strange RichEdit related linker errors Pin
Chen Venkataraman26-Apr-02 4:49
Chen Venkataraman26-Apr-02 4:49 
GeneralRe: ActiveX Control: Strange RichEdit related linker errors Pin
Chen Venkataraman26-Apr-02 6:01
Chen Venkataraman26-Apr-02 6:01 
QuestionHow to get rid of pesky || characters? Pin
Tommy Svensson26-Apr-02 0:20
Tommy Svensson26-Apr-02 0:20 
AnswerRe: How to get rid of pesky || characters? Pin
Michael P Butler26-Apr-02 0:34
Michael P Butler26-Apr-02 0:34 
QuestionHow to handle huge strings and cross over calls?? Pin
Tommy Svensson25-Apr-02 23:29
Tommy Svensson25-Apr-02 23:29 
Hi everybody,

I'm reading a huge selection of text from MS Word to a COM object. My objective is to translate this text.

The interface goes like this:

Word Macro calls Translate of COMobj where Selection.Text contains the text to be translated:
sub Trans
  Selection.Text = COMObj->Translate(Selection.Text)
end sub


COMObj's Translate looks like this:
STDMETHODIMP CCPPTranslate::Translate(BSTR* pbstrText, BSTR* pbstrRet)
{
	// TODO: Add your implementation code here

	USES_CONVERSION;
	
	if (m_Translator.IsOk())
	{
		char* pszText = m_Translator.Translate(W2A(*pbstrText));
		CComBSTR ComBSTR = CComBSTR(pszText);
		
		// Must not forget to free the memory allocated in CTranslate::Translate
		delete[] pszText;
		
		*pbstrRet = ComBSTR.Detach();
		
		return S_OK;
	
	}


Now, what happens is that when I select more than 32767 (is that a bell ringing?) characters and run the macro, MS Word crashes. Is this because of some limitations COM have with respect to string lengths that I do not know of or is there something else I'm missing here?

All help is greatly appreciated,

/Tommy
AnswerRe: How to handle huge strings and cross over calls?? Pin
Paul M Watt28-Apr-02 6:49
mentorPaul M Watt28-Apr-02 6:49 
AnswerRe: How to handle huge strings and cross over calls?? Pin
soptest3-May-02 14:28
soptest3-May-02 14:28 
GeneralOCX invisible in Netscape Navigator Pin
maya25-Apr-02 20:36
maya25-Apr-02 20:36 
GeneralRe: OCX invisible in Netscape Navigator Pin
Amit Dey27-Apr-02 16:46
Amit Dey27-Apr-02 16:46 
GeneralPowerpoint and Launching External Apps Pin
jedidjab7925-Apr-02 2:13
jedidjab7925-Apr-02 2:13 
GeneralRe: Powerpoint and Launching External Apps Pin
Amit Dey27-Apr-02 16:55
Amit Dey27-Apr-02 16:55 
GeneralRe: Powerpoint and Launching External Apps Pin
Amit Dey27-Apr-02 19:14
Amit Dey27-Apr-02 19:14 
GeneralRe: Powerpoint and Launching External Apps Pin
jedidjab7928-Apr-02 15:33
jedidjab7928-Apr-02 15:33 
GeneralProblem with C# COM server Pin
Tunca Bergmen24-Apr-02 23:38
Tunca Bergmen24-Apr-02 23:38 
AnswerRe: Problem with C# COM server Pin
netcreator16-Apr-09 17:54
netcreator16-Apr-09 17:54 
GeneralPlease help me! Pin
StefanM24-Apr-02 11:01
StefanM24-Apr-02 11:01 
QuestionHow to pass a string into COM Pin
24-Apr-02 5:34
suss24-Apr-02 5:34 
AnswerRe: How to pass a string into COM Pin
Paul M Watt24-Apr-02 5:42
mentorPaul M Watt24-Apr-02 5:42 
GeneralRe: How to pass a string into COM Pin
Sayan Mukherjee24-Apr-02 21:30
Sayan Mukherjee24-Apr-02 21:30 
GeneralRe: How to pass a string into COM Pin
25-Apr-02 1:29
suss25-Apr-02 1:29 
GeneralRe: How to pass a string into COM Pin
Matt Philmon1-May-02 2:11
Matt Philmon1-May-02 2:11 
AnswerRe: How to pass a string into COM Pin
soup29-Apr-02 2:21
soup29-Apr-02 2:21 

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.