|
redneckCoder wrote:
how long does it take on average until a person switching from Win32 API to MFC starts getting the hang of MFC
If you were an intermediate to advanced level win 32 programmer, it shouldnt take you more than 2-3 weeks. Getting a hang of it is one thing. Adjusting to the MFC way is a different thing altogether. That might take more time.
By the way check out this article.
"MFC under the hood"
http://www.codeproject.com/useritems/mfcprogflow.asp
That might be of help.
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
It's worth noting that the comments by Nick on the future of MFC make this seem like a bad time to bother learning it...
( of course, I learned MFC first and am glad I had a chance to learn Win32, which was in the past 8 months or so )
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:
It's worth noting that the comments by Nick on the future of MFC make this seem like a bad time to bother learning it...
He said they will continue supporting it didn't he, even though most of us got the impression that he was giving us a sort of evasion-answer.
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
He essentially said that they won't pull it because they know people will use it, but by the same token his answer on the future of MFC was 'we're making it as painless as possible to move to .NET', and talked up how our industry is one of constant change.
To be honest, I think it's a *good* thing, because you can only evolve so far building on legacy systems. I think they could have built a more robust and modern framework as easily in C++, but the idea of a new framework is a good one.
I am hoping to start learning C# within the week, I want to do a series of articles on image processing using C#. I want to have more articles up than you, then more than Michael Dunn, and finally more than Chris
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:
I want to do a series of articles on image processing using C#. I want to have more articles up than you, then more than Michael Dunn, and finally more than Chris
Currently I am working on a newbie article. It was originally meant for our office intranet's white papers, but now I am thinking of putting it on CP.
Newbie articles make me nervous cause I get heavily flamed by a lot of people. Dunno why!
Anyway keep going CG. I doubt whether you'd ever reach Chris M. He's even out that Hoddap interview as his article. Imagine that!!!
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
Nish [BusterBoy] wrote:
Newbie articles make me nervous cause I get heavily flamed by a lot of people. Dunno why!
Really ? Maybe some people assume because they know it that no-one else needs to hear it. I intend on a series of newbie articles on STL, largely so when I get myself into STL vs. CArray flame wars, I can point to an article or two that lay out my case...
Nish [BusterBoy] wrote:
Anyway keep going CG. I doubt whether you'd ever reach Chris M. He's even out that Hoddap interview as his article. Imagine that!!!
I imagine that is a function of the system ( i.e. it is an article and requires an author ). But now that I am free to do so, I fully intend to contribute a lot more than the waffle I've been posting for the past two years
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.
|
|
|
|
|
Hi,
Take a book, like "MFC and ATL Special Edition" from the Que editorial, or the "Lear in 21 days...", there you can follow a tutorial step by step, a good book to do some special thing is the one named "How to do it with Visual C++...".
Well it takes some time to get used to it, but MFC is quite easy stuff, when you get used to it
Good luck !
Braulio
|
|
|
|
|
I've been using MFC for nearly 10 years and I am still discovering new and different ways of things.
I like the MFC Internals book. It does help you to understand what's going on deep inside MFC.
Programming Visual C++ is also a good read for the beginner.
Michael
|
|
|
|
|
Hi!
I had writed a program to read and transmit data in, out LPT Port.
start i transmit data out at data register(at address &378H; _outp(378,255) with value is 255 and then i read data in at data register(unsign integer x = _inp(378)value True is 255 but it return value is -1.
I know that in language C is auto check sign so i use a variable type is unsign integer to keep it(unsign integer x = _inp(378). but it too return -1. I don't know why. could you help me?
|
|
|
|
|
I know this isn't the question you asked, but why don't you just use normal Windows IO routines? _inp and _outp are not supported on NT/2000/XP. Well, they are supported but generated a fault.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
class Stock
{
friend ostream& operator << (ostream& s, Stock& stock);
};
ostream& operator << (ostream& s, Stock& stock)
{
s <<"Stock information: "<< stock.companyName<<" "<
|
|
|
|
|
You're almost there, in your Stocks operator << you need to iterate through each of the Stock objects in your array and add them to the stream. The code to do this will depend on what type of array you're using, but the basic idea is pretty simple:
for each Stock in the Stocks object
s << this_stock;
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
I could not understand what you said>
don't you think i need some sort of loop because i don't know how many objects
are stored in Stocks??
something like(i know this thing cannot work)
ostream& operator << (ostream& s, Stocks& stocks)
{
for(int i = 0; i <15; i++ )
return s << stocks.getStock(i)<
|
|
|
|
|
Yes, you do need a loop. That's what I meant by "for each Stock".
I can't tell you how to implement the loop because I don't know what sort of array you are using to store the Stock items. If it is a simple C array, then you can just use a loop with a counter:
for (int viItem = 0; viItem < m_iStockCount; ++viItem)
{
s << m_aStocks[viItem];
}
Also, you may want to have a closer look at Christian Graus' comment below because I have to admit to not knowing more than the very basics of ostream.
You might also want to have a good read of a good book on C++/C if the concepts of arrays is beyond your knowledge, because you're not going to get very far without it.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
how can you return s???
because if you return s you will only return the last value that s took in the last time thru the loop?
you know what i mean ?
like this bad code:
ostream& operator << (ostream& s, Investors& investors)
{
for(int i; i<investors.getNumOfInvestors(); i++)
{
s << investors.getInvestor(i)<<endl;
}
return s;
}
remember this is only a friend method and it only takes 2 argduments
ostream& operator << (ostream& s, Investors& investors)
|
|
|
|
|
Marwan wrote:
because if you return s you will only return the last value that s took in the last time thru the loop?
s is an ostream, and you should return the same stream that was given as a parameter. Your code isn't bad, returning s after the loop is the what the << operator should do.
|
|
|
|
|
I'm not sure what you're thinking of here, but the reason you return s is shown in your code:
s << investors.getInvestor(i)<
|
|
|
|
|
Additionally, this code is only a rudimentary version of what you want. You should also check the stream state, create an instance of an object whose name escapes me right now to take care of prefix and postfix operations, and also if you want formatting to work with this object, you should stream the data to an ostringstream first and pass it to the ostream all in one operation.
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.
|
|
|
|
|
This code would be a lot faster if you had a grow policy instead of copying the whole array every time you add 1 element. It would also probably be faster to use memcpy to copy the old array into the new one. Also, you should use the prefix ++ operator whenever you don't actually need the postfix one.
The line 'investorsList = temp' makes both point to the same list, which you then call delete on at the end. So investorsList then points to an array that has been deleted.
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.
|
|
|
|
|
dude, how did you manage to screw up the indentation that much?
Anyway, the code looks fine to me (you should uncomment delete [] investorsList; , and you really don't need a temporary array, but that shouldn't hurt it for now). Things unknown: is numOfInvestors being properly initialized? And what effect does insertionSort() have (is this a library funtion? i don't recognize i'm afraid...)?
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
He must have found it - he deleted the question...
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.
|
|
|
|
|
That's good. My answer looks less wrong this way
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
|
It's kind of annoying for people to come along and read the answers but not the question. If you leave your question up, it means others can benefit from it, even if you found the answer.
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.
|
|
|
|
|
ok sorry about that Christian!
i will never do it again!
|
|
|
|