|
override the IHTMLElement2::oncontextmenu event handler for the body element which can be retrieved from the IHTMLDocument2::get_body.
Cheers,
-Erik
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My thoughts are my own and reflect on no other.
|
|
|
|
|
- In MSDN, it is said "TRACE0 does nothing if you have compiled a release version of your application. As with TRACE, it only dumps data to afxDump if you have compiled a debug version of your application."
- What means "dump data" here?
- Can you show me an example?
- Regards,
Maer
|
|
|
|
|
dump n.
1. An undigested and voluminous mass of information about a problem or the state of a system, especially one routed to the slowest available output device (compare core dump), and most especially one consisting of hex or octal runes describing the byte-by-byte state of memory, mass storage, or some file. In elder days, debugging was generally done by `groveling over' a dump (see grovel); increasing use of high-level languages and interactive debuggers has made such tedium uncommon, and the term `dump' now has a faintly archaic flavor. 2. A backup. This usage is typical only at large timesharing installations. From The Jargon Lexicon
|
|
|
|
|
- Thanks markkuk pal!
- I still have a question. In your reply, you mentioned "especially one routed to the slowest available output device (compare core dump)". But in MSDN it is said "dumps data to afxDump". I think the meaning of " dump" in MSDN and in your reply are different.
- Is that so? Can you show me what is the meaning of "dump" in MSDN?
- Regards,
Maer
|
|
|
|
|
- In MSDN, it is said "exp: A format string as used in the run-time function printf" (Ti: TRACE0)
- What means "run-time function" here?
- Can you show me an example?
- Regards,
Maer
|
|
|
|
|
MSDN is referring to the CRT Library [common language run time library]
All those calls you get with your C compiler that arent part of the API or MFC or some other class library are CRT functions
examples are strcpy, printf, _beginthreadex etc.
Nish
p.s. if you want to port your code to linux, it would be a smart idea to use CRT functions
|
|
|
|
|
- Thanks, Nish pal!
- I still have a question, what is the difference between CRT function and normal function? How can I know a function is a CRT function?
- Can you show me an example?
- Regards,
Maer
|
|
|
|
|
Well CRT functions will need their corresponding header file to be included.
Like if you want to use strcmp, you'll need to include string.h and your prog will need to link with MSVCRT.LIB or with one of the LIBC*.LIB libraries
These functions are part of the C/C++ language.
All those API calls like MessageBox are not part of the C language. They are specific to the Windows OS and thus those calls are provided by Microsoft.
There is a lot of overlapping
For example you can use CreateThread to create a thread [in this case you are using the Win API] or you can use _beginthreadex [CRT call]
People who used to code on Linux/DOS have a tough time moving from using CRT functions
I know lots of guys who use sprintf to format a string even when they can use CString::Format
Nish
|
|
|
|
|
- Thanks Nish pal!
- I think you are a specialist of the topic. I still have some questions.
- What is the predominance of CRT? (versus API)
- How to know whether a function is a CRT function?
- Hope you can help me.
- Have a nice weekend,
Maer
|
|
|
|
|
- What is the predominance of CRT? (versus API)
Actually unless you want to port your code to a non-Win32 platform, it doesn't matter much I guess.
- How to know whether a function is a CRT function?
Look up the function in MSDN. If you see it marked as ANSI compatible, it must be a CRT function
|
|
|
|
|
- Thanks pal!
- I still have a question. I do not understand why Microsoft use the word "run-time" here? I think it is just a library that can run on non-Win32 platform. Does it has something to do with the "complile-time" or "Dlls"?
- Can you help?
- Regards,
Maer
|
|
|
|
|
Hi,
I want to implement a simple text editor with custom functionality. i want to be able to highlight muliple words, and i'm stuck for how to do this. I need to be able to set the background color of the control, but only behind particular characters of my choosing.
Can this be done with CEdit? can it be done with CRichEdit* ? if not, then how can i implement this?
thanks for your pointers
Jon
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
You might want to take a look at Chris Losinger's Colorizing edit control
http://www.codeproject.com/useritems/coloredit.asp
Nish
|
|
|
|
|
Or CRichEditView with your sections included as OLE objects. Though I have to admit with my one project of this kind I found possitioning to be a hit-n-miss afair so ended up with some dreadfull padding techniques.
We do it for the joy of seeing the users struggle.
|
|
|
|
|
Using insertAdjacentHTML I can insert HTML at the start or end of an html page. Anyone know how I can insert HTML in he middle?
Thanks
Jeremy Davis
http://www.astad.org
|
|
|
|
|
Hi,
With this function, you can insert html code BeforeBegin, AfterBegin, BeforeEnd and AfterEnd of any element of a HTML page. If you want put html code in a particular tag, you must define an ID:
function addhtml(text)
{
var obj = document.getElementById("mycell");
obj.insertAdjacentHTML("AfterBegin", text);
}
Hope that can help you.
|
|
|
|
|
Hi, I have finally managed to implement a DIBSection properly, using CreateDIBSection (to create a new DIB) and LoadImage with LR_CREATEDIBSECTION flag, followed by a call to GetObject. However, now I have the DIBSection, I don`t know how to select it into a DC for drawing on. I have looked in MSDN and it says that CDC::SelectObject takes a CPen, CBitmap and three other MFC`s, no mention of LPDIBSECTION`s, anyone know the answer? much appreciated if you would tell me.
Cheers Alan.
P.S.
if you also know how to prevent the user from resizing a MDI child window, I would well appreciate the answer to that too.
AEGC
|
|
|
|
|
Here's an article I posted about putting a DIB on the clipboard. It uses a combination of a VC6 sample program and Chris maunders CDIBSectionLite class. The associated download includes the entire VC6 sample, as well as a modified version of CDIBSectionLite. Your answer can probably be found in there.
As for not resizing a view, look back a week or two in this forum. Someone gave the answer to this question in a previous thread. If I remember correctly, it involves changing the window style.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks for the response John, the only problem is that I don`t actually have a DIB, but a LPDIBSECTION. Once I have received a handle (through LoadImage or CreateDIBSection) to a bitmap, GetObject is used to complete the DIBSection. However, I`m not sure whether this is the best way to go about things. Is this used only to gain access to the bits of the bitmap, or can you somehow select this into a CDC and draw onto the bitmap/DIBSection directly?
Cheers,
Alan.
AEGC
|
|
|
|
|
The VC6 example code (cited in my first post) has a routine that converts a DIB to a bitmap. Also, the CDIBSectionLite class (I think) has a routine that blt's the DIB to a CDC. I'm almost sure that the answer you're looking for lies somewhere in that code (the download associated with the article).
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Yeah I`ve checked the CDIBSectionLite example and found that it selects the DIB into the CDC using the HBITMAP handle. I presume that GetObject(etc.) is only used to get the particulars about that bitmap such as width, height, bitsperpixel, and the actual pixel bits themselves. At the moment I`m storing these DIBSECTION structures in a vector and then trying to draw them, instead what I`ll do is store the actual handles and only use a DIBSECTION structure at the exact point I need it, such as when I come to do image processing.
Thanks for your help, though John, much appreciated. I would post a "This helped" but they seem to have disappeared off the Web pages.
Cheers,
Alan.
AEGC
|
|
|
|
|
Hello all,
I was wondering if anyone can tell me how can I read the file names of a set of files that are dropped on my drop target simultaneously.
Thanks.
|
|
|
|
|
|
In my MFC program, I use the OnKeyDown() function to capture single keystrokes, such as the Delete Key, as below
void CDlgMain::OnKeydownLvwMain(NMHDR* pNMHDR, LRESULT* pResult)
{
LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR;
if(pLVKeyDow->wVKey == VK_DELETE)
DeleteAListViewItem();
}
My question is, how do I capture keystroke combinations using the Control Key and a letter key (specifically CTRL-A)? I need this, so I can include "select all" functionality in a list view. I know you can check the status flag for ALT, but there is no flag for CTRL.
|
|
|
|
|
GetAsyncKeyStatus(VK_CONTROL). The trick is to call it then check it, like this:
GetAsyncKeyStatus(VK_CONTROL);
if (GetAsyncKeyStatus(VK_CONTROL) && <insert check="" for="" a="" down="">)
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|