|
Hi,
I wrote a screensaver for WinNT. In the Dialog, where you can make the difference settings, there should be a
CFileDialog where you could select the files that are showed. But CFileDialog asserts. I know that I shouldn't
use MFC in this case and I should use GetOpenFileName. Can someone give me a sample code who to
use that method when you want that the FileDialog can select more than one file and how to get all selected names?
Thanx,
Grit
|
|
|
|
|
Hi,
I have a tree control that fills the entire client area of a dialog box. I want to catch the left mouse button
being pressed in the tree. The problem is, I can't catch WM_LBUTTONDOWN because the tree fills the whole dialog.
So, when the user presses the left mouse button he is not pressing it in the dialog, he is pressing it
in the tree. As a result, I am trying to make use of PreTranslateMessage. What I was wondering
was how do I detect when the the user has pressed the left mouse button while holding down
the shift key in PreTranslateMessage(MSG* pMsg)? Also, is there an easier way to do this?
Thanks Mike
|
|
|
|
|
You get an NM_CLICK notification when the user clicks in the tree. As for the keyboard, call GetKeyState(VK_SHIFT) to tell if Shift is pressed.
|
|
|
|
|
|
Hi,
I have a tree control that fills the entire client area of a dialog box. I want to catch the left mouse button
being pressed in the tree. The problem is, I can't catch WM_LBUTTONDOWN because the tree fills the whole dialog.
dialog. So, I am trying to make use of PreTranslateMessage. What I was wondering was how do I detect when
the the user has pressed the left mouse button while holding down the shift key in PreTranslateMessage(MSG* pMsg)?
Also, is there an easier way to do this?
Thanks Mike
|
|
|
|
|
Anyone know of one or two GOOD books on programming MFC for WindowsCE (versions 2 and/or 3)? I have
the WinCE toolkits installed with MS VC6. There seems to be quite a few differences between MFC on a PC and WinCE.
I've checked amazon.com, but there doesn't appear to be any books worthwhile buying. Lots of stuff on
non-MFC programming though.
|
|
|
|
|
I've never found any book talking of WinCE and MFC. But anyways, MSDN documentation was enough for me even if there was a couple of difference.
Frank
|
|
|
|
|
This may seem like a wierd thing to do, but I am trying to startup a dialog based application with the main window not visiable.
I have tried setting the dialog's visibility to false, calling ShowWindow (SW_HIDE) in the OnInitDialog (), but nothing seems to hide the window. I even tried to override the OnShow function to keep the dialog from displaying, but no luck.
ShowWindow (SW_HIDE) works fine after the initial display, but I am looking for my app to come up in silent mode. Any help will be greatly appreciated.
Jennifer Glover
|
|
|
|
|
This seems to be a common dilemma for which I don't have a clear explanation. It seems like Windows does not allow you to create a modal dialog that's initially hidden. I guess the reason is: why would you ever want to? The whole purpose behind making the dialog modal is to show it and have the user interact with it. I guess the Windows designers figured, "If it's hidden, then how can the user interact with it?". So they always force modal dialog boxes to be shown.
So how do we solve your problem? Simple: make your dialog modeless. Remove the modal dialog creation code in your Project.cpp file and instead write this:
static CMyDlg s_dlg;
if (!s_dlg.Create(CMyDlg::IDD))
return FALSE;
m_pMainWnd = &s_dlg;
return TRUE;
If you uncheck the dialog resource's "Visible" flag, you won't see the dialog box until you call ShowWindow(SW_SHOW). Also, keep in mind that you'll need to call DestroyWindow to properly destroy the dialog box (and thus end the application).
Regards,
Alvaro
|
|
|
|
|
Alvaro's advice sounds good to me. If you are interested, I have written some notes about modeless dialogs.
See: http://home.socal.rr.com/samhobbs/VC/ModelessDialogs.html
Something else to play around with though is the WM_WINDOWPOSCHANGED message. Try overriding it for your dialog, so that you will have an OnWindowPosChanged function for your dialog. The last message that I have been able to detect and recognize as being the last one sent to a dialog before it is shown is a WM_WINDOWPOSCHANGED message with the SWP_SHOWWINDOW flag set in the WINDOWPOS structure. It sure sounds like something you could use, but I am not sure of the details.
|
|
|
|
|
Im working on a little graphics app and Im adding Zoom
capabilities which of course requires a magnifying glass>>
Can someone tell me whats involved ....or where I might find
an example of this....
Thanks a lot.
|
|
|
|
|
The SetCursor() API does this.
|
|
|
|
|
Hi,
I think te title say it all?
Thanks,
James
|
|
|
|
|
hi,
can some please show me/refer me to code on how to use the select function (Winsock api) .......
please i really need help here........
tnx a lot
yaron
|
|
|
|
|
Guys,
www.mindcracker.com is a new developers web site. You are most welcome to contribute and post your articles.
Thanks
|
|
|
|
|
Guys,
www.mindcracker.com is a new developers web site. You are most welcome to contribute and post your articles.
Thanks
|
|
|
|
|
Does any one know how to toggle between document templates
with a toolbar button or menu item? I what to go between a
single view and splitter view without having to do file /new
then picking from the list.
Please Help!
Any suggestion will be greatly appreicated
Thanks
|
|
|
|
|
HI,
I used CHtmlView to make a custom browser..
It works well..not powerful but basic functions and methods are enough..
One Problem..
I made OnScreen Keyboard..
But I can't route keyboard message to edit box that dynamically created in IE COM..
When clinking the Onscreen Keyboard, the input focus is moved to button of keyboard..
Worse it is when there are lots of edit boxes in Web page..
How can I route the keyboard message correctly?
OR
How can I get the handle of edit box in IE COM that has focus?
Thank you in advance!!!
-Ray
|
|
|
|
|
Hello!
I' m connecting Visual Fox Pro database with my VC program through ODBC.
When i open the recordset i get the error message "ODBC does not support dynasets".
If select Snapshot, it works fine.
I looked at MSDN: "PRB: Visual C++ 1.5 ODBC Drivers Don't Support Dynasets", but 'm not getting the right way.
Would u plz tell me how i can solve this problem.
Thanx
Hassan
|
|
|
|
|
Just an idea:
Are you using Cursors ? I think the cursor-library is necessary for snapshots, but dynasets don´t like it. So if you want to use dynasets, disable the cursor-librabry...
|
|
|
|
|
Hi all,
I'm new to WinSock. Please, if anyone know where I can find source code of how to use WSAAsyncGetHostByAddr() in an VC++/MFC application send me a mail.
I found an example of using WSAAsyncGetHostByAddr() in C/SDK app. but I have an VC++/MFC app. and I wish to update it with WSAAsyncGetHostByAddr().
Thank you,
Mileta.
|
|
|
|
|
Hi,
I hope is usefull to you:
Add this lines bellow in your InitInstance method of your application and you can use any WSA.. function .
WSADATA wsa;
WSAStartup(0x0101, &wsa);
in ExitInstance():
WSACleanup();
and
#include <winsock.h> in your stdafx.h file
also you must link your application with
wsock32.lib
It doesn't matter if your application is build with or without MFC
Best Regards,
/REMUS
|
|
|
|
|
Hello,
I'm using the CImageList ATL helper classes defined in the "ATLControls.h" file. When I try to build my project
I have link error.
here is the code where I'm using the CImageList object:
/////////////////////////////////////////////////////////////////////////////
//
LRESULT CParametersDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
USES_CONVERSION;
//Initialize the editText name control.
CWindow wndName(GetDlgItem(IDC_ELEMENT_NAME));
wndName.SetWindowText(OLE2T(m_controlName.m_str));
//Initialize the comboxe color control
RECT rect= { 90, 130, 280, 210 };
m_comboBoxEx.Create(this->m_hWnd, rect, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER |
WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST);
m_comboBoxEx.SetExtendedUI();
COMBOBOXEXITEM cbei;
cbei.mask = CBEIF_TEXT | CBEIF_INDENT | CBEIF_IMAGE | CBEIF_SELECTEDIMAGE;
int sizeOfItem = sizeof( Gobal_ItemInfoArray ) / sizeof( Gobal_ItemInfoArray[0] );
for( int index = 0; index < sizeOfItem; index++ )
{
CComboBoxExColor& comboInfo = Gobal_ItemInfoArray[index];
cbei.iItem = index;
cbei.pszText = comboInfo.m_przText;
cbei.cchTextMax = sizeof(comboInfo.m_przText);
cbei.iImage = comboInfo.m_iImage;
cbei.iSelectedImage = comboInfo.m_iSelected;
cbei.iIndent = comboInfo.m_iIdent;
m_comboBoxEx.InsertItem(&cbei);
}
CImageList imageList;
imageList.Create( IDB_ORUS_COLOR_BITMAP, 16, 1, ILC_COLOR);
m_comboBoxEx.SetImageList( imageList.m_hImageList );
return 1; // Let the system set the focus
}
/////////////////////////////////////////////////////////////////////
hereis the link error message that I received:
Linking...
Creating library Debug/OrusControlsServer.lib and object Debug/OrusControlsServer.exp
ParametersDlg.obj : error LNK2001: unresolved external symbol __imp__ImageList_LoadImageA@28
Debug/OrusControlsServer.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
/////////////////////////////////////////////////////////////////////
As you can see I'm using an ATL CComboBoxEx object and there is no problem with that. Do anyone have any
idea of what going one.
Thanks for your help, Alain-Serge.
|
|
|
|
|
Are you linking with comctl32.lib?
|
|
|
|
|
I have mvc++ 6.0. I have a SDI CDialog. I click on the date time picker icon and presto, I have a date time picker. I then go to class wizard and add the member variable m_datetime to IDC_DATETIMEPICKER and I change it from 'type' to 'control' so that I have declared in my header file
CDateTimeCtrl m_datetime;
When I compile the program, I get the error:
'CDateTimeCtrl' missing storage class or type specifiers
and it's referring to line that I have declared CDateTimeCtrl. I don't understand what I am doing wrong. It is my understanding the msvc++ 6.0 has the header file CDateTimeCtrl. So why do I need to enter it?
Please, any response any one can give me will be greatly appreciated.
Sincerely,
Danielle
|
|
|
|