|
Then, I think you will probably want to investigate the new true-color icons that were introduced with Windows XP. Not only are they true color, but they support a full 8-bit alpha channel for transparancy. An image list composed of these may work better, but I do not know for sure.
--
Paul
"I drank... WHAT?"
|
|
|
|
|
Why when I click VK_DOWN or VK_UP ... (when my control has focus - control derived from CWnd). Control lost focus and next control get focus ?
Control doest never reveive VK_DOWN
Creating code :
dlg_table.Create(NULL,"Table",WS_CHILD | WS_VISIBLE, CRect(0,0,210,20),this,1001);
|
|
|
|
|
That window needs to respond to the WM_GETDLGCODE message. The DLGC_WANTARROWS flag will let the dialog message loop know you want the arrow keys.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
How can I access MainFrame from my view?
GetActiveFrame doesnt work.
|
|
|
|
|
GetParentFrame()
Michael
|
|
|
|
|
Try this:
(CMainFrame*)(AfxGetMainWnd())
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,
I've created my ATL object, with one dual interface, and one custom interface, I have no problem accessing to the dual one, but to the custo, I cannot have access ( in the MFC application, using Smart pointers).
Does Smart pointer didn´t work with custom interfaces ?????
Thanks, Bye !
Braulio
|
|
|
|
|
They do work - what kind of Smart Pointers do you use?
(ComPtr, _com_ptr_t, or the MFC stuff? I usually use #import and the the _com_ptr_t ones - they are great...)
|
|
|
|
|
Hi !
I´m using the "#import" thing, and CComPtr, it´s quite amazing because I can declare the pointer, and the compiler won´t complain, but when I try to get my interface, it returns NULL, altough I've declared it in the interface map.
Thanks for your help, Bye !
Braulio
|
|
|
|
|
Whar error code is returned?
Is it an out-of-apartment component? In this case, the Proxy/Stub DLL might be missing / not registered.
Peter
|
|
|
|
|
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?
|
|
|
|
|