|
I apologise for obsfucating my method by mentioning PreTranslateMessage, my actual method mentioned does not use it, it just checks to see if the escape key is pressed in OnCancel, so the button still works but the key does not. Similar to check for VK_ENTER in OnOK.
Christian
I've learned that you cannot make someone love you. All you can do is stalk them and hope they panic and give in.
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
Hello,
I have created a Dialog App and put a Active X Web browser object into the App. I'm having problems with continuously reporting the current url being visited into a edit box. If I create an event to put the info into the edit box this works fine (example: I created a button that runs the code listed below. This posts the information fine). I would like to continuously show the url being displayed. In this article listed below provided by Microsoft it says to put the code listed at the bottom of this page into the "initialization process", this doesn't seem to work. I have put the code into BOOL CBHCBrowserDlg::OnInitDialog()
Microsoft article:
If the current location is an HTML page on the World Wide Web, you can use the IWebBrowser2::get_LocationURL methods to retrieve the full path of the folder or file. If you want this information displayed continuously, add the following code to the initialization process. If you want it displayed only when an event occurs, add the code to an event handler. The following example uses IWebBrowser2::get_LocationURL to retrieve location information and display it in an edit box.
//CWebBrowser2 m_browser - to access the WebBrowser control
//CEdit m_edit - to access the edit control
CString string1;
string1 = m_browser.GetLocationName();
m_edit.SetWindowText(string1);
Any Ideas?
THANKS,
|
|
|
|
|
Hello, the codegurus around the world.;)
First of all, this is my guess.
1) IWebBrowser2 may have some Event function to let us know that now updated html display is completed something like that. So, if this exists, you put get_LocationURL.
2) Try to use Timer or Thread function to always moinitor get_LocationURL.
And if URL is updated from old one, update this URL to edit box.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
Place the code
CString string1; string1 = m_browser.GetLocationName(); m_edit.SetWindowText(string1);
in the DocumentComplete Returned Message for your WebBrowser
Regardz
Colin Davies
|
|
|
|
|
Thanks for all the help! I found a event OnDownloadComplete. Everything works great. Thanks..
Rob
|
|
|
|
|
Note:
OnDownloadComplete fires for every object on a web page
eg (jpgs or gifs etc or even frames)
OnDocumentComplete fires for the whole Page.
Regardz
Colin
|
|
|
|
|
I didn't see any OnDocumentComplete event for the Microsoft Web Browser Active X object..
Rob Jones
|
|
|
|
|
Rob
Using The Class Wizard its the 11th event down for a browser control added as a member variable, I just checked and it is there on my VC+ 6.00
Regardz
Colin
|
|
|
|
|
You are correct. I looked there like 5 times before, don't know how I missed it. Weird. Thanks for all your help. I did use that event and added the code to this event. Everything works great!
Thanks again,
Rob Jones
|
|
|
|
|
I have an MFC application that querries an ODBC responder. There is a particular set of messages which is unique to the system which are send to the server through the winsock to register and then to querry the ODBC. Once the application receives the data from the winsock control it is in a string which has to be parsed, right now I got the string separated by the "|" that's the symbol that separates these messages. Then, the information from the ODBC comes in this format, { 1 1 administrator Default {} {} 0 {}}
I am having a hard time parsing the information out of the curly braces. I was thinking of finding the position of the first "{" brace and then finding the position of the last "}" brace, and then extracting the content in between. If any of you guys have any suggestions, methods or any sample code wchich could help me out it would be great, Thanks
|
|
|
|
|
Hello, the codegurus around the world.;)
I'm not sure what is going on.
1) Did you create your own client/server program?
2) If so, server program reads some info from ODBC setting on Window NT server, server program sends this info to client.
3) Did you use CSocket class or WinSock API?
If you use CSocket class, we have a chance to have our class derived from CObject to
set the data structure to make our life easy.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
1)Yes
2)Yes
3)CAsyncSocket
|
|
|
|
|
Check out my CStringParser class (posted here on CodeProject). It supports "quoted" strings, but you're using matching braces, so you'd have to replace the '{' and '}' with a suitable character, like a double quote or maybe even a caret.
Here's how it would work:
CString sMyString = "{ 1 1 administrator Default {} {} 0 {}}";
// remove the curly brace and space characters from the beginning of the string
sMyString.Mid(2);
// remove the last curly brace from the end of the string
sMyString.Left(0, sMyString.GetLength() - 1);
// replace the braces
sMyString.Replace('{', '\"');
sMyString.Replace('}', '\"');
// now parse the string
CStringParser sParser(sMyString,' ', '\"');
You should get the following string values as a result:
sParser.GetField(0) - "1 1 administrator Default "" "" 0 """
sParser.GetField(1) - "1"
sParser.GetField(2) - "1"
sParser.GetField(3) - "administrator"
sParser.GetField(4) - "Default"
sParser.GetField(5) - ""
sParser.GetField(6) - ""
sParser.GetField(7) - "0"
sParser.GetField(5) - ""
|
|
|
|
|
Thanks John!
The CStringParser clarifies a lot and it's not verbose, on the contrary very helpfull(It's probably one of the more helpfull string parsers on the web. If you get a chance the bracketed sub-strings would be usefull to see.
|
|
|
|
|
Hi,
Can you help my, where I did mistake, when the compiler say "
error C2065: 'IDB_TABIMAGES' : undeclared identifier" , but IDB_TABIMAGES is my bitmap, which is defined in resource.h ?
LB
|
|
|
|
|
try #includeing resource.h in the cpp file that uses the resource.
Christian
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
Hi everybody.
I want to get movie window size & resizing my window but I cannot find this property or method
Iman Ghasr-e-fakhri
|
|
|
|
|
I'm trying to find some examples of code that are able to delete the contents of folders like 'C:\windows\history', 'c:\windows\temporary internet files' and or the recycle bin, as I've been told these are special folders and you need to work with them in a different way. some help would be great.
Joe
|
|
|
|
|
Hi ! I'm using EnumJobs function to retrieve current printer jobs enumeration.
It works fine, but the pDevMode member of this structure holds NULL in Windows 98. It holds proper pointer in Windows 2000. Is there any other way to discover print job information like number of copies and paper size ?
Thanks!
Dmytro
|
|
|
|
|
Hello,
I am working on an RFQ scanner program written in C++. I would like to use the classWizard to create various recordsets. This program is run through a telnet application called SLNET to the scanners. Can I convert this program to MFC? If so will it still work through the telnet program?
If you can't can I create another app, then create the classes for the ODBC recordsets, and cut them into my program?
Thanks.
|
|
|
|
|
I thought Microsoft had a conversion program that would take
something like a console mode app and convert it to MFC.
Unfortunately, Ive long since forgotten/buried the reference
for it.
I had a contractor in my shop covering my butt while I was
on annual leave earlier this year and he passed the
info on when we were talking about 'legacy c code conversion
to MFC'). Apparently, it presumes a certain 'style'
of programming, so it might not do 100% unless you end up
doing a re-factor/re-write. This also may not help, since
you're starting from C++.. in my case, the contractor started
with a mish-mash of c, C++, and rewrote the service using
the ATL COM Service wizard as a base, with MFC support, then
added back my classes.
Hope you find something useful in this ...
Garth
|
|
|
|
|
Hey all!
You know how when you connect to the internet and you double click the little computer icon in your systray how it has a button which says Details and when you click it, the window extends downward? I want to do something similar in my app where when you click it, it reveals more buttons and extends the dialog window! how can I do this?
Thanks
Ashman
|
|
|
|
|
Easy Peasy. Put the button where you want the boundary to be and when you press it, call SetWindowPos with SWP_NOMOVE and SWP_NOZORDER, and use the text on the button to know which values to pass ( the short dialog or the full one ). That way you can grab the button position and use it, allowing you to move it in the template if needed and automatically have it work for you where-ever it is. Beats spending ages trying values every time it changes.
Christian
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
Hi,
Once again I'm banging my head against this ADO stuff. Here's my prob:
I have an array of pointers to CADORecordBinding objects. I want to associate each object in the array with a record from the database.
Problem is If i call pBndRs->BindToRecordset(pVisitRs) for each new object, I get a com_error. I've also tried increasing the reference count for pVisitRs but this fails too.
<br />
IADORecordBinding * pBndRs;<br />
CVisitBndRs * pVisitBndRs;<br />
_RecordsetPtr pVisitRs;<br />
<br />
TESTHR(pVisitRs->QueryInterface(__uuidof(IADORecordBinding), (LPVOID*) &pBndRs));
<br />
while (!pVisitRs->GetadoEOF())<br />
{<br />
pVisitBndRs = new CVisitBndRs();
m_visitBndArray.Add(pVisitBndRs);
TESTHR(pBndRs->BindToRecordset(pVisitBndRs));
pVisitRs->MoveNext();
}<br />
So I end up with the first object in the array getting the values of the most recent record, and all the rest contain junk.
Any help greately appreciated..
But for now my brain must rest for the weekend
Regards
Brendan
|
|
|
|
|
I'll just reply to my own problem, in case anyone encounter the same situation.
Its probably better to write your own class which has a copy constructor which accepts a CADORecordBinding object as a paramater. If you want to save information back to the database, just iterate through the array and you'll have to create a new CADORecordBinding object, which is a bit of a pain. This approach allows you to incorporate additionally functionality in terms of member functions in your own class.
|
|
|
|