|
CMyDocument* = (CMyDocument*)GetActiveDocument ();
|
|
|
|
|
Hi
I am creating an ATL Composite Control which contains WebBrowser control.I have created this using CAxWindow::CreateControl and CAxWindow::QueryControl and got the IWebBrowser2 Interface.
How can i handle events for this Browser Control? I have to get all the PopUps coming from this window and have to route this to my own windows, not in the internet explorer.
Thanks
|
|
|
|
|
Hiya,
Check out the Knowledge Base Article (Q194179) over at MSDN
Also, check out Q246247 for more background information.
Hope this helps,
Andy
|
|
|
|
|
Andy,
Thanks for your help.Still i haven't completed it.But it is going fine..
|
|
|
|
|
Hi
Could someone tell me how I can debug STL types easily in VC++ 6? Everytime I use e.g. vector I can never see its content in the debug window.
Thanks!
|
|
|
|
|
Add this:
std::basic_string<*>=<c_str(), st>
std::vector<*>=size=<size(), i>, capacity=<capacity(), i>
std::map<*>=size=<_Mysize, i>
std::set<*>=size=<_Mysize, i>
std::list<*>=size=<size(), i>
std::deque<*>=size=<size(), i>
std::pair<*>=first=<first>, second=<second>
std::list<*>::iterator=val=<_Ptr->_Myval>
std::list<*>::const_iterator=val=<_Ptr->_Myval>
std::_Tree<*>::iterator=val=<_Ptr->_Myval>
std::_Tree<*>::const_iterator=val=<_Ptr->_Myval>
To VSDir\Common\MSDev98\Bin\Autoexp.dat
That will give you some more info on the stl types. To actually see the contents of a vector, say called m_vec, you can actually take the address of the first element to be equal to the address of an standard C array stored in the vector - say &m_vec[0]; This is because STL gaurentees that the vector occupies contigous memory.
If m_vec was a vector of ints (and your using STL port), you can do this:
((int*)&m_vec[0]), 100 to expand 100 elements in the vector in the watch window.
Unfortunatly, standard stl wont let u call [] operator in the watch window. You can do
((int*)&(*m_vec.begin())), 100
If you can remeber all that lol
|
|
|
|
|
There are methods of injecting code to a running application. But is there any method to remove such injected code without crashing the host application?
For example, the SmileyCentral program MWSOEMON.EXE injects a toolbar into MSN messenger. If we kill this process, MSN messenger crashes. Is there a way to remove the toolbar and terminate MWSOEMON.EXE?
|
|
|
|
|
Depends on what technique you used to inject the code; whether you know at what points during the host's execution the injected code will be called. Difficult to predict such behaviour though!
As far as I recollect, MWSOEMON is spyware.
For removing the toolbar from MSN Msgr, I'm sure there must be a better way. Havent yet tried it, but I'm sure there must be!
Bikram Singh
|
|
|
|
|
Hi.
I retrieve a value from the registry and it is a dword. I want to display it in a text box and I also want to store it in a interger? How can I do that?
Thank you very much in advance!
Well... I am a beginner ...
|
|
|
|
|
Maybe you can cast it?
int an_int = static_cast<int>(a_dword);
In VC++, you can display the value of an int like this:
CString str;
str.format("%d", an_int);
MessageBox(str);
This may not be the optimal solution though... my Microsoft-specific programming knowledge is seriously lacking.
|
|
|
|
|
CString str;
str.Format("%i", YOURDWORD);
yourtextbox.SetWindowText(str);
I thing you can just cast it:
int yourint;
yourint = (int)YOURDWORD;
or
yourint = static_cast<int>(YOURDWORD);
should be something like this.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimmy Hendrix
|
|
|
|
|
Hi,
Could you help me?
How to find lenght of any string in MFC.
rajesh
|
|
|
|
|
Depends of the type of the container
CString str = "Hello";
str.GetLenght();
char *pcHello = "Hello";
strlen(pcHello);
Check also:
wcslen
_mbslen
_mbstrlen
....
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
CString str = "Any string ";
int len = str.GetLength();
len will return u zero based length
Also chk CString class in MSDN..
|
|
|
|
|
Another method would be.
CString a;
i=0;
do
{
if(a.GetAt(i)=='\0') return i;
i++;
}
The easiest way is CString.GetLength()
|
|
|
|
|
If a has more than one \0 character, your method would not work.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
And why wouldnt it?
Bikram Singh
|
|
|
|
|
Because the return statement gets executed at the first \0 character. A CString object can contain more than one \0 character.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Yes, but when one says "string length", it does not include null characters. assuming ofcourse, the discussion related to ansi chars.
btw, really really nice signature !! ha ha !!!
Bikram Singh
|
|
|
|
|
"String" and "null-terminated string" are not the same thing. A string can have a length in bytes as well as a length in characters. Assuming ANSI is a habit long since broken.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I agree with you.
Was just trying to answer a question I felt was a novice one, thats all.
I really do respect your knowledge!
Bikram Singh
|
|
|
|
|
bikram singh wrote:
If a has more than one \0 character, your method would not work.
but you do agree, this statement was intended for a "more knowledgable" audience, dont you?
You must have been in a hurry while replying, cos given your knowledge, you would have mentioned the words "unicode" and "ansi"!
I really do appreciate your knowledge!
Bikram Singh
|
|
|
|
|
In my program in VC++, i call functions that are defined in another machine.
When i debug my program (i.e. i go step by step by pressing f10) when i get to some of those extern functions, strange things happen: The debugger jumps many lines and it never stops in the extern functions. I cant ever put a break point in those lines!
Whats happening? Is anything i could do?
|
|
|
|
|
Seems like your linking against a release version of the library that is on the other machine
You need to build on that machine a debug version and link to it.
Or debug on the assembly level
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
mufasa2 wrote:
In my program in VC++, i call functions that are defined in another machine.
You have code on one machine that is using code on another machine. Is that correct? Are these other functions exported in some DLL? Are you explicitly or implicitly linking with this DLL?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|