Click here to Skip to main content
15,917,731 members
Home / Discussions / COM
   

COM

 
GeneralPassing string Pin
shiraztk1-Apr-04 19:46
shiraztk1-Apr-04 19:46 
GeneralRe: Passing string Pin
Rory Solley1-Apr-04 20:19
Rory Solley1-Apr-04 20:19 
GeneralRe: Passing string Pin
shiraztk1-Apr-04 20:23
shiraztk1-Apr-04 20:23 
GeneralRe: Passing string Pin
Rory Solley1-Apr-04 21:37
Rory Solley1-Apr-04 21:37 
GeneralRe: Passing string Pin
shiraztk1-Apr-04 22:06
shiraztk1-Apr-04 22:06 
GeneralRe: Passing string Pin
Mike Dimmick2-Apr-04 1:52
Mike Dimmick2-Apr-04 1:52 
GeneralRe: Passing string Pin
vprashu5-Apr-04 8:20
vprashu5-Apr-04 8:20 
GeneralPassing pointers to STL iterators as params to COM interface methods Pin
petrym1-Apr-04 16:12
petrym1-Apr-04 16:12 
I have an ATL COM class that will have to copy itself often.

The COM class holds data internally using an STL list.
Copying the data using a SAFEARRAY or even an intermediate buffer will be a performance issue.

Why not just cast STL iterators down to ULONGs


I have defined an interface method that has two parameters. This interface is implemented by the ATL COM class in question.
The IDL
<code>
HRESULT Copy([in] ULONG Begin, [in] ULONG End );
</code>

The ATL code
<code>
STDMETHOD(Copy)( ULONG Begin, ULONG End )
{
  std::list<type>::iterator it = *( (std::list<type>::iterator*) Begin );
  std::list<type>::iterator sentinel = *( (std::list<type>::iterator*) End );
  
  for( ; it != sentinel; ++it )
  {

 //copy data
  }
}
</code>


Calling the method
<code>
other->Copy( (ULONG)&m_list.begin(), (ULONG)&m_list.end() );
</code>


The ATL COM class in question is an inproc server. It probably does not need to marshall because everything runs in the same apartment. One concern is that the OS may create a surrogate process and this method may be marshalled. Will this cause problems?

Any thoughts and/or feedback appreciated!!

mike
QuestionCustom ActiveX control hosting another custom control? Pin
Member 9789281-Apr-04 5:00
Member 9789281-Apr-04 5:00 
QuestionTool to embed exe in OCX? Pin
kaleid31-Mar-04 18:31
kaleid31-Mar-04 18:31 
QuestionHow COM client call my COM object Pin
_David_Lee_30-Mar-04 15:24
_David_Lee_30-Mar-04 15:24 
AnswerRe: How COM client call my COM object Pin
User 21559730-Mar-04 17:43
User 21559730-Mar-04 17:43 
GeneralRe: How COM client call my COM object Pin
_David_Lee_30-Mar-04 20:41
_David_Lee_30-Mar-04 20:41 
GeneralRe: How COM client call my COM object Pin
Steve S1-Apr-04 1:09
Steve S1-Apr-04 1:09 
GeneralRe: How COM client call my COM object Pin
RChin1-Apr-04 3:28
RChin1-Apr-04 3:28 
AnswerRe: How COM client call my COM object Pin
Mike Dimmick1-Apr-04 1:16
Mike Dimmick1-Apr-04 1:16 
GeneralRe: How COM client call my COM object Pin
Steve S1-Apr-04 22:17
Steve S1-Apr-04 22:17 
GeneralSaving Results from Excel OWC Pin
Mike Murphy30-Mar-04 6:30
Mike Murphy30-Mar-04 6:30 
QuestionCan i have two components with same ProgID ? Pin
User 21559730-Mar-04 4:01
User 21559730-Mar-04 4:01 
AnswerRe: Can i have two components with same ProgID ? Pin
Anonymous30-Mar-04 8:43
Anonymous30-Mar-04 8:43 
AnswerRe: Can i have two components with same ProgID ? Pin
ian mariano30-Mar-04 9:42
ian mariano30-Mar-04 9:42 
GeneralRe: Can i have two components with same ProgID ? Pin
User 21559730-Mar-04 17:39
User 21559730-Mar-04 17:39 
GeneralInterface as Events parameter and it release Pin
El'Cachubrey30-Mar-04 2:59
El'Cachubrey30-Mar-04 2:59 
GeneralRe: Interface as Events parameter and it release Pin
Anonymous30-Mar-04 8:42
Anonymous30-Mar-04 8:42 
GeneralRe: Interface as Events parameter and it release Pin
Vi231-Mar-04 1:22
Vi231-Mar-04 1:22 

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.