|
I am aware of programs like Grid Control that allow you to deal with cells. However, I want to write my own source code that creates tables and that allows the user to edit the contents of a table. Simply, I need to create some excel-like cells. Can anyone tell me what windows functions I can use for that?
none
|
|
|
|
|
Yes, it's called Elbow Grease.
One of these[^] articles can get you started.
Even a broken clock is right twice a day.
|
|
|
|
|
How can we handle the default pop-up menu (rbuttonclk) option in case of CEdit control.
I have a CFormView with some dialog controls.
When I do right mouse button click on the selected text of CEdit control it shows default popup menu(Undo/Cut/Copy/Paste/Select All Menu). I want to handle this operation through Main menu.
How should I proceed in this case. How can I know the text is selected(for copy), or clipboard is already having some copied text(for paste)?
Thanks in advance,
- Vijay
|
|
|
|
|
"Cut/Copy/Paste" are already in the main menu (Edit).
Examine the members of CEdit to get the selected text.
See MSDN GetClipboardData for clipboard operations.
|
|
|
|
|
there is a common sense for this sort of questions.
menu command goes to WM_COMMAND, override the message, click menu-item u want to handle, to see what the menu id is, then "case the_id" to handle it.
includeh10
|
|
|
|
|
In my MFC MDI project I've got two views V1 and V2.
V1 spawns two modeless CDialogs. C1 and C2
Now I do a switchview and V2 is showing in the mainframe.
C1 and C2 remain floating on top of V2.
I want V2 to be on top of C1 and C2.
Now I switchview back to V1.
Now I want C1 and C2 to be back on top of V1.
What functions will do my first requirement?
What must I do to the already spawned C1 and C2 when I go back to V1, to make them pop up?
Appreciate your help,
ns
|
|
|
|
|
ns wrote:
Now I do a switchview and V2 is showing in the mainframe.
C1 and C2 remain floating on top of V2.
I want V2 to be on top of C1 and C2.
You can have C1 and C2 behind the MAINFRAME, that is the Application window, but not between MainFrame and View.
Simply send them a message to set themselves to the last place in the Z-Order (or better, hide them?).
ns wrote:
Now I switchview back to V1.
Now I want C1 and C2 to be back on top of V1.
This is the normal behaviour of dialogs, sitting atop of their parent window.
Probably you have to send them a message to tell them to undo the first step.
--
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
That sounds like a plan. Now I need to know what the message looks like:
BasicallY i switchview fromn V1. So when I am doing this I sjphoulshave V1 send message to c1 and c2 right?
Something like C1->SendMEssage(" What goes here to make it hide? ")
Then in V2 whn I switch back to V1 I do again:
C1->SendMessage(" Come back into view - unhide..what command is this ? ")
I guess is there something like WM_HIDE or something? and WM_UNHIDE?
Appreciate your help,
ns
|
|
|
|
|
ns wrote:
BasicallY i switchview fromn V1. So when I am doing this I sjphoulshave V1 send message to c1 and c2 right?
I have thought about a user defined message (look for RegisterWindowMessage in MSDN, or some WM_APP+const ) that are handled by the Dialogs by hiding/showing themselves using MoveWindow() .
But you are right, maybe sending WM_SIZE is enough?
LRESULT result = pC1->SendMessage(WM_SIZE, (WPARAM)SIZE_MINIMIZED, (LPARAM)0);
But somehow I doubt it.
Maybe you have to search MSDN and/or Codeproject to find an examle for hiding a dialog from the outside.
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
Guess that will handle it
WM_SHOWWINDOW
"The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown.
WM_SHOWWINDOW
fShow = (BOOL) wParam; // show/hide flag
fnStatus = (int) lParam; // status flag
Parameters
fShow
Value of wParam. Specifies whether a window is being shown. It is TRUE if the window is being shown or FALSE if the window is being hidden. "
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I am under the impression that neither WM_SIZE nor WM_SHOWINDOW are actually showing or hinding the window. Instead, they notify the window (its WindowProc) that it is about to be shown or hidden.
I think calling CWnd::ShowWindow() would be the way to go: It does not need more than SendMessage() needs (a pointer to the window class), but is much less work.
This would then probably result in WM_SIZE and/or WM_SHOWWINDOW sent to the window.
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
Hi,
I'm currently developping an activex in one session of visual c++ and so I often add some new methods, events, properties.
I build an exe project (to test it )in an other session (project) where I use the activex, and then use a Wrapper class to manage to access the activex methods...
I don't know how to upgrade the version of activex wrapper (add new added method in activex) to have the recent wrapper class version to be able to access new methods when I had some ni the activex project.
can anyone help me ?
Thank you so.
VinZ
|
|
|
|
|
Describe the wrapper. What is wrong with "#import", why do you need your own?
|
|
|
|
|
Currently, I use the visual context to "insert" an acitvex control in my project, in class wizard visual build automatically the wrapper that make me have access to the methods and properties of my activex, without need to insert it as a part of the project.
when I had new methods and properties in the activex (other project) I don't, the wrapper in the project that uses the activex doesn't include new methods and properties...and so I have to suppress it and recreate....
Thanks for your help.
VinZ
|
|
|
|
|
VinZ wrote:
Currently, I use the visual context to "insert" an acitvex control in my project, in class wizard visual build automatically the wrapper that make me have access to the methods and properties of my activex, without need to insert it as a part of the project.
when I had new methods and properties in the activex (other project) I don't, the wrapper in the project that uses the activex doesn't include new methods and properties...and so I have to suppress it and recreate....
The easiest way that I have found to upgrade the MS generated wrappers is to create a throw-away MFC application EXE project and insert the ActiveX control as you described. Then take the new generated wrapper cpp/h files from the throw-away project directory and copy them into your development project replacing the previous version of the files. You then have access to the new methods, events, etc. without dropping all references and re-inserting.
The bad thing is that you have to create a new throw-away project each time a new version of the ActiveX component that contains new methods, events, etc. is created or released. However, this technique is much faster than suppressing and recreating.
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
Thanks, I going to do that, it seems to be the best time saving solution to find.
Bye.
VinZ
|
|
|
|
|
dynamically use ActiveX/COM will not cause your case.
"dynamically" means 2 ideas:
1. use #import, but u have to re-compile if need upgrad.
2. use LoadLibraryEx with Invoke method, u even don't need to re-compile ur exe to upgrad.
but, in both cases, use COM is better, do not use ActiveX.
ActiveX is not really "very standard" as COM is.
idea 2 needs much more knowleges than idea 1.
if insist using wrapper classes, delete all of them if need upgrad, new classes will be re-generated when add the control.
includeh10
|
|
|
|
|
Thank you for those lighting advises...
But a question: maybe it is more difficult to build a com project than an activeX one, I mean in time and volume of code to produce ?
I don't have a lot of time to supply a prototype of the implementation of my project, even if I agree with you concerning the better quality of a com project.
Thanks for all.
VinZ
|
|
|
|
|
in ur case, the COM (full control) is just a little bit harder than ACtiveX - it is worth to spend few hrs to learn.
but dynamical methods are quite trick: microsoft calls them "language indepandent", actually just can be used in VB and C++ (much more trick if in java).
once our lovely C++ downs toword VB, it becomes worse, that is why advanced c++ programmers don't like COM at all even they have to use and may be experts on COM.
includeh10
|
|
|
|
|
???
|
|
|
|
|
I realy thank you for advises. and so I don't know if for my actual project (it's a shame) I will use the com techno, but maybe sooner in an other project for which I will get some more time to do.
I have, if you have time to answer me, a little more question. What do you think about .net services (web services) compared to the com techno to allow access to several resources through the network ?
VinZ
|
|
|
|
|
Hi,
I have developed a dialog based application under W2k using Visual C++ 6.0 to print a table. In W2k and Windows XP professional works well, but it doesn't work in W9x & WMe. I'm using MM_ISOTROPIC map mode because I need to print some graphics. In W9x and WMe, when I print, I haven't obtain any results. I thought, "I'm doing something wrong", so I generate a SDI with Print Preview option and I wrote inside OnDraw(...):
....
pDC->SetMapMode(MM_ISOTROPIC);
pDC->Rectangle(100,-100,300,-300);
then I executed the program, I choose Print Preview from File menu. The Print Preview showed me a sheet with a rectangle. I printed this and i obtained the same results. Everything its Ok under W2k and WXP, but in W9x and WMe it's a disaster.
Can somebody help me!!!!!
Thanks.
Daniel Remedi
ARGENTINA
dremedi@hotmail.com
or
dremedi@cheeseinteractive.com.ar
|
|
|
|
|
What does your print code look like?
Where is your:
cdc.StartDoc(pinfo);
cdc.StartPage();
...
cdc.EndPage();
cdc.EndDoc();
Are you attaching your DC properly? Are you rendering correctly?
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Could someone please help! I dont seem to be able to find anywhere that explains how to use callback functions with in MFC.
Being an MFC novice I'm a bit stuck. I get the idea behind it, but I dont understand how to code it. How are static functions used in callbacks?
Would appreciate some idiot-proof help from someone who understands it all.
Thanks,
|
|
|
|
|
How are static functions used in callbacks?
whole process of MFC is exactly as Win32 story.
key part to develop a lib as MFC is not "How are static functions used in callbacks", but how are classes connected to a cllback function (it is not a class member even it can be static function of a class).
view Windows' creation if interested - pass class pointer as parameter, otherwise just use MFC as it is - callbacks are hidden behind somewhere.
includeh10
|
|
|
|