|
Marwan wrote:
wonder how you all make your livings. i mean it's just insane coz you guys are here 16 hours a day.
We are all employed by Chris Maunder of Code Project.
I make 480K annually
CG makes a little bit less on account of his lack of C# skills. That's why he is learning C# now
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Nish [BusterBoy] wrote:
I make 480K annually
Based on your previous comments of how much people in India get an hour, this means you work 1315 hours a day, every day.
Nish [BusterBoy] wrote:
CG makes a little bit less on account of his lack of C# skills. That's why he is learning C# now
Oh, you're taking about clam shells ? Yeah, I make a bit less than 480,000 clam shells a year. I'm gonna catch up though, once I get into this C# stuff.....
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Christian Graus wrote:
Based on your previous comments of how much people in India get an hour, this means you work 1315 hours a day, every day.
Cruel, cruel man!
Christian Graus wrote:
Oh, you're taking about clam shells ? Yeah, I make a bit less than 480,000 clam shells a year. I'm gonna catch up though, once I get into this C# stuff.....
LOL
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
i think you guys really need a raise
i'll probably ask your employer, i will tell him how much i irritate you guys with my stupid questions all the time, but you all never get tired of replying to the best of your knowledge.
|
|
|
|
|
In our EPos program (running on a Win98 computer), I am using the "_inp" and "_outp" functions to get the status of the Credit Card reader (attached to the Keyboard).
The commands are:
Keyboard Status Enquiry
_inp(0x64);
Enable Card Reader
_outp(0x60, 0xd3);
Disable Card Reader
_outp(0x60, 0xd4);
These commands always crash the Win2k machine, I guess it has something to do about reading/writting to an address.
So is there a LEGAL (or EASY) way of reading/writting this data to the Keyboard port on a Win2k machine, or is the keyboard located at a different port ?.
Any help would do - honest.
|
|
|
|
|
KB article Q112298 discusses this - on NT IN OUT instructions are privileged.
I'm surprised you can do this on 98. Learn something every day, I guess.
|
|
|
|
|
Hello!
My application uses Windows tray, and if the dialog is hiding and a second instance of the program is started, this function opens the first instance and exits the second one. This works very well if I have has the dialog opened (thus visible). If not, the first instance doesn’t come up. Why not??
I’m sorry about my bad English.
/Ola Carlsson
void CMyDlg::CheckInstance()
{
CWnd *temp = FindWindow(NULL, "My Dialog");
if(temp !=NULL)
{
temp->ShowWindow(SW_SHOWNOACTIVATE);
temp->SetForegroundWindow();
exit(0);
}
|
|
|
|
|
FindWindow should find both visible and not-visible windows. I believe you are destroying the dialog each time and not just show/hide flipping it.
Anyway you'd be better off, using a mutex. Read Joe Newcomer's article on avoiding multiple instances.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Hi,
I have to communicate with a slow device over the serial port.In order to preserve responsivness, the device is called from worker threads.
Problem:
Is it safe to access a BOOL CWinApp::m_bConnected from several worker threads at a time?
Since I am that familiar with mutexes and critical sections, how to achieve this?
Thanks
Pepe
|
|
|
|
|
Create a critical section and enter it every time you're going to use the BOOL. Then leave it right away. That way if one thread is accessing the BOOL, others will stop and wait for it to finish.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
A BOOL is atomic (only needs 1 processor instructor to read/write) and therefore does not need synchronising.
|
|
|
|
|
How can I get the coordination of clientdc?
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
BOOL GetClientRect(
HWND hWnd, // handle to window
LPRECT lpRect // client coordinates
);
For the cleint Area
|
|
|
|
|
I new to using VC++ but have experience with C and Visual Basic. I'm looking for a simple function to Read from a text file.
Something like in VB:
Set fs = CreateObject("Scripting.FileSystemObject")
set filename = fs.GetFile("Text.txt")
Set ts = filename.OpenAsTextStream(ForReading, TristateUseDefault)
Buffer = ts.Readline
Any example info I've found so far about File I/O in VC++ is exceedingly difficult. I'm writing an simple MFC dialog app.
Thanks.
|
|
|
|
|
try this:
FILE *fp;
fp = fopen(filename, "r");
ASSERT(fp!=NULL);
char * buffer[MAX_LINE_SIZE];
fgets(buffer, MAX_LINE_SIZE, fp);
// here, buffer contains one line from your file.
|
|
|
|
|
CStdioFile f;
if (f.Open(filename, CFile::modeRead)==0)
{
...error
}
CString csText;
if (!f.ReadString(csText))
{
....error
}
Smaller Animals Software, Inc.
You're the icing - on the cake - on the table - at my wake. Modest Mouse
|
|
|
|
|
#include <string>
#include <vector>
#include <algorithm>
#include <fstream>
#include <iostream>
#include <sstream>
using std::copy;
using std::vector;
using std::string;
using std::ifstream;
using std::ostream_iterator;
using std::cout;
using std::back_inserter;
using std::getline;
using std::ostringstream;
using std::istream_iterator;
int main(int argc, char* argv[])
{
string currentLine;
ifstream str("c:\\winzip.log");
if (!str.is_open())
{
cout << "It's stuffed\n";
return -1;
}
vector<string> file_contents;
copy(istream_iterator<string>(str),istream_iterator<string>(), back_inserter(file_contents));
// Now print out the results
copy(file_contents.begin(), file_contents.end(), ostream_iterator<string>(cout, "\n"));
return 0;
}
This example reads a file in and prints the output to the console. However, the pertinent point is that you can create an fstream, which is bidirectional, or just an ifstream or ofstream, and then if you know the file format, you can, for example, do this:
myFile >> nMyNumber >> szMyString >> etc.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Hey! The guy is coming from VB. Are you going to make him afraid of C++?
I vote pro drink
|
|
|
|
|
|
MDR ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
MDR == Mort De Rire in French visit Irc Channel
|
|
|
|
|
I donno what that means but apparently people would call you a "damn STL MDR" if you start pushing STL down VB coders' throats
Nish
p.s. What's MDR anyway???
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Nemanja Trifunovic wrote:
Hey! The guy is coming from VB. Are you going to make him afraid of C++?
VB and C I thought he said. Admittedly the sample code is more complex than it needed to be in order to make the point ( it's a copy & paste from an earlier question ), but from memory the MFC classes for file IO use the shift operators as well, so why not point someone to the proper way to do things ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Christian Graus wrote:
VB and C I thought he said.
Yes, he said, but if he really knew C, he would have simply used the lucy's solution (fopen).
I vote pro drink
|
|
|
|
|
Nemanja Trifunovic wrote:
Yes, he said, but if he really knew C, he would have simply used the lucy's solution (fopen).
Actually, you're right, and that had occured to me when I read lucy's response, but then I saw Chris' MFC reliant post, so I felt obliged to defend the standard (which IMO equates to 'proper') way of doing things.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|