Click here to Skip to main content
16,008,719 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralTrying to use IStream to pass data to an ATL Server Pin
Braulio Dez21-Feb-02 3:05
Braulio Dez21-Feb-02 3:05 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Mazdak21-Feb-02 3:33
Mazdak21-Feb-02 3:33 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Braulio Dez21-Feb-02 3:49
Braulio Dez21-Feb-02 3:49 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Mazdak21-Feb-02 4:22
Mazdak21-Feb-02 4:22 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Braulio Dez21-Feb-02 7:25
Braulio Dez21-Feb-02 7:25 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Braulio Dez13-Mar-02 2:41
Braulio Dez13-Mar-02 2:41 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Joao Vaz21-Feb-02 4:38
Joao Vaz21-Feb-02 4:38 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Braulio Dez21-Feb-02 5:26
Braulio Dez21-Feb-02 5:26 
Hi,

Thanks for the tip, I´m trying it now, but it gives me the same error, here it is the code that I use now:

MFC Client:
IStream *TempStream = NULL;

CreateStreamOnHGlobal (NULL, TRUE, &TempStream);

HGLOBAL hMem = NULL;
GetHGlobalFromStream(TempStream, &hMem);
LPVOID lpData = GlobalLock(hMem);

HRESULT HRes = IPict->SaveAsFile(TempStream, TRUE, 0);
GlobalUnlock(hMem);

m_GDIGr.SetMetafile(TempStream);


ATL Server:
STDMETHODIMP CGDIGraphics::SetMetafile(IStream *pStream)
{
   
   IPicture *Pict = NULL;        

   HGLOBAL hMem = NULL;
   GetHGlobalFromStream(pStream, &hMem);
   LPVOID lpData = GlobalLock(hMem);   
   HRESULT Res = ::OleLoadPicture(pStream, 0, FALSE, IID_IPicture,(void **) &Pict);
   GlobalUnlock(hMem);   


I don´t know where I made the mess Frown | :-( , ( I´m pasting the activeX in an automated Ms Word instance and from my app calling the method to insert the activex, all this should be easy-pc for Com isn´t it ? )

Thanks, Bye !
Braulio
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Joao Vaz21-Feb-02 6:15
Joao Vaz21-Feb-02 6:15 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Braulio Dez21-Feb-02 7:18
Braulio Dez21-Feb-02 7:18 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Joao Vaz21-Feb-02 7:42
Joao Vaz21-Feb-02 7:42 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Joaquín M López Muñoz21-Feb-02 6:19
Joaquín M López Muñoz21-Feb-02 6:19 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Braulio Dez21-Feb-02 6:42
Braulio Dez21-Feb-02 6:42 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Joaquín M López Muñoz21-Feb-02 6:41
Joaquín M López Muñoz21-Feb-02 6:41 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Braulio Dez21-Feb-02 7:17
Braulio Dez21-Feb-02 7:17 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Joaquín M López Muñoz21-Feb-02 7:38
Joaquín M López Muñoz21-Feb-02 7:38 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Mazdak21-Feb-02 7:26
Mazdak21-Feb-02 7:26 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Joao Vaz21-Feb-02 6:50
Joao Vaz21-Feb-02 6:50 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Braulio Dez13-Mar-02 2:41
Braulio Dez13-Mar-02 2:41 
GeneralRe: Trying to use IStream to pass data to an ATL Server Pin
Braulio Dez13-Mar-02 2:40
Braulio Dez13-Mar-02 2:40 
GeneralFind y coord of a BezierSpline Pin
21-Feb-02 2:49
suss21-Feb-02 2:49 
GeneralRe: Find y coord of a BezierSpline Pin
Joaquín M López Muñoz21-Feb-02 3:19
Joaquín M López Muñoz21-Feb-02 3:19 
GeneralDoc/View - Setting The Window Title Pin
AJ12321-Feb-02 2:25
AJ12321-Feb-02 2:25 
GeneralRe: Doc/View - Setting The Window Title Pin
21-Feb-02 2:25
suss21-Feb-02 2:25 
GeneralRe: Doc/View - Setting The Window Title Pin
Joaquín M López Muñoz21-Feb-02 2:29
Joaquín M López Muñoz21-Feb-02 2:29 

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.