|
Hi PJ,
Do you know what message is being sent to your listbox to get it to close and who is sending it? Spy++ might help. I wonder whether you could kludge the combo style and switch it between simple and dropdown on the fly!
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
The list box recieves WM_SHOWWINDOW, WM_WINDOWPOSCHANGING and WM_WINDOWPOSCHANGED messages. I do not know who is sending them, but I assume it is the combo box control. I tried overriding these messages, no luck I tried to hook these messages using WH_GETMESSAGE and WH_CALLWNDPROC hooks, also no luck I am beginning to think that the only way this will be possible is by rewriting the entire combo box control, not something I want to do.
I think what I will have to do instead is modify the combo's edit control's context menu.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
I still don't understand precisely what is causing your list cntrl to close. Is it being destroyed, sent a WM_CLOSE or ... Do you have an OnDestroy() or OnClose() and are these being called. Or who is calling the dtor (looking at stack trace).
Why did you have to use your own list box in the first place. Was it because the right click -> popupmenu closed the drop down list.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
From what I have been able to figure out, the drop list is not actually closed or destroyed, it is just hidden (in spy++ its HWND stays active, even though it is not visible). I have to use my own list control, because the drop list of the combo box (class COMBOLBOX) does not generate a WM_RBUTTONDOWN or a WM_CONTEXTMENU message when I right click on it (The edit control portion of the combo control does however). The problem I am having now is that when I handle the WM_CONTEXTMENU message in my own subclassed list control, I pop up a popupmenu and the list disappears. It is all rather annoying.
I know I am being as clear as mud, but thanks for the help anyway
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote:
From what I have been able to figure out, the drop list is not actually closed or destroyed, it is just hidden (in spy++ its HWND stays active, even though it is not visible).
Aha. What Styles does Spy++ say it has when it is hidden. Is WS_VISIBLE set? Maybe it is be placed behind the app. From memory either the edit or list portion of a combo has the desktop as its parent.
PJ Arends wrote:
I have to use my own list control, because the drop list of the combo box (class COMBOLBOX) does not generate a WM_RBUTTONDOWN or a WM_CONTEXTMENU message when I right click on it (The edit control portion of the combo control does however).
What about reverting to the standard combo box and doing a hit test when you get the WM_CONTEXTMENU in the edit control and if it is over the list ctrl do your menu thing.
PJ Arends wrote:
The problem I am having now is that when I handle the WM_CONTEXTMENU message in my own subclassed list control, I pop up a popupmenu and the list disappears. It is all rather annoying.
Can you do a ShowWindow(), BringWindowToTop() on the list ctrl from your popup menu?
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Hi,
first, excuse me for my english ...
I've created a SDI application based on CHtmlView. And I'd like to know when a file (.exe,.zip,etc...) will be downloaded, so I'll be able to open this file without asking the user to choose between open it or save it.
What I'd like to have is the method FileDownload() from the simple DWebBrowserEvents2 composant in my CHtmlView.
I'm quite a beginner in MFC, so I don't really understand all the stuff with the ActiveX (invokehelper, dispatch, etc ...) and I don't manage to do it by myself .
thx for your help.
|
|
|
|
|
I'll try to explain what I want in a better way :
I want to know if an url is diplayable or downloadable. So I'll be able to download automatically all downloads to a same path.
Anybody ?
|
|
|
|
|
I have MDI app and I need to get combo box pointer from toolbar.
I tried PreCreateWindow and OnCreate with no success - assertions in mfc core fails.
I solved this problem by calling GetDlgItem in button message handler, but I think there should be more smart way to do that.
|
|
|
|
|
[edit]Got the function prototype wrong /edit]
The combo box is a child of the toolbar, not of the frame window. You don't call GetDlgItem() in CMainFrame, but in your toolbar (or dialog bar).
int CMainFrame::OnCreate(LPCREATESTRUCT lpcs)
{
if(CMDIFrameWnd::OnCreate(lpcs) == -1)
return -1;
CWnd *pComboWnd = m_ToolBarWithComboBoxOn.GetDlgItem(IDC_COMBO_BOX);
return 0;
}
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Yes I know that, but my first post wasn't clear enough.
Actually I need to get pointer to class object of class delivered from CComboBox.
[code]
// CDialogBar m_wndSearchBar;
// create m_wndSearchBar and pass to ReBar::AddBar ...
CHistoryCombo *m_pcomboSearchQuery = (CHistoryCombo *)m_wndSearchBar.GetDlgItem(IDC_COMBO_SEARCH_QUERY);
m_pcomboSearchQuery->LoadHistory("Settings", "SearchQueryHistory");
[/code]
The ChistoryCombo class is derived from CComboBox class.
The last string cause assertion in CString code.
So I think I acually get CComboBox pointer not CHistoryCombo.
Is there any way to get a CHistoryCombo pointer?
I know that I can constuct CHistoryCombo directly and then pass to CReBar::AddBar()
but is I think to build all toolbars from dialog resources is more good code style.
|
|
|
|
|
kydfru wrote:
So I think I acually get CComboBox pointer not CHistoryCombo
That's correct, unless you have created it as a CHistoryCombo...
Have you used ClassWizard to bind the IDC_COMBO_SEARCH_QUERY to a control member variable? If you bind it as a CComboBox, and then change the definition to a CHistoryComboBox instead of CComboBox, then you can use this CHistoryCombo variable as you need.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Is it suitable in CMainFrame?
I see that all ClassWizard can do is to generate some strings for DDX support.
So I write:
[code]
void CMainFrame::DoDataExchange(CDataExchange* pDX)
{
CMDIFrameWnd::DoDataExchange(pDX);
DDX_Control(pDX, IDC_COMBO_SEARCH_QUERY, m_comboTest);
}
[/code]
And when I call m_comboTest.GetWindowText(str) I get assertion of ASSERT(::IsWindow(m_hWnd));
So I think DDX is not working in CMainFrame and I need to construct custom class for toolbar dialog resource.
|
|
|
|
|
kydfru wrote:
Is it suitable in CMainFrame?
No. The combo box is a child of your dialog bar. It has to be done in your dialog bar class.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hiya I have a buffer and starting from position 12, I need to extract the next 6 chars for display. Need to do it in c++.
How do I do this??
Thanks.
|
|
|
|
|
char *buf = "12345678901234567890";<br />
char szNext6Chars[7];<br />
strncpy(szNext6Chars, buf + 12, 6);
|
|
|
|
|
One solution is strcpy. Another solution is memcpy(). Pass in a pointer to the string that points to the the first character to be copied, which in this is at position 12.
Kuphryn
|
|
|
|
|
|
Hi,
We created a Trial.txt & a Trial.mdb (using FTP to transfer) and put them on our Web-Page (\database\Trial.mdb ). We are able to use VC++ 6.0 to link to our Web Page & read the Trial.txt by the following codes:
<br />
pConnect = pInetSession->GetFtpConnection (strServerName, "xxxxxxxx", "pppppppp", nPort, FALSE);<br />
<br />
pFile = pConnect->OpenFile ("Database/Trial.txt",.......);<br />
<br />
pFile->Read (str, 100 ,...)<br />
*) The problem is: I do not know what command to open & read the Trial.mdb ... does anyone show me how to do it?
It is urgent, I am really appreciate a lot any help here!
Many thanks,
Anh
|
|
|
|
|
ATC wrote:
does anyone show me how to do it?
Sure, you can use ADO to connect to the database and return a recordset. Check the ADO[^] section of articles.
-Nick Parker
|
|
|
|
|
Hi Nick,
I did follow your ADO articles, but there are so many of them and I still have not found out which one link to Web-page, .mdb file using by VC++6.0?
By any chance you can specify which one?
I am really appreciate your help and I meant it!
Many thanks
ATC
|
|
|
|
|
At the end of the day, how do you expect the web page to read the Access database ? Do you know anything about ASP or ASP.NET ? If not, then you're totally in the dark, and you've got a decent learning curve ahead of you. Your web server needs to be running IIS ( i.e. not just a directory of html files on your ISP provided web space ), and you need to write code to read the database, and asp or aspx pages to use that code and turn the result into HTML.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
Hi Christian,
1) Might be you did not understand my request (or I wrote not clear enough), I do not mention about: the web page to read the Access database! Instead, I mentioned that: how my VC++ 6.0 can read the .mdb file on the Web page (at same Web-page location)
*) The reason was: I know (but not very good) how to use ASP to open the same .mdb file as I mentioned earlier! In fact, I already had an ASP application on the Web using ASP and it is able to open & access data from that .mdb file!
2) However, at the Client site (my personal PC) I have a VC++ 6.0 MFC application using very heavy programming!
*) It has one small option ---> requiring to get the information from the Web user in the same .mdb file who is using my Web-application ASP proram on the Web
- And I do not know: how to link to that .mdb by using only VC++ codes at the Client site
I hope that you understand my issue.
Thanks
ATC
|
|
|
|
|
In other words, your web application is moot, it is irrelevant. You want to connect to a remote database using an MFC app, in other words you need to write code to connect two applications over the web, to send requests and return the data. I'm sure you'll find that info here on the site, or in the MSDN.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
Hi, can anyone tell me where i might find and example/tutorial on how to establish an SSL connection with a server (not a web server, just in general..). I already know about OpenSSL but to be honest, i don't understand it, lol. So I'm talking something basic, hands on..
Thanks!
Kuniva
--------------------------------------------
|
|
|
|
|
The examples that come with OpenSSL are as basic as it gets (I would even say that they are probably too basic).
Note that SSL communications can be really tricky and you really need to understand what is happening.
Trust me on this one.
"was wir auch tun, wohin wir gehen
die illuminaten sind im system
sie kontrollieren überall
und 23 ist ihre zahl!"
23, welle: erdball
|
|
|
|