|
Hi:
Sorry,my ATL knowledge is not enough to help you.
It's very dissapointing that although there are lots of expert in CP but it seems
non of them (or few of them) have good ATL knowledge.
There are about 30000 members in this site...
Good luck and Bye
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Hi Mazdak !
Finally I got the solution, Joao Vaz give me one URL to a nice article, and now it is working nice !!! ( there were some magic with the streams XDDD ).
I have to tidy up all the code and make a submission to codeproject. Bye !
Braulio
|
|
|
|
|
Hola !
As I promised you I Wrote the article about Streams and Pictures and ActiveX, you can check it out in:
http://www.codeproject.com/useritems/PictureTransfer.asp
The bad thing... something went wrong with the submission wizard and the Picture and the zip with the source is not there ( I sent one e-mail to chris with the files, let´s hope he fixes it).
Bye !
Braulio
|
|
|
|
|
Braulio, just one thought , you tried to create the stream on global memory
with the CreateStreamOnHGlobal and get the global handle from the server with
GetHGlobalFromStream , this without using Stg ?
Joao Vaz
|
|
|
|
|
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 , ( 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
|
|
|
|
|
|
Hi Joao !
I had that article before, but well I read it again, and you were right !!!, there is the solution !!!, thanks a lot !
See you and obrigado !
Braulio
|
|
|
|
|
Cool , now you can post a article on Code Project
Cheers,
Joao Vaz
|
|
|
|
|
Hi Braulio, unfortunately seems like most of us in this forum are COM-impaired but I'm following your investigations with great interest, and doing a little research myself. I've just sumbled upon these two functions:
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/cmf_a2c_88tp.asp">CoMarshalInterThreadInterfaceInStream</a> ,
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/cmf_a2c_1rjh.asp">CoGetInterfaceAndReleaseStream</a> ,
which seem to do the job of packing and unpacking an object with the aid of an IStream to pass things across threads. Maybe they're worth having a look at. Good luck.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks for the tip !
MMm..., I don´t know too much about marshaling, but well it´s good time to start learning, I think I have to use maybe something like "CoMarshalInterface", because I have different process, I have:
MyApp -( Different Space Proccess)-> Word Automated Instance --> MyDll
I´m advancing but very slow, but now I can paste the ActiveX in a Word automated instance, modify it from my app, and even make serialize it !, the last step it´s to do something useful XD, like for example get the picture...
I swear that if I get all this things up and running I will write a mega article for codeguru talking about this stuff
Thanks for the help Joaquin, Hasta luego !
Braulio
|
|
|
|
|
I swear that if I get all this things up and running I will write a mega article for codeguru talking about this stuff
codeguru?
Suerte con la historia ésta, seguro que cuando acabes tendrás mogollón de información para un buen artículo.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
HOOLA !!!
Ooops, sh*t not codeguru... CODEPROJECT OF COURSE
I GOT IT !!!!, It is working now, thanks to the article ( "Using Picture Objects in ATL", from VBPJ, page 102, wow it´s not so easy to make work the streams and streams persists).
Ahora tengo que ajustarlo para que no pierda memoria ni recursos, y en cuanto lo tenga voy a hacer un pedaaasssoo de artículo... XDDDD
Hasta luego, y gracias por los ánimos !
Braulio
|
|
|
|
|
enhorabuena chaval
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Congratulation!
I'm waiting for that article ,come on Braulio,but I want it here in COPDEPROJECT not codeguru.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Joaquín , these two functions doesn't work outside processes neither the preferred way of IGlobalInterfaceTable::RegisterInterfaceInGlobal.
He's doing the right thing, i must be a minimal error, that can't spot, i used to program in COM an ATL, but i don't touch it for about one year, and man, we can forget a lot of things that was trivial in past
Regards, Joaquín and continue your good work here at VC++ forum helping the guys . You and James T. Johnson (on the C#) are the most active guys, of course not counting Nish too
Joao Vaz
|
|
|
|
|
Hola !
As I promised you I Wrote the article about Streams and Pictures and ActiveX, you can check it out in:
http://www.codeproject.com/useritems/PictureTransfer.asp
The bad thing... something went wrong with the submission wizard and the Picture and the zip with the source is not there ( I sent one e-mail to chris with the files, let´s hope he fixes it).
Bye !
Braulio
|
|
|
|
|
Hola !
As I promised you I Wrote the article about Streams and Pictures and ActiveX, you can check it out in:
http://www.codeproject.com/useritems/PictureTransfer.asp
The bad thing... something went wrong with the submission wizard and the Picture and the zip with the source is not there ( I sent one e-mail to chris with the files, let´s hope he fixes it).
Bye !
Braulio
|
|
|
|
|
Hello,
I use the function PolyBezier(), so I have a curve composed of "n" Bezier Curves , but I don't know how to get the y coordinate of my curve giving the x coordinate. Is there a solution ?
Thanks
|
|
|
|
|
The curve is made up of connecting Bezier segments, each depending on two end points P0 and P3 and two so-called control points P1 and P2. Points in the segment are given by
x(k) = (1-k)3x0 + 3k(1-k)2x1 + 3k2(1-k)x2 + k3x3,
y(k) = (1-k)3y0 + 3k(1-k)2y1 + 3k2(1-k)y2 + k3y3,
where k ranges between 0 and 1.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
Can anyone tell me how to set the title of the main window in a SDI Doc/View Architecture app. Do i can totally replace 'untitled - Name Of App' ?
Regards
Richard
|
|
|
|
|
You can try to use CWnd::SetWindowText()
Hoope it help
Bye,
BogdanO
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
The standard way of doing this is using <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cdocument.3a3a.settitle.asp">CDocument::SetTitle</a> .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Add this to your PreCreate of your CMainframe :
cs.style &= ~FWS_ADDTOTITLE;
and after that use SetWindowText
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Mazy,
Just noticed you tag line! Great choice
<p>
So, so you think you can tell
Heaven from Hell,
Blue skys from pain.
Can you tell a green field
From a cold steel rail?
A smile from a veil?
Do you think you can tell?
<p>
And did they get you to trade
Your heros for ghosts?
Hot ashes for trees?
Hot air for a cool breeze?
Cold comfort for change?
And did you exchange
A walk on part in the war
For a lead role in a cage?
<p>
How I wish, how I wish you were here.
We're just two lost souls
Swimming in a fish bowl,
Year after year,
Running over the same old ground.
What have we found?
The same old fears.
Wish you were here.
Paul Lyons
"What a long, strange trip its been".
- Robert Hunter/Jerry Garcia
|
|
|
|
|
Thanks Paul
It's so bad that there is not enough space to put all of
this song bellow my signiture every time I put message in CP
o,where is my signiture????
|
|
|
|
|