|
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
|
|
|
|
|
mmm ok... *is scared now*
Kuniva
--------------------------------------------
|
|
|
|
|
Sorry to scare you off.
I only tried to explain that this isn't an area where you just slap something together and all works just fine.
Though, I should have mentioned that not everything about SSL is hard.
For example, writing a SSL-client using blocking calls and no clientside authentication is pretty easy.
Start off by going through the example that comes with SSL (try to ignore the IMHO bad coding style )
and remember that they are taking some shortcuts that may not be approperiate for your application.
God luck!
"was wir auch tun, wohin wir gehen|die illuminaten sind im system|sie kontrollieren überall|und 23 ist ihre zahl!"
23, welle: erdball
|
|
|
|
|
ah! Faith again! lol
Thanks for the suggestions, i'll be sure to try it. But one more question, Is there perhaps something useful to learn before starting this, like something that would help me a lot understanding this. Or is it unnecessary? I know my way pretty well around sockets now so that shouldn't be a problem, but i was wondering maybe there's another field of importance, like for example encryption? I'm not sure but i just maybe thought that could be of some importance.
Anyways, thanks heaps
Kuniva
--------------------------------------------
|
|
|
|
|
Yes, some knowledge about encryption is a good start. Note that the thing you want to study isn't HOW the different encryption-algorithms work internally but what they require to function.
For example you need to understand what a certificate is, what a certficate-chain is, the role of a CA and the significance of its certficate.
Then learn about how SSL establishes the encrypted connection and how different settings affect how you need to initialize SSL.
Since I dealt with the subject it seems that the selection of books on the topic has expanded some:
http://www.rtfm.com/sslbook/[^]
http://www.wiley.com/legacy/compbooks/catalog/38354-6.htm[^]
And a short tutorial (haven't read it through so it might be crap...)
http://www.darkspell.com/gadgets/ssl/[^]
"was wir auch tun, wohin wir gehen|die illuminaten sind im system|sie kontrollieren überall|und 23 ist ihre zahl!"
23, welle: erdball
|
|
|
|
|
I need a simple example of overloading bitwise AND operator.
Atleast the signature to overload the bitwise AND operator.
Thanks in Advance.
|
|
|
|