|
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
|
|
|
|
|
... and to send/receive data, use the sendto /recvfrom functions.
*** Caveat - I wrote this code to run on Solaris, but it should work on Windows without major modifications.
Jon Sagara
"Ninety percent of baseball is mental, the other half is physical." -- Yogi Bera
|
|
|
|
|
I'm new to all this and I was wondering how do I get the values of check boxes and text areas in a dialog box, and how do I keep them checked when the dialog box is reopened? I need to manipulate the values from inside the callback function and I working with pure c.
|
|
|
|
|
|
how do i enable and disable buttons on a toolbar in a standard MDI?
|
|
|
|
|
|
i have used the code as below to enable it
m_wndToolBar.GetToolBarCtrl().SetState(ID_COMMAND_PLAY, TBSTATE_ENABLED);
how do i get to disable the button again?
|
|
|
|
|
I have an application that needs 2GB + of virtual memory and when the memory load goes over a certain point the system starts thrashing and continues to do so for over 10 minutes. I have worked hard to optimize the application by the use of memory mapped files and other optimization techniques. The problem would be solved if I could reduce the size of the working set of my main process and all its child processes when then memory load goes over a certain point. My issue is that when you call SetProcessWorkingSetSize on a background process Win2k will minimize the working set size regardless of the parameters you pass. The problem is that is definitely not what I want to happen. The background processes hold image data I don’t want to be fully paged out. I just want the process to trim the working set by say 10%. Is this possible? One idea to get around this problem is to issue a VirtualLock on the percentage of image data that I need to keep in the process working set then set the working set then issue a VirtualUnlock. Do you think this would work? Can you issue a VirtualLock on a memory mapped region?
Thanks in Advance,
John M. Drescher
Hardware and Data Specialist / Programmer III
University of Pittsburgh Radiology Department
http://www.geocities.com/SiliconValley/Haven/1654/
jdrescher@geocities.com
|
|
|
|
|
A couple of years ago, I was in a team writing a raster image processor system. That means doing manipulations on postscript image files of several Gigabytes. Every component does its task on the file and passes it on to the next stage or component, like a conveyor belt… These components where running on the same system or were distributed over different networked computers. What we learned - when using memory-mapped files (every stage, an intermediate file was saved on the disk of the process doing the next manipulation) - is also the phenomenon you noticed: the system starts trashing when a certain memory usage limit is reached. The solution: Although memory mapped files are great, you have to limit the amount of memory that remains mapped or face the fact that for huge files the system will grind to a halt. You can do that by looking at the parameters of the functions that create the memory mapped file and view. However, the best and most efficient way to do the work is to program the file manipulation yourself. Yes, ReadHandle, WriteHandle and Seek stuff, allocating your own buffers, etc… A lot more work, but I guess in your case well worth it. It is never easy to admit you have to go back to the drawing board, but we did just that and eventually we were very pleased with the end result. IMHO using SetProcessWorkingSetSize, VirtualLock, etc... will not solve the design issue.
Just my 2 cents,
BR,
Gert.
--------------------------------------------------
If my messages appear curt, I apologize.
I try to be brief to save your time as well as mine.
--------------------------------------------------
|
|
|
|
|
Thanks,
After solving the problem of running out of process space, I have worked hard to limit the amount of memory (dirty pages specifically) in the memory mapped files. I force the system to flush a small part of the images periodically, because the lazy write was not aggressive enough and the file cache was eventually claiming all the memory. The system that this application is designed for is a dual processor Athlon 1.2MP with 2GB of registered PC266DDR RAM and my data set should not be much more than 2GB.
|
|
|
|
|
Have you actually tried allocating 2GB of memory or are you using AWE?
The amount of memory available to a user program under NT on a 32 bit processor is just 2GB (0-7fffffff). Of course, when you include stack space and OS dlls, that number drops below 2GB.
Virtual Address Space
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
Yes I now know. I thought Win2k server had 3GB user and 1 GB os, but I would have to upgrade again to advanced server. I just upgraded from Win2k Pro. I had to use memory mapped files to get around this by only mapping the images that I needed at the time. The memory mapped files would stay in memory as long as I had them open and there was free RAM. I thought about AWE, but I wanted to page out a small percentage of my image data and AWE does not support this.
|
|
|
|
|
I fixed the problem in my application.
> (taken from another site) Why does SetProcessWorkingSetSize not work on background processes?
It was the way I was using calculating the size of the working set which caused the problem. I first got the maximum size of the working set using GetProcessWorkingSetSize() and then using SetProcessWorkingSetSize() with the maximum set to .9 * Max
I'm not exactly shure why this failed but after I made sure that this max was no less than 1/2 the size
of the committed memory size of the process ( I calculated this using VirtualQuery) it worked as expected.
|
|
|
|
|
ok, i have a snippet of code here:
char buffer[100];
for(i=0, i
|
|
|
|
|
The documentation for send() says:For message-oriented sockets, care must be taken not to exceed the maximum packet size of the underlying provider, which can be obtained by using getsockopt to retrieve the value of socket option SO_MAX_MSG_SIZE. If the data is too long to pass atomically through the underlying protocol, the error WSAEMSGSIZE is returned, and no data is transmitted.
|
|
|
|
|
Hi,
How can I chnage the bitmap of a single toolbar button?
Thanks,
Erik
|
|
|
|
|
Try SetButtonInfo(). There is also a class created by Christian Graus and Masoud Samimi here which can change the bitmap of a toolbar button with a transparent color.
-Raffi
A Sign of Boredom
|
|
|
|
|
On some webpages that use some scripting languages VisualStudio thinks there is some errors on those scripts and gives annoying message if i would like to debug that webpage. Is there any way i could turn this feature off.
Before when i chose it to debug it showed a screen where i could choose debugging with Visual Studio 6 or Visual Studio .NET..but on both of those programs i switched of the Just-in time debugging and now it only alerts that there was eror on a script on website and if i choose to debug it doesn't do anything (because i switched just-in-time debugging off) but it still displays that annoying alert dialog. So anyone knows how to get rid of it.
Thanks a lot
|
|
|
|
|
In Internet Explorer. Tools->Options->Advanced. Under Browsing there is disable script debugging checkbox.
Michael
|
|
|
|