|
How can I make a font combo box like the one in MS Office 2000.
|
|
|
|
|
I want to use a couple of child windows in my SDI application (with caption, min and max boxes, etc...(eg. WS_OVERLAPPEDWINDOW). They are children of CMyView. When I create them in response to CMyView's WM_CREATE, the children are not shown. But when I regster a class for my children, the are shown. Why is like that?
But the real problem is that those windows don't have a focus (even when a caption bar is clicked they still have inactive caption!!). Pressing a key generates WM_KEYDOWN for CMyView not for the child window.
Another problem: If I create a button in the child window and click it, the button has focus all the time, even when other child window are clicked, or main window, or menu. I cannot find any example of how to create child windows in a main window. I have over 40 books on VC++ but none of those explain this.
Thank you any suggestions
(The same problem occurs when children are created in SDI without Doc/View support).
Jerzy
|
|
|
|
|
I'm probably missing something, but it seems like you should be creating an MDI application, not an SDI, if you want to open multiple child views. I'd imagine that the reason none of your books describe multiple windows in SDI is that, by definition, this isn't done.
Jake
|
|
|
|
|
Thank you for your answer, but with MDI I will have the same problem (I mean if I create those windows in a view). Those multiple children are not views for documents. They are windows where I get some input from the user.
Let me explain what I'm doing. I'm writing a sequencer as SDI app. User will be recording a song using a midi instrument or computer keyboard. Then he can edit recorded events in some windows like: Track window, Event window, Volume window, et...
I cannot use my view as a container for all those windows.
Probably the only way would be to use MDI and create diffrent views for the same document (MDI can be used to create multiple documents at the same time or multiple views for the same document). But could I use SDI and create multiple views for the single document?
Thanks,
Jerzy
|
|
|
|
|
You could try using a CSplitterWnd...
Jon Sagara
"Left-handed nunchakus!"
|
|
|
|
|
How about docking windows? Your users probably wont need all of the windows showing a once, so you could easily hide them.
If you do go with your original window idea, I'd say do it with in a MDI style, it will be less confusing for your users.
Ben Burnett
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Docking windows are OK but they won't have a focus. MDI solution would require creating differnt templates for each view. Then when you create a new document framework would think a I have more than one document type and popup a dialog box with the list of types. 'Output Window' would show "Warning, Dialog creation failed". Beside this I want to have simple SDI application.
I've seen hundreds of SDI application where user could open from menu some windows. In some applications those windows are children of desktop in other they are children of the main window.
Jerzy
|
|
|
|
|
>>>
MDI solution would require creating different templates for each view. Then when you create a new document framework would think a I have more than one document type and popup a dialog box with the list of types.
<<<
There is no need to create multiple templates for your purpose. You can actually use a document that is common to all the views, all you need to do is have a 'main' view (the one that gets used in the document template) and add extra views to the document from within it. This way you get full control in the main view, and have proper focus handling for all the windows.
I can send you a small demo, if you’re interested.
>>>
Beside this I want to have simple SDI application.
<<<
Fair enough.
>>>
I've seen hundreds of SDI application where user could open from menu some windows. In some applications those windows are children of desktop in other they are children of the main window.
<<<
Yea I've seen some, aren’t they all mostly 'docking' windows that have had there docking ability disabled?
Ben Burnett
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Thanks for you patience. Can you please be so kind to send me this project, I would appreciate it very much.
Thank you,
Jerzy
My address: jerzypeter@hotmail.com
|
|
|
|
|
Is there an option to tell the linker to look for functions in all libraries in the library path. It is a pain to have to specify each library I want to use when there are over 100.
|
|
|
|
|
Not that I'm aware of.
Its generally straightforward to sort out. Don't worry about
trying to guess which libs you need. After a while you'll learn
which libs you need. But if you don't know which libs you need
repeat the following procedure:-
1) Link as normal.
2) if no errors, then finished (duh!)
3) Look at the first link error. Identify the function name that
is not resolved. Look it up in MSDN. The entry in MSDN will tell you which lib you need (if its a COM object it may not, then you'll need to hunt around a bit).
3a) if the function name is not in MSDN check that it isn't a 3rd party lib you have forgotten to list.
4) Now relink. The reason for not worrying about the remaining errors is that many of them may be for the same lib as the first error.
5) Repeat from (3) until no errors. After a while you'll be able to realise which function come from which lib and you'll be able to do more functions/libs in stage 3 than I've suggested above.
None of that was rocket science, and it isn't really that hard.
Cheers
Stephen
Stephen Kellett
--
C++/Java/Win NT/Unix variants
Memory leaks/corruptions/performance/system problems. UK based.
Problems with RSI/WRULD? Contact me for advice.
|
|
|
|
|
Hi,
Is there a way to change CpropertyPageEx's
title and sub title in run time? also how
to remove the help button in the page?
thanks
|
|
|
|
|
I am currently in the process of working out how to convert our source code so that it compiles using Visual C++ instead of the Borland command line tools. With the Borland command line tools there are the global variables _argc and _argv which contain the command line string split up into sections. These variables do not seem to be available in Visual C++. Can anybody give any suggestions on how to get around this problem. Is it best to setup an array of pointers back to the original command line string or is there a better way?
Thanks for any information you can provide.
Steve.
|
|
|
|
|
try __argv and __argc
there are 2 underscores, not 1
|
|
|
|
|
|
I have forgotten something stupid, mainly cause Id never do it.. two variables declared with same name but different scope
int something
{
int something
if refer to something here, which one used?
}
This will compile, won't it..?
Many, many thanks.
|
|
|
|
|
int something
{
int something
//This one will be used here
::something
//Refers to the other
}
|
|
|
|
|
Yes, but don't forget the :: op with no namespace spec looks for vars in the global namespace - vars can be hidden if declared at an intermediate scope:
int main(int argc, char* argv[])
{
int something(2);
{
int something(3);
cout << something << ::something << endl;
}
return 0;
}
This code won't compile until you uncomment the global decl for something .
The fn scope something is effectively hidden from code inside the local block.
|
|
|
|
|
I have created a dlg application. I have MyappDlg.cpp and .h module and Myapp.cpp and.h module. In the dlg part i just have the declarations and definitions of members and methods as button, editbox..., in the other part i have all the methods which the main aim is to do some calculations. So, as you could think i want to link the dlg part to the calculation part. So, in the dlg.h i just put the line:#include "MyApp.h"
So, i don't know if it's enough for doing the calculation in the dlg box. Is anybody could explain me the way of doing this job?
thanks in advance
gerald
|
|
|
|
|
If you have a dialog that needs to perform some specific calculations, it would make sense to include those functions in the dialog class. I don't know of any reason to keep them in the App class, but if so, then the line of code to #include the App class is generated for every cpp file by the class wizard automatically. To call its functions you would need to use AfxGetApp() for a pointer to the application object. hope that helps,
Jake
|
|
|
|
|
Can anyone give me some suggestions on how to replace window standard dialog view to an image.
thanks
nott
|
|
|
|
|
Override OnEraseBackground and draw your image.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
When I open a Dao recordset with more than one table ([MyTableOne] and [MyTableTwo], for example), the dataset is set read only and I can't update any records. I can't seem to find the answer to this one. All help appreciated!
Richard
|
|
|
|
|
I think the way the tables are joined and whether the db maintains referential integrity can have an impact on whether a join is updateable.
I know thats not a whole lotta help, but I do seem to recall from the dark and distant past that I was able to write to certain types of recordsets that were based on multiple tables.
Maybe MSDN article ID: Q175168 can give you some ideas.
|
|
|
|
|
Is true, When you open more than one table, the tables are read-Only This is for integrity.
You need to Write First one, and then the other one.
You Have FK for Integrity?
Because is Important, to poen in a order for the FK, because the database can refuse the insert....
Cheers!!!!
Carlos Antollini.
|
|
|
|