|
i'dont know well what's your meanning?
in my opinion, that problem was caused by install problem of
msdev....maybe
could you tell me more detailly about your opinion?
i suppose that your meanning is the VC .h file can not be
compiled only without .cpp file, am i right?
p.s: thanks so much your kind reply, and then Good to see you, i'm chritian too...God bless you in all of your life
|
|
|
|
|
I'm sorry, but I'm afraid your opinion is wrong. Don't worry, it happens to me all the time
In detail, even if you create a complete class so that everything you need to compile it is in the .h file ( as you must do for templated classes, for example ), VC will inform you that it cannot compile it. Go to the .cpp file, and you can compile it fine. If there isn't one, create an empty one of the same name, and I'd guess it will compile fine. Have the .h file open, and if the compiler compiles it fine in a full build or not, it's still not going to let you compile the individual file for you. My guess is that it checks the filename and assumes it's a .h in the traditional sense of a list of headers, with no actual code to compile beyond that.
issac007 wrote:
i suppose that your meanning is the VC .h file can not be
compiled only without .cpp file, am i right
Actually, it can, you can put your whole class in a .h file, and in some instances, you must. But VC will not compile that file alone, only as part of a full build.
issac007 wrote:
p.s: thanks so much your kind reply, and then Good to see you, i'm chritian too...God bless you in all of your life
Well, thank you, as it happens I *am* a Christian, but I post under the name Christian because it's also the name my mother gave me.
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
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Oh...Great..I Do understand your detail explanation.
++++++++++
i wanna make you my "code master or someone like that... "
you are really "Genius" ~! you can say that Again, and all
of Us too ...
++++++++++
It's very kind of you...Thank you very much~!
Good Luck
|
|
|
|
|
I have choosed the Horizontal Scroll box, but no hscroll shows
why?
thanks
one is the other who absorbs the thoughts of others
|
|
|
|
|
This is a very commonly asked question. You need to SetHorizontalExtent() when you add a string to the listbox, so as to have Windows display the horizontal scroll bar.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
what's it mean?
one is the other who absorbs the thoughts of others
|
|
|
|
|
A thread can return any value it choose as an error message, although it seems like a system-wide error number. Does this thread do any fileaccess? If so, this is probably ENOTDIR, meaning it cannot find the path specified..
/moliate
|
|
|
|
|
yes, it does, but even i exclude that snippet, this error is still here
one is the other who absorbs the thoughts of others
|
|
|
|
|
Hello, I am creating a multithreaded MFC app which needs to pass pointers to CWnd objects. Specifically, my program consists of a core executable and many modules, in the form of DLLs. The core.exe acts as an event passer between modules. One of the functions I was hoping to have was for each module to have 1 or more CPropertyPages, which can be passed to the GUI module to be displayed in a CPropertysheet. This is how a user would change settings and preferences for any of the modules. However, this causes all kinds of assertions or worse. I have recently learned that passing a CWnd* instead of the CWnd's associated window handle (m_hWnd), in a word, BAD. Does anyone have any idea how I could make this work? Thanks in advance!
(I would prefer response by email if possible! thanks!)
Ryan
ryanwt8@cs.washington.edu
|
|
|
|
|
Pass the underlying HWND [using the m_hWnd member ] and then from the thread use the Attach function.
BOOL Attach( HWND hWndNew );
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
The problem here is that CWnd's keep track of their handles in thread local storage. You would probably be better off creating multiple user interface threads instead of worker threads and creating the windows with the thread you intend to service it.
--
Where are we going? And why am I in this handbasket?
|
|
|
|
|
Help !!
I am fast approaching 30 and looking for a career change. For some unexplicable reason I feel drawn to a career in computing. In particular I have been drawn towards C++ (I hear that it is fairly easy to learn and that the money is good). I have bought a book "the complete idiots guide to c++" which I am currently reading and enjoying. However I can't help thinking that I am kidding myself. Is there any (recognised) courses that I can do (in the UK/world) which will allow me to go out and earn a living ?
Am I really getting into something which is just for kids ?
Any help (I mean any) would truly be appreciated, I want to succeed !!!
Thanks in advance,
Mike (Fenz)
Please help, I will help others in the future.
|
|
|
|
|
A couple of observations.
1/ C++ is NOT easy, in the sense that VB is easy.
2/ Starting with a dummies book is fine ( absolutely ) but you'll need to work past that to be employable.
Having said that, I had my midlife crisis at 30, after 10 years as a sales rep. I am now 32, two years into my C++ programming career ( admittedly I've been programming since 1984 ), and loving every minute of it. As a person who has suffered the same, you owe it to yourself to give this a go - I can't tell you how much of an impact it has made on my life in every way, being not just content in my job, but looking forward to it every day has made me a much happier person over all. Roll on 40, I'm ready....
fenz wrote:
Any help (I mean any) would truly be appreciated, I want to succeed !!!
If you have the hunger to succeed, then there's no reason why you shouldn't. Just work hard to teach yourself, ask lots of questions in places like this, and get your face in front of some potential employers.
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
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
C++ may be easy to "pick up" but it's not easy to master. Some say it takes 5 years to truely master.
There are courses out there but they aren't recognised by everyone. I find that degrees and certifications are often more important in larger companies than. small ones.
Todd Smith
|
|
|
|
|
Bookmark this page. It contains a list of useful reference books for programming. While there is no substitute for actually writing code, these books are great aids in the learning process.
Best of luck,
Jon Sagara
"Ninety percent of baseball is mental, the other half is physical." -- Yogi Bera
|
|
|
|
|
My personal opinion is that C++ *may* be easy to pick up if you`ve had a good thorough grounding in another language (perhaps Delphi-Pascal or VB *maybe*). These are high level languages (i.e. the code syntax is as near to English as it can get at present), and you can learn good coding techniques, and develop "the programming brain", which is a different methodology of thinking. C++ is a low-level language (i.e. its much closer to machine code, and its operation is essentially built on communicating with the windows API and its messages - there are not as many built in functions to make it easier for you, this in turn makes it a hell of lot more powerful to use. For instance, as far as I`m aware you can`t create an app on the system tray using delphi). I think, C++ would be a very difficult language to pick up from scratch. You could try doing an Open University degree course to get a qualification in Computer Science, or even do an Masters degree Conversion Course at a recognised campus university, that would be a good start (these schemes often take into account work experience if you lack the necessary A-Levels, and will teach good techniques - though you`ll have to learn how to implement them yourself). Hope this helped.
P.S. Guys anyone know what happened to the "this helped" button, and if its time has expired, who won?
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
Chambers wrote:
P.S. Guys anyone know what happened to the "this helped" button, and if its time has expired, who won?
I won, only because Michael Martin voted for me incessantly ( to annoy John, I think ). John and I both got a lot of votes for no good reason, and the whole thing was shot to hell. I forget who started voting for themself in this manner and started the deterioration of the whole thing, but it was obviously a waste of time, because of the way people misused it. So Chris got rid of it, and I *still* don't have a Code Project t-shirt.
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
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Well done for winning Christian. I`m not sure who John is, but I voted a good few times in response to your help, hope this sheds a little respect on your win!
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
Sadly, I think you're in for a rough ride.
C++ is only easy to pick up if you know C pretty well (and even then it takes some serious work). You're going to have to learn the basics of programming as well as C++, not to mention whatever OS you choose to develop on. It's a lot of work.
And, to top it off, there is a serious age discrimination problem in the software world. Companies would rather hire a kid directly out of college than an older developer. That's because younger people are probably more willing to work overtime, and have fewer responsibilities (kids, wife, etc..) to compete for their time. Not to mention that as a person gets older, their salary requirements go up (again, because of a wife, kids, house, cars, etc..).
It's going to be difficult to enter this market at 30 (or 32 or however long it takes you to become employable) with zero experience.
--
Where are we going? And why am I in this handbasket?
|
|
|
|
|
I think learning just c or even C++ does not bring you much because you will not be having tools to write real life looking, smelling and tasting apps. You have also to learn an OS, e.g. Windows and MFC might be the most obvious/wide spread choice for you.
Until you are done (I mean, you have some experience in the mentioned fields to produce more profit for a company than robbing other people's time with basic questions) it might take some time.
I know that because I have done just the same what you are up to, at the same age. My advantage was that I have had an educational backround in a similar field (El. Eng.) with lots of related subjects at university (Pascal, assembly ...). Even so it took me about 1 year of becoming employable. Yes, ONE long year of sitting home and learning, trying, and asking (BTW, I would grab the opportunity and thank to CodeProject and their writers, readers for this).
It must also be realized that there is no such thing as end of learning. New programming technics (ATL, COM, .NET)are coming and going, and it might sound a commonplace but you can really never stop.
If you are determined, and made out of steel, then give it a try.
In any other cases, just choose another case.
Wish you luck.
PP
|
|
|
|
|
I have a program which has many derived classes. The objects created from these derived classes all have embedded data member objects which have data members ( e.g. m_myarrary[][]) which reflect default values. These default values are very simular thoughout each derived class and embedded data member. The second subscript of 'myarrary' is always equal to four indexes in all of the different derived classes. They represent quantity, description, width and length. The first subscript of the arrary represents components of the derived objects. Many of these components are equal and simular in each of the derived classes. However, each derived class has it's own special components also, therefore the first subscript does not have all of the same indexes as the second.
Currently, I have created routines that extract the persitant data for these defaults into the data members/arrary one at at time using a seperate function for each member/arrary. If I align the data in the files in a order in which the equal/simular data has the same index/position as the other equal/simular data I could put some of the individual functions into a base class and not have to have a seperate function for each member/array. This method would require that the programmer know in advance what equal/simular data is for all of the derived classes, some of which haven't even been thought of yet. This seems undoable, because if the indexes are not in alignment, the data will not be retriveable. However, the idea of so many simular functions, that bascially do the same thing , seems to be wastefull.
Has anyone else had a simular problem? I would love to hear ideas.
Steve P.
|
|
|
|
|
Has anyone got a very basic sample of creating a UDP socket on a specified port and sending a line of text to another port on the local machine? May sound simple but I have just started looking atthis stuff in C++ and I cant find any good simple references to start me off.
- Rob.
|
|
|
|
|
This function doesn't do exactly what you're looking for, but it's pretty close. You just have to change it so that the socket binds to a specific port instead of the next available port.
int udp_recv_setup()
{
struct sockaddr_in local;
int nLocalAddrLen = sizeof(local);
int nServerSocket = 0;
nServerSocket = socket(AF_INET, SOCK_DGRAM, 0);
if ( nServerSocket < 0)
{
cout << "%error opening datagram socket \n" ;
exit(1);
}
local.sin_family = AF_INET;
local.sin_addr.s_addr = INADDR_ANY;
local.sin_port = 0;
bind(nServerSocket, (struct sockaddr *) &local,sizeof(local));
getsockname( nServerSocket, (struct sockaddr *) &local, &nLocalAddrLen);
cout << "socket has port " << local.sin_port << endl;
return nServerSocket;
}
Jon Sagara
"Ninety percent of baseball is mental, the other half is physical." -- Yogi Bera
|
|
|
|
|
Hello, the codegurus around the world.;)
First of all, we must understand the difference between TCP and UDP.
Since UDP is the connetion-less protocol, we don't need connect() in the code.
On the other hands, if we use TCP (connection protocl), we have to use
connect() in the code.
Second, we need figure out which protocol is better for the target application.
Third, we can download many sample codes around some web site.
Try to use the keywork as "WinSock" in www.google.com,
you can find the samples like "WinSock2"...
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
Masaaki Onishi wrote:
we don't need connect()
I don't call connect() in my code. Were you addressing me or Rob?
Masaaki Onishi wrote:
Second, we need figure out which protocol is better for the target application.
Agreed, but he asked specifically for UDP samples.
Jon Sagara
"Ninety percent of baseball is mental, the other half is physical." -- Yogi Bera
|
|
|
|
|