|
How can i register an event in windows .
for example my program with pressing enter do something
and i want my program without focus do this action.
even if be in other program.
MkhProgrammer
|
|
|
|
|
Hi,
I'm using a CWinThread to send and recieve ICMP packets (pings).
but while recieving the echo replys the thread exits.
Thats the code I'm calling:
<br />
char* echoReply = new char[50];<br />
int nRet;<br />
int nAddrLen = sizeof(struct sockaddr_in);<br />
sockaddr_in lpsaFrom;<br />
lpsaFrom.sin_family = AF_INET;<br />
lpsaFrom.sin_port = 0;<br />
lpsaFrom.sin_addr.s_addr = inet_addr("192.168.6.100");<br />
<br />
nRet = recvfrom(s,<br />
echoReply,<br />
sizeof(echoReply),<br />
0,<br />
(sockaddr*) &lpsaFrom,<br />
&nAddrLen);<br />
when calling recvfrom() the thread breaks down. even the debugger does not stop at any breakpoints i have set after the recvfrom call.
has anybody an idea?
PS: recv also doesn't work and bind works fine...
|
|
|
|
|
This may not fix the problem but...
sizeof(echoReply) will return 4 (the size of the pointer), not 50. You need to specify 50 instead of sizeof(echoReply) .
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
My question is though, is standard the same as student/intro editions? Becuase I used to have a version of VC++ 6.0 that came bundled with a teach yourself programming package but the program wouldnt let me make programs stand alone so that i could give it to a friend or something.. If they wanted to use it they'd have to compile my code every time and so did i..
Is the standard edition of VC++.net the same? Should I have gotten profesional?
I'm just learning C++ so am not sure what all the information about the programs are so it's hard for me to tell the benifits and abilities.
Any help is appriciated,
thanks.
|
|
|
|
|
Anonymous wrote:
My question is though, is standard the same as student/intro editions?
No. The programs you build with the standard edition of Visual C++ .NET do not need to be compiled more than once unless you need to make changes to the program. In other words, the Standard Edition of Visual C++ .NET makes stand alone programs. Have fun!
I am using the same program to develop a quite large application being written in C++ and it does the job for me. If you have any other questions, let me know.
Sincerely,
BNEACETP
N-Tech Productions
http://www.n-tp.com/
|
|
|
|
|
greetings all.
I have a project consisting of about 20 source files.
In some the call to timeGetTime() works. In others it is an illegal identifier.
What include file do I need for this API call ?
Cheers
If sex is a pain in the ass, then you are doing it all wrong!
|
|
|
|
|
Header: Declared in Mmsystem.h; include Windows.h.
Library: Use Winmm.lib.
How about taking a look at the MSDN? (no offense )
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks...no offense taken...
I have a few problems with MSDN and the C++ help files: namely that they told me that I needed a header called windows.h
The source file in question has the following includes
windows.h
windowsx.h
ddraw.h
stdio.h
(Exactly the same headers as the source file that works).
NB: noticed that the source files that use timegetTime() are all class member functions: what is going on....MSDN does not cover this one (or I can't drive it).
Cheers
If sex is a pain in the ass, then you are doing it wrong!
|
|
|
|
|
Well, if your project includes these four includes, then there's missing the mmsystem.h header file. And second, link with winmm.lib. I do it this way:
#pragma comment(lib, "winmm.lib")
But you can do it in the project options as well.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Cheers.
I found some code that had the include winmm.lib and used that: worked fine.
Can anyone shed light on why the object source files had no problem when they had the same include statements ?
Thanks for all responses: much appreciated.;)
If sex is a pain in the ass, then you are doing it wrong!
|
|
|
|
|
Hello all .
i having some question about array size.
lets say i wanto declare this array...its an "unsigned long".
lets say i wanted it the array to have the size of "8"..
so i will declare like this :
unsigned long Data[8];
ok...lets say now.. i wanto to create a "unsigned long" array.. but i not yet sure whats the size...becoz its depends on the datas that will be key in by user...
ok.. lets say..
int arraysize;
arraysize=a+b;
(where a and b are both int keyed in by user...)
then.. how i wanto set the Data array into the size of "arraysize"??
can i do it like this :
unsigned long Data[arraysize];
i tired but..error... so i hope u guys can help me out..how to solve this problem...what should i do to set my array size according to wat the datas user keyed in?
thanks...
thong
twh81@tm.net.my
...
|
|
|
|
|
I don't think I should give you a direct answer on your question because, frankly, doing so would not be a help to you, in the long run. I suggest you complete the C++ text book(s) you are reading first, and I guarantee you'll find the solution by yourself. As a hint, please take a look at the new and delete operators(I assume you are learning C++) about how to use dynamic arrays and how to free the memory.
Really, I'm sorry for not being a one-time help but if you are developing an application, ask that question here, get a direct answer, then return to your application, I'm afraid your customer(or your teacher) will end up get mad.
|
|
|
|
|
I can't agree with you more!
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
You need to create dynamic arrays on the heap using new and delete the memory yourself using delete [] .
unsinged long *data = new unsigned long[arraysize];<br />
<br />
<br />
delete[] data;<br />
An alternative would be a std::vector .
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
hi
it seems that u really have not finished your C++ courses.
the array that you are using is not a dynamic array.
you need to know more about POINTERS. These are really the dynamic arrays.
if u r in a hurry u can use these lines. but my advice is that you should read more in C++ specially in pointers and dynamic memory allocation.
First you declare ur array like this:
unsigned long *Data;
when you know the actaual size of ur array you set it like this:
Data= new unsigned long[arraySize];
now u can use it as an ordinary array.
after u finish using it is better to free the memor u allocated
delete Data;
i hope this works with you but you still need to know more in C++
Good Luck.
The music in my heart I bore
Long after it was heard no more.
- William Wordsworth
|
|
|
|
|
i need to make a very good major project and i am out of ideas.
I need immediate help and guidance.
anything in VC++,C++,VB,ASP will do.
Every problem has a solution!
|
|
|
|
|
be original, make a calculator
|
|
|
|
|
a calculator , we made that when i was in 1st year
its got to be a cool working project
something which i could later add in my resume
please tell me if you have any other suggestion
Every problem has a solution!
|
|
|
|
|
erm, you can make a voice recognition system ...
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
your idea is good but already a group from my class has taken up this topic.
any other can u suggest?
Every problem has a solution!
|
|
|
|
|
you can make a fingerprint recognition system also
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
that s a great project but my senior has made in in 2001 and also got a prize , i can't repeat it.
what do u say?
any other suggestions?
Every problem has a solution!
|
|
|
|
|
Model 2 Quantum Entangled Particles (before during and after entanglement).
Then model the effects of firing a modulated photon stream at one of them.
That will give you a fair bit of work to do, and a nobel prize and a communications revolution of monumental proportions if you get it right.
If sex is a pain in the ass, then you are doing it wrong!
|
|
|
|
|
Who know how to read registry info direct from a file (system.dat, user.dat...(XP/9x)), without using of API functions (Reg*..).
I'll be very apreciative if you write me a peace of this code.
P.S. Please Help Me.
|
|
|
|
|
Why?
The registry functions are easy to use.
|
|
|
|