|
My band is a html document, when i change the html file in the band, using html links and then the close band (the x on the side, or the menu item )
i 'm getting the new page html (the link) that i pressed before closing the band. and i want to get the old document, ( my default document that is in the code.)
and the other problem .. and this is really somthing funny i have a text box (html text box) in the band and when i press the backspace button it doesn't delete the last letter .. in other words i can't delete the text box ... using the backspace or the delete button.
|
|
|
|
|
K. Your first problem I read as follows. You show the band with an initial page. click a few links and a different page is showing in the band. you close the band. Then show the band again and the page you see is the last page that you clicked to, not the initial page. This is because once you create a band object in IE it lives for the life of that IE instance. If you want it to always start at the initial page when the band is displayed then in the STDMETHODIMP <myband>::ShowDW(BOOL fShow) have your m_wnd object reset to the initial page using the res:// protocol.
Your second problem. This is due to the fact that the band is not implementing IInputObject. If it did you would then set focus to your HTML page and the backspace key should work. MSDN documents this http://msdn.microsoft.com/library/psdk/shellcc/shell/Bands.htm. Scroll to the bottom of the page and look for the heading "The IInputObject Interface" under "Optional Interface Implementations"
Cheers,
-Erik
|
|
|
|
|
I need help.
I need to change CDateTimeCtrl's background color (CEdit like part, not MonthCalendar).
Can any body helps me?
Eugene Karpov
|
|
|
|
|
I am about to write a dll that allows users to define keys (e. g. for a game), but I cannot distinguish between the right and left ctrl-key.
In the second parameter the WM_KEYDOWN-Message gives me this information in a DWORD-value (LPARAM), but I am not able to decode the information.
How can I get this done?
Thank you.
|
|
|
|
|
the right key (extended key) is pressed if bit 24 of lParam is set. so use the bitwise AND operator (&) to check that bit.
if (lParam & 0x01000000)
{
}
|
|
|
|
|
Thank you. Your tip works. But one question remains:
When I read "bit 24 of lParam", how do I get the binary code like "01000000" ?
|
|
|
|
|
0x01000000 is not a binary code, it is a hexadecimal number (note the '0x'). Each digit in a hexadecimal number represents four bits.
Hexadecimal Digital Binary
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111
So when we say bit 24 is set we get this
bit 33 2 2 1 1
number 1098 7654 3210 9876 5432 1098 7654 3210
| | | | | | |
binary 0000 0001 0000 0000 0000 0000 0000 0000
hex 0 1 0 0 0 0 0 0
Also look up bitwise operators in MSDN
|
|
|
|
|
I don't have any concern on this stuff,
but I want to say that you are very kind to do this!
Honestly I didn't ever tried to explain in detail in helping others
although I've got tons of information from others like you.
Sincerely I honor your work.
Regards,
Ryan
|
|
|
|
|
|
Ok, I've got an ATL appwizard with MFC support. Implemented a ActiveX server object (I'm trying to write an ASP extension to interface to some code i've already got working elsewhere).
To test the theories of ATL and COM, I'm trying to make a simple propert that returns the IP address of the client (from Request.ServerVariables("REMOTE_ADDR") ).
Here's the function I'm trying to use:
STDMETHODIMP CMyClass::get_GetIP(BSTR *pVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
IRequestDictionary *piRequestDic;
m_piRequest->get_ServerVariables(&piRequestDic);
VARIANT v_Param, v_Value;
_variant_t vt_Param;
vt_Param.Attach(v_Param);
vt_Param.Clear();
vt_Param.ChangeType(VT_BSTR,NULL);
vt_Param.SetString("REMOTE_ADDR");
piRequestDic->get_Item(v_Param,&v_Value);
VariantChangeType(&v_Value,&v_Value,0,VT_BSTR);
*pVal=v_Value.bstrVal;
return S_OK;
}
When I call a simple asp page that creates this object and attempts to read this GetIP property, IIS hangs. I have to use Winnt reskit's KILL.EXE to close it.
I have no idea whats wrong- i've followed my logic through several times and i'm oblivious to the prob.
help appreaciated thanks
jon h
|
|
|
|
|
Hello all. I have the following lines in my .h file (I've included the 'map' header file, and declared 'using namespace std':
typedef LRESULT (CALLBACK *MsgHandlerProc)(HWND,WPARAM,LPARAM);
typedef map<uint, msghandlerproc=""> MessageMap;
typedef MessageMap::iterator MessageMapIterator;
In my implementation file, I have the following:
MSG_HANDLER_ERROR CMsgHandler::AddHandler(UINT uMsg, MsgHandlerProc lpProc)
{
MessageMapIterator it;
it=MsgMap.find(uMsg);
if (it==MsgMap.end())
return MSG_ALREADY_DEFINED;
try
{
MsgMap.insert(pair<uint, msghandlerproc="">(uMsg, lpProc));
return MSG_SUCCESS;
} catch (...) {
return MSG_ERROR;
}
}
Though I get no errors when compiling, I get 70 something warnings, all having to do with _Tree. What does this mean? What am I doing wrong? Thanks in advance for any help.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
what are the warnings?
if they're 4768, you can get rid of them with a simple:
#pragma warning(disable:4786)
put this before your STL includes (and after, too sometimes)
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Interesting. Every one of the warnings were C4768. Adding the #pragma before the 'map' inclusion resolved the warnings. Is this one of the supposed many problems with Microsofts implementation of STL?
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
i'm not sure if it's an MS problem or not (really, i don't know). but it's caused when identifier names grow too large due to template expansion (which STL collections apparently do a lot of).
i just always toss that pragma in whenever i use STL, just to keep things quiet.
there used to be a lot of info on this on Deja.com, but i don't see it anymore.
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Thanks for the help, Chris!
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
MS's c++ compiler is still based on a very old version of the C++ compiler that predates both the STL and templates. MS has modified it to allow templates and do a lot, but some of the basic issues surround debug info are still based on the old MS "code view" debugger (which was actually licensed from NuMega).
One of those limitations is that the debug symbol name cannot be larger than 255 characters. Unfortunately, when STL templates expand, they often generate names that are larger than 255 characters. This causes the compiler to issue a warning that it is truncating the debug info to stay within the 255 character limit.
This doesn't effect C++ code built in release mode, and it doesn't effect the actual code in debug either, just the debug information, which can cause problems for the debugger (but usually not).
It's an informational warning, and can be safely turned off.
This isn't a "problem with STL", but it is annoying.
|
|
|
|
|
And just to make it a little more annoying, it's not always possible to turn it off!
http://support.microsoft.com/support/kb/articles/Q167/3/55.ASP
We have had several situations with complex header includes where no amount of "#pragma" will stop the warnings - but we have always been able to solve this by reorganising headers (changing the order of includes and sprinkling a generous helping of #pragmas, basically).
|
|
|
|
|
And just to make it a little more annoying, it's not always possible to turn it off!
http://support.microsoft.com/support/kb/articles/Q167/3/55.ASP
We have had several situations with complex header includes where no amount of "#pragma" will stop the warnings - but we have always been able to solve this by reorganising headers (changing the order of includes and sprinkling a generous helping of #pragmas, basically).
|
|
|
|
|
hi all
twice in one day huh? i must be becoming one of those idiots i talk about
wierd one (for me anyways) ... have a dialog with a treectrl in it ... tree gets built ok and all ... at the start of the tree build proc i do a m_tree.deletallitems() to clear it out ... if i call my tree build more than once i get an memory error on exit of the dialog:
HEAP[prog.exe]: Invalid Address specified to RtlFreeHeap( 130000, 15caa8 )
looking at the memory i see the captions i inserted into the tree and i *know* my code isnt leaking memory (at least any memory i alloc i free) ... the only solution i have found is to delete the treectrl completely and re-create one every time i redraw it ... sounds nuts huh?
the app is unicode and i'm wondering if there might be a bug in the mfc libs? or am i completely turning into an idiot and should retire from coding altogether?
thoughts & help appreciated
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
hmmm...
Duh.. so much for 20 years of coding! Huh?
|
|
|
|
|
and i'm wondering if there might be a bug in the mfc libs?
Yes sure! And now you got to figure our how to let the MS know about it!
But how?
hmmm...
Duh.. so much for 20 years of coding! Huh?
|
|
|
|
|
gee thanks
your constructive answer has shed a lot of light on the problem for me ... i can sleep safer at night knowing your there for me
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
While i'm not arguing that there aren't bugs in the MFC libraries, chances are something like this would have been found a long time ago.
It sounds like it may be a heap or stack corruption, which could result from overrunning a buffer.
|
|
|
|
|
I recently saw a form of this heap corruption in an app I am working on. I was able to trace the deallocation to an object created by a third party DLL. Linking statically to the third party lib solved the problem, and since that seemed to be a neat thing to do in other ways, I left it at that. Hmmm.. would have to check my notes on that one...
Do you notice any dif in release/debug and static/dynamic links (to the MFC)? Are you allocating any strings that might be assigned too many chars? (That's one that might pass in debug, and/or have unicode implications) Or using more than one allocation routine?
Damn... you do come up with the toughies... oh well - you did say "thoughts appreciated"
|
|
|
|
|
ahem
it turns out that vc had goofed up all my resource values in the resource.h file and i had 3 buttons on the same dialog with the same value ... the WM_CLOSE event was mapping to another function in my code and executing there
when i checked the resource.h file i had like 20 IDC_WHATEVERS as the same value ... some on the same dialog ... i am anal about those things and often check them and clear out ones i dont use anymore
some kind of alien visitation i call it
thanks for the input
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|