|
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
|
|
|
|
|
[ccode]
GetKeyState(VK_CONTROL) < 0 ? it's down : it's up
[/ccode]
|
|
|
|
|
Hi, all!
Does anyone of you know where I can get the C++ source codes for an algorithm named "Subspace iteration", which is mainly for the calculation of eigenvalues and eigenvectors.
Thank you very much for your help!
Jeffrey
|
|
|
|
|
- How to read C++ in English? "C plus plus" or "C double plus"?
- Still a question, how to read "Windows 2000"? "Windows two thousand"?
- Can you help?
- Regards,
Maer
|
|
|
|
|
Who on earth says C double plus ? How else would you say Windows 2000 ?
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
|
|
|
|
|
C double plus is doubleplusungood
--Mike--
http://home.inreach.com/mdunn/
If there's something strange / in your VC code / Who you gonna call? / Ghostbusters!
your with and
|
|
|
|
|
- Thanks pal!
- I want to know how you read it? "C plus plus"?
- Can you help?
- Regards,
Maer
|
|
|
|
|
- Thanks pal!
- A fellow told me today when VOA says "C++", it is often pronounce as "C double plus". So I am puzzled.
- I do not know how to read is popular.
- Can you help?
- Regards,
Maer
|
|
|
|