|
thank you!
SnaidiS(Semion)
|
|
|
|
|
One of the things that I used to do when I had time to kill was to pick a function, or an API, and write a whole program around it. I learned a lot this way.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Got to the MFC src file (..\Microsoft Visual Studio\VC98\MFC\SRC ) it has lot of good code and will give you internal details about each thing.
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
OK thank you!
SnaidiS(Semion)
|
|
|
|
|
OK-Thank you man!
SnaidiS(Semion)
|
|
|
|
|
Anybody know,How to use GetKeyboardState()function?
Please give me some example about this?
|
|
|
|
|
BYTE state[256];
GetKeyboardState((LPBYTE)&state);
if(state[VK_CONTROL] & 1)
{
...
}
|
|
|
|
|
Does anyone know of any tutorial tools that might be helpful in getting up to speed with VC 8?
Time past, whenever MS came out with a new version of VC, they'd produce a CD for those who might need a little help getting acquainted with the product.
I've just barely become acquainted with VC 7, and now VC 8 has me stumbling all over the place.
Thanks.
William
Fortes in fide et opere!
|
|
|
|
|
|
Hi all,
I am writing a VC++6.0 application. I need to read from a text file and display the file content in an Edit Box. I use the following codes:
CEdit m_fileContent;
CFile pFile;
m_fileContent.SetWindowText(""); //clear
pFile.open(.....);
int length = pFile.GetLength();
CString* strContent = new CString("");
pFile.Read(strContent->GetBuffer(0),length);
m_fileContent.SetWindowText(strContent->GetBuffer(0)); //update file content
strContent->ReleaseBuffer(0);
delete strContent;
pFile.Close();
Now the problem is: When I first opened a file, it's fine. But When I opened a second file, if the length of the first file is longer than that of the second file, the content is not cleared. Any ideas? thanks,
Gavin
|
|
|
|
|
CEdit m_fileContent;
CFile pFile;
m_fileContent.SetWindowText("");
pFile.open(.....);
int length = pFile.GetLength();
CString strContent = _T("");
pFile.Read(strContent.GetBuffer(0),length);
strContent.ReleaseBuffer();
m_fileContent.SetWindowText(strContent);
pFile.Close();
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Thanks a lot Zac and David!
|
|
|
|
|
Try:
CString strContent;
pFile.Read(strContent.GetBuffer(length), length);
strContent.ReleaseBuffer();
pFile.Close();
m_fileContent.SetWindowText(strContent);
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
How the application knows whether the machine is Laptop or Desktop or Hand Held...I have tried win32_SystemEnclosure by using WMI but I'm getting the wrong info ie, what I'm expecting is not the one...
Is there any api call...Please suggest me or locate where I will get source code asap...
Regards,
nag.
|
|
|
|
|
I'm not sure of anything that is 100% foolproof. In what ways does a laptop differ from a desktop? The presence of a battery is one difference. However, you can have a laptop on AC power without a battery. Can you use Win32_BIOS.TargetOperatingSystem , or the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName registry value, to determine if the device is a handheld or not?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
They don't. Whether a PC called "laptop" or "desktop" is rather arbitrary. OS doesn't care, except for some special OS like "Windows for Pocket PC".
Best,
Jun
|
|
|
|
|
hi gurus,
how to detect the sound input and show this like messenger voice chat?
Thanks.
Ivan Cachicatari Blog[^]
www.latindevelopers.com
-- modified at 10:48 Thursday 13th July, 2006
|
|
|
|
|
Hello,
This may seem like a simple question, but in Visual Studio is it possible to set coding style, specifically:
I like to write like this:
method<br />
{<br />
for<br />
{<br />
statement<br />
}<br />
}
but Visual Studio auto formats it like this (and I hate it!):
method<br />
{<br />
for<br />
{<br />
statement<br />
}<br />
}
How can I set it my way?
-- modified at 10:21 Thursday 13th July, 2006
|
|
|
|
|
your formatting got lost (try <pre> around your code).
if you're asking about bracket indentation, there's a setting in Tools / Options called "Indent braces" that might help
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Hi together,
I tried to compile the fdstream classes from www.josuttis.com with VC6, but didn't succeed. I cut down the code to what doesn't work:
#include <streambuf>
#include <istream>
class mybuf : public std::streambuf
{
protected:
int m_i;
public:
mybuf(int i) : m_i(i) {}
};
class myistream : public std::istream
{
protected:
mybuf buf;
public:
myistream(int i) : std::istream(0), buf(i) {}
};
int main(int argc, char* argv[])
{
myistream strm(5);
return 0;
} On this code I get the following two errors:
error C2512: 'basic_istream<char,struct std::char_traits<char> >' : no appropriate default constructor available
error C2614: 'myistream' : illegal member initialization: 'istream' is not a base or member
I can't figure out what's the problem. It seems std::istream(0) isn't accepted, but I don't know why.
Can anyone help me?
Thank you very much in advance.
Regards,
Marcus.
|
|
|
|
|
khb wrote: error C2512: 'basic_istream<char,struct std::char_traits<char=""> >' : no appropriate default constructor available
std::istream is a typedef for basic_istream<char, char_traits<char> >. basic_istream has the following constructor:
explicit basic_istream(basic_streambuf<Elem, Tr> *_Strbuf, bool _Isstd = false);
Do you really want your streambuf to be null? If so, try casting 0 as follows:
std::istream((std::streambuf*)0);
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Yeah, the streambuf should to be null, as in the original implementation it is replaced by an instance of the inherited streambuffer class using rdbuf() .
However, casting 0 to std::streambuf* results in the same errors.
If you have another idea on how I get the istream constructor called correctly, I would be really happy.
Thank you very much for your help,
Marcus.
|
|
|
|
|
Strange. Not sure why that would be a problem ... I was able to compile your code using g++ with no problems.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
The original author is using VC6.
For the love of god, VS2005 Express is free. Get it.
earl
|
|
|
|
|
I realize that. Generally, GNU is more strick about things like this that Microsoft's compiler.
I have VS2005 Pro ... but it doesn't run on Linux, which is what I have to use at work.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|