|
yes
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi all,
i m using excel in my application,i want to get column name of excel sheet.
excel sheet having column name like A,B,C,D.... and so on.
so i want to get this name .
please tell me how can i do this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hello All,
I use the following code at Client side to connect with server. In this program, when i start Server, client will stop or hang on the "connect" function. I am not getting where is problem in client program. Server side code i tested, but it is working.
I place the client side code below.
//// Client code ////
CString str;
int sock,iResult,iOptVal,iSenderAddrSize;
int BUFF_SIZE = 30,iError;
char recv_data[30];
char* localIP = "";
struct sockaddr_in server_addr,SenderAddr;
struct hostent * lpHostEntry;
WSADATA wsaData;
iSenderAddrSize = sizeof(SenderAddr);
iResult = WSAStartup(MAKEWORD(2,2), &wsaData);
if (iResult != NO_ERROR)
AfxMessageBox(_T("Error at WSAStartup()\n"));
if ((sock = socket(AF_INET, SOCK_STREAM,0)) == -1)
AfxMessageBox(_T("Error at Socket"));
gethostname(localIP,56);
lpHostEntry = gethostbyname(localIP);
server_addr.sin_family = AF_INET;
server_addr.sin_port = htons(2050);
server_addr.sin_addr.s_addr = inet_addr("192.168.1.9");
iError = connect( sock, (SOCKADDR*) &server_addr, sizeof(server_addr) );
if(iError == SOCKET_ERROR){
iError = WSAGetLastError();
CString s1;
s1.Format(_T("Connect Error = %d"),iError);
AfxMessageBox(s1);
exit(1);
}
while(1){
memset(recv_data,0,sizeof(recv_data));
int iResult = recv(sock,recv_data,BUFF_SIZE,0) ;
if(iResult > 0)
{
recv_data[BUFF_SIZE] = '\0';
str = inet_ntoa(SenderAddr.sin_addr);
AfxMessageBox(str);
}
else{
iError = WSAGetLastError();
}
}
///
Pleae see the above code and give some some hint...
Thanks in advance..
|
|
|
|
|
Reply[^]
Parag Patel
Sr. Software Eng, Varaha Systems
|
|
|
|
|
Hello everyone,
I am posting this here because I am not receiving an error to my compiling. The program executes just fine, just not applying the new computer name. Please tell me what you see wrong. I am new and been reading on MSDN's website on how to used this Function correctly.
If you have an answer to my question, please explain your answer. It will help me and any other beginner programmer.
Here is the code:
<code>#include <iostream>
#include <windows.h>
#include <stdio.h>
using namespace std;
// Set Local Computer Name
BOOL WINAPI SetComputerName(
LPCTSTR lpnewcomputername
);
int main()
{
return 0;
}
|
|
|
|
|
The computer will do everything you ask it to do; it starts at the first line of your main() function and continues until either a return, an exit() or a fatal error is encountered. You should be able to figure it out from there.
|
|
|
|
|
I thought that if I placed the SetComputerName function in
int main()
That it would be considerd a nested function? And I thought Nested functions are not allowed in int main()?
I am confused on this.
I feel very stupid for this as well.
|
|
|
|
|
Hi,
I can conclude that you are a beginner and this is your first attempt at any programming language.
Hence my advice: go to the book store, look at some books, buy the one book that looks most interesting, and study it; in one or two weeks it will teach you all the basics in a systematic way; and you will learn much more than you can discover by yourself, by experimenting and asking random questions.
|
|
|
|
|
Thank you for the advice. I will do so when I get back from Iraq. : \
Now I ran back to my room to try and re-compile this and I changed it to the following:
I still do not recieve any errors. Yet after I reboot the computer name is still the same. I am doing my best to understand.
<br />
#include <iostream><br />
#include <windows.h><br />
#include <stdio.h><br />
using namespace std;<br />
<br />
<br />
<br />
<br />
int main()<br />
{<br />
BOOL WINAPI SetComputerName(<br />
LPCTSTR lpnewcomputername); <br />
}<br />
<br />
|
|
|
|
|
Hi,
I do not plan on writing a C tutorial, however there are three things to functions:
1.
you can declare them, i.e. explain how they look, what their parameters and result are.
That is what int square(int val); does.
Declaring a function is not always necessary.
2.
you can define them, i.e. provide an implementation, that is code that actually does the job.
example: int square(int val) { return val*val; } Note the brackets.
Defining a function is necessary, unless you have a library (i.e. a collection of function definitions somewhere).
3.
you can call them, i.e. cause them to be executed.
example: c = square(123);
If you need more, for starters look for a tutorial on the web.
A simple google will find many, such as this one[^]
|
|
|
|
|
thank you very much for your help.
I am reading the tutorial now ^^
|
|
|
|
|
You're welcome. And good luck with it.
|
|
|
|
|
The docs[^] say this:
the name change takes effect the next time the user restarts the computer.
Have you restarted the machine?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Can anyone recommend a good library/API for adding PDF output to a graphically-intensive MFC C++ (GDI+ VC++ 6 etc) application?
For example a simple EMF-to-PDF conversion would seem to be sufficient.
It seems to be a common capability of many apps. Is there a standard or common solution I have missed?
|
|
|
|
|
I don't know how easy it is to use - but PDFlib Lite[^] may be an option? There's a commercial version as well if you've got cash to splash.
I presume the Adobe PDF SDK[^] is likely to be out of reach financially?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello, I'm a programmer, I work with Java, C# and other technologies. I'm also a C++ programmer, I've been using it for a long time, but never commercially as I never found a job involving it or available jobs require too much commercial experience with it. As I'm interested in it, working on graphics applications, MFC or other, how do you think I may interest employers?? My work background is essentially Java and some C# (2 Years). I have been thinking of starting a open source project as a showcase of my skills, anyway it requires lots of spare time... Do you have any suggestions?
|
|
|
|
|
Well, apply for jobs that have C++ openings, and hope for the best.
IMO, unless you make huge documented contributions to a well know open source projects, nobody will notice; especially
if it's your own project (and nobody else is contributing).
This signature was proudly tested on animals.
|
|
|
|
|
Small word of warning. I won't hire anyone doing open source projects and neither will a lot of people I know. It isn't worth the hassles and the competition for time.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
|
How to communicate through the UPD server.
What r the way to implement it
|
|
|
|
|
There are lots and lots of ways. Here's one[^].
Now, you need to work out what data you need to send between client and server and then determine a protocol for that data.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
deadlyabbas wrote: How to communicate through the UPD server.
1) Find the electrical outlet that the server is powered from.
2) Unplug the server.
3) Use your saliva to coat your two of your fingers.
4) Stick the fingers from step (3) into the electrical outlet.
5) Return to this forum after completing step (4)
|
|
|
|
|
led mike wrote: 5) Return to this forum after completing step (4)
Or not...
|
|
|
|
|
shhhhhh, you'll spoil the surprise!
|
|
|
|
|
You mean, the big fireworks and all the stars and the bright light ? Ooopsss, sorry...
|
|
|
|