|
Hi,
It´s an InProc, but I´m calling the ActiveX from an automated version from Word so it would be something like:
MyApp ( making calls to the controls)
---------------------------- Different Space Process
Word Instance ( Automated)
My Control DLL
Maybe it can be that the Word automated instance only can work with IDispatch interfaces ?
Thanks for your help, Bye !
Braulio
|
|
|
|
|
The (or at least: one) problem is to marshaling you custom interface across the Process Boundary.
For Dispatch interfaces, this is automatic (since the data types are limited and passed with function calls).
For custom interfaces, you need to build & register a proxy/stub DLL. ATL generates a makefile <projectname>_ps.mak, that which can be used to build the proxy/stub DLL automatically. (It uses the output of the MIDL compiler, so first compile the "normal" project, then the proxy/stub). The resulting DLL must be registered using regsvr32. Then, try again
-----------
how marshaling works: on the client side, the component's interface is silently replaced by a stub, which implements the required interface, but does nothing than pack the parameters in some marshaling stream and passes this to the proxy.
The proxy is loaded into the server apartment, unpacks the parameters, calls the actual method, packs the result(s) into a stream, and returns this to the stub.
The stub unpacks everything, and returns to the caller.
Not surprisingly, Proxy & Stub are implemented as COM components - in the proxy/stub DLL (it needs to be a DLL so it can be loaded into any process).
When building an ATL DLL server, you can also choose the merge the proxy/stub code into the DLL.
Hope this helps
Peter
|
|
|
|
|
Thanks !
Just one question, where can I see if my current project have that option checked ( the "merge the proxy/stub code into the DLL"), I can see it in the wizard when you create a project, but I don´t find the checkbox for a current created project ( or the file entry).
Thanks again for your help, greetings !
Braulio
|
|
|
|
|
The <projectname>_ps.c (or .cpp? dunno...) should be part of your project (check the Files Tab)
|
|
|
|
|
Hi,
I didn´t found a file like that, what should I do then ?
Thanks, greetings
Braulio
|
|
|
|
|
The customer requests an application that draws a grid and some data over the entire screen, including all other applications and the task bar. This grid is supposed to be fully transparant, meaning that you can both see and manipulate windows under it. I have never seen anything like it before, and wonder if this can be done at all...
Does anyone have a suggestion?
Thanks
/moliate
|
|
|
|
|
If you use to implement ActiveX control with ATL,if you uncheck Opaque in "Miscellaneous" tab,then it will be transparat,for MFC I'm not sure but in your ONDraw function you do it and does not draw some part.
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
|
|
|
|
|
Thanks, but the problem is mainly how to forward messages to the underlaying windows. Can I detach my windows input queue from the raw input thread?
Also, simply setting a dialog as transparant, does not seem to work the way I want it to, as it is a child of the desktop and does not update other windows underneath.
/moliate
|
|
|
|
|
If you are using Win2k or above, you can create a window with the style WS_EX_TOPMOST (keep above all other windows), WS_EX_LAYERED (for transparency/translucency) and WS_TRANSPARENT (causes input to be passed through). Check out the layered window API to learn how to draw and update such a window.
If you are using Win9x, you will have to do much more work. Using window regions is one possibility...
IMHO, this seems a strange way of presenting information... may i ask what this is for?
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
Thanks, I'll take a look at that...
Anyway, the application is an user interaction logger. By keeping track of mouse and eye movement along with window positions, cognitive scientists want to study how users interact with different programs. The transparant window is for the playback, where some statistical data will be displayed.
/moliate
|
|
|
|
|
Hello!
Does anyone know how I can change OLE object size (which was inserted into RichEditCtrl) without reinsertion?
I know how to retrieve size but I don't know hot to change it.
Help! Please!
|
|
|
|
|
hello,
Why do CDC's created in functions other than OnDraw dont work good? The drawings made with these get eaten during scrolling.
How to avoid this?
I am desperate for the solution.
Heather
|
|
|
|
|
The reason: you draw something in other place than OnDraw, but when window is updated, OnDraw makes something else. Solution:
1) You keep some data which defines what should be drawn in the window (in Doc-View application this data is kept in CDocument class, in general case it can be in any place you want).
2) OnDraw draws window according to this data. Every time window is updated (for example, user minimizes and restores window), OnDraw redraws window according to current data state.
3) When data is changed as result of some user actions (such as scrolling or something else), you never redraw window directly. Instead of this you change your data and call:
Invalidate();
UpdateWindow();
After this Window calls your OnDraw() function and it redraws window in new state.
|
|
|
|
|
(adding to what Alex said)
device contexts acquired outside of OnDraw should be used only for retriving information (like "how many colors", or "how many pixels do I need for writing 'Ophelia' in Hamlet-Thin-12pt style")
|
|
|
|
|
One of my views contains a grid control. In this view I want to select one entry in the grid control. When the entry is selected and the user choose a menu item called:
"View details" I want to open a new view and show details from the selected entry.
The problem is that this new view doesn't know anything about what is selected in the grid control. Is there any way to access data from one view to another view?
|
|
|
|
|
hi there,
You could have been more elaborate.I'll try.
Its Simple. Just make a structure with all the parameters you need for display,initialise the structure data with datails and pass this structure to the concerned function.
Hope this works.
Mussanje
|
|
|
|
|
How can I pass this structure? I have one class for each view. CUnitView and CUnitDetailsView. UnitView contains a grid with all the units and unitdetailsview shows details about one specific unit. From unitdetailsview I can't know if an entry i selected in unitview....
|
|
|
|
|
What actually is the unit you are talking about? Is it just some number or an entity?
Be a bit more clear.
|
|
|
|
|
I have a table called unit in my database. The unit has a unique id and a name. All the units are listed in unitview.
|
|
|
|
|
You could do this by letting the new view send a private message to the grid view asking for the data. When the new view initializes (e.g. in OnCreate) it sends a WM_YOURPRIVATEMESSAGE (which is #defined as WM_APP + 1 (or is it WM_USER + 1? I always have to look that up)) with SendMessage. The gridview returns the relevant data in the lParam.
Since your new view doesn't know the handle of the grid view you'll probably have to send the message to the mainframe which in turn sends it to all it's decendants. You only handle the message in the grid view, all other views simply ignores it. By using SendMessage instead of PostMessage you're sure that the data will be available for the new view in OnCreate.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Thanks for your respond. I'm not familiar with Sendmessage. Is it possible for you to give me an example of how I should use it. The information I want from the grid is:
I must first check if an entry is selected and return selected status. If an entry is selected I want to return the identifier of the selected entry. How should I proceed to get sendmessage to return this information.
Best regards
Øyvind
|
|
|
|
|
hi,
how to type cast a struct into LPARAM or WPARAM to be sent in SendMessage(...) ? Mine did not work which was
struct Test{int num;CString name;};
//-----
Test ts;
::SendMessage(hWnd,21,(LPARAM)&ts);
It said something like " no conversion possible. See Test declaration."
Why?
bye.
|
|
|
|
|
That is not the way Sendmessage is defined... From MSDN:
LRESULT SendMessage(
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);
You have:
::SendMessage(hWnd,21,(LPARAM)&ts);
Meaning the message is WM_SYSCOLORCHANGE , you are trying to cast a LPARAM to WPARAM that can not hold a pointer as it is only 16 bits, and miss the LPARAM completly.
/moliate
|
|
|
|
|
Noooooooooo,
just a typing eror.The message is correct in place as the second parameter.
Rachel
|
|
|
|
|
Do you mean that your SendMessage looks like
::SendMessage(hWnd, WM_SOMEMESSAGE, 21, (LPARAM)&ts); ?
My VC60 is perfectly happy with this line (using WM_CREATE as message)
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|