|
i have an SDI app with two views. i want all print actions to go to one view and not the other (one is a file explorer and the other is a file preview - i only want to print the preview). how do i do this?
i've tried re-routing the ID_PRINT* messages from the no-print CView to the doc, setting the active view, the posting the message to the main window (AfxGetMainWnd), the yes-print view, the frame wnd, etc.. no luck.
there must be a way to do this...
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Disclaimer: I'm in the middle of very long compile - can't really test this, so treat the solution with care
On a frame window level, override the OnCmdMsg virtual function. Implementation should check for ID_PRINT* messages and forward them directly to 'printing' view by calling its OnCmdMsg. Otherwise, call CFrameWnd::OnCmdMsg.
You can't play with OnCmdMsg on document level - this will cause recursion, stack overflow and crash.
Hope this helps
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
I am creating an text editor application for a Windows CE device HPC Jornada handheld. I already have the main toolbar at the top of the dialog but I want to add an aditional toolbar at the bottom. I have created the toolbar using MFC and include all the buttons in the class wizard. I cannot get the toolbar to display though - any ideas/help would be greatly appreciated.
Claire
|
|
|
|
|
Maybe, if you post some of the code you use to create the toolbar...
I don't know with MFC, but if you use plain API calls, the toolbar works quite different on CE and Win32...
BTW, isn't it a CommandBar you are using???
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Can anyone tell me how to disable the maximize/minimizebox and the ability to resize from a CFormview object? In other words make the formview look like a regular dialog. I tried to set the settings in my resource to fixed size but the formview still allows me to resize...
|
|
|
|
|
Your should override CChildFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) method. Within this method
set the lpMMI->ptMaxTrackSize and lpMMI->ptMaxTrackSize to size your want your form to be.
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
Can't I disable or hide the minimize or maximize boxes ??? I tried to remove it from the style in the PreCreateWindow method, but they still appear...
|
|
|
|
|
Try it again
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style &= ~(WS_MINIMIZEBOX | WS_MAXIMIZEBOX);
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
The code above works - the frame window appeared without MAXIMIZE & MINIMIZE buttons.
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
Indeed you're right I think I was mixing things together with too much trial and error
Thanks
|
|
|
|
|
Are there any way to change the commended lines colour? Thanks
|
|
|
|
|
Sure !
Check it here : Tools Menu ->Options-> Format(Page)->Colors->Comment.
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
How can I make fucntion pointers to member functions of a class??? The function pointer is ALSO a member of the same class, but I get this error:
//header file
void (*funcPtr1) ();
void chooseCharacter();
//cpp
funcPtr1 = chooseCharacter;
the error:
error C2440: '=' : cannot convert from 'void (__thiscall StoryLine::*)(void)' to 'void (__cdecl *)(void)'
please it's urgent!!!
|
|
|
|
|
funcPtr1 = &StoryLine::chooseCharacter;
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Sorry for the first post - it's incomplete.
You should to change declaration of funcPtr1 as well to indicate that you need pointer to member:
void (StoryLine::*funcPtr1) ();
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
hi all,
how can i change a control´s version number. for example increment it by one with each compilation. Right now i always get 1,0,0,1 and if i want to change a cab file - this control is not being installed on some other remote machine (since version number does not change, i guess )
I tried to change
_wVerMajor
_wVerMinor
but it did not change anything
thanks for any help
|
|
|
|
|
Maybe this is usefull... This macro auto increments the version number on each build...
http://www.codeproject.com/macro/incprivatebuild.asp
|
|
|
|
|
Any ideas on compacting and repairing a database through ADO, or SQL, or DAO etc... in VC++.
Really getting desperate now...
|
|
|
|
|
Check these KB articles:
Q230496 Compacting Microsoft Access database via OLE DB
Q230501 HOWTO: Compacting Microsoft Access Database via ADO
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi All,
I have a interesting query.I have a ATL Service.In this service I want to create a Database using DAO .This Database created need to be accessed by ADO. I was able to create the Database successfully using DAO .
I included "afxdao.h" file for this.
Now to access the Database using ADO ,I had to import
" msado15.dll ".After importing this Dll when the server is executed I am getting a error that "WINDOWS.H" is already included.When I remove this dll this error does not come but the ado objects could not be used to access the Database.
I want to use DAO and ADO both in same program.If it is possible,how can I rectify this problem ?
Thanx in advance for the help .
Regards,
yamini
Y.Yamini Devi
|
|
|
|
|
I recently start with Visual C++ and i made a new project from template "Win32 Console application" "a hello world application", now I would change the colors of the text, the cursor position and clear the screen, with other compilers I made this with "textcolor","gotoxy" and "clrscr()" respectively but with VC++ I don't know how can I do it.
Thanks
|
|
|
|
|
First, you get need handle to the console -
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
Check for INVALID_HANDLE_VALUE , but note that this handle can be 0.
A gotoxy can be written like this, using the SetConsoleCursorPosition call:
void GotoXY(SHORT x, SHORT y)
{
COORD pos;
pos.X = x;
pos.Y = y;
SetConsoleCursorPosition(hConsole, pos);
}
To change colors, check out the SetConsoleTextAttribute console API function:
SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN |
FOREGROUND_BLUE | BACKGROUND_BLUE);
Clearing the screen is explained in the MSDN article "HOWTO: Performing Clear Screen (CLS) in a Console Application".
I've noticed diffeences in how colors are handled in win9x vs NT/2000. Backgrounds may 'bleed' to the next line in win9x. Also, console apps behave a little differently when closed under the two OSs.
Search the MSDN for "Console functions". Lots of neat stuff you can do.
|
|
|
|
|
|
I enumerate the encoders registered on my computer(such as:Cinepak Codec by Radius, MJPEG Compressor,DivXMPEG-4 Fast-Motion...).Then how can I select one of them (Such as DivXFast-Motion) to compress the timeline using DirectShow filters?
Note:
These encoder have the same CLSID(CLSID_AVICo),only FccHandler and FridenlyName are different.How to select one of them?
Thanks!
|
|
|
|
|
Hello everyone !
I'm a begginer programmer in Visual C++ world.
and I would like to know if I can use the directX library with the MFC.
I think I have to use the C but I'm not sure....
Thank you.
Fx
|
|
|
|
|
You can use C++ and MFC with DirectX. CodeProject even has a section about DirectX:
http://www.codeproject.com/directx/
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|