|
why 6 ?
If we say int num[5], it naturally has six elements right? 0,1,2,3,4,5.
so num[5] would point to 6th element. what's wrong here I dont understand. ..
NULL
|
|
|
|
|
Arrays in C are 0-based. By declaring int num[5] , the largest index value you could access would be num[4] .
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I see I'm still in the stone age of C++. Thanks David.
NULL
|
|
|
|
|
|
Hi
I have a doubt in VC++. My doubt is, is it possible to hook any function in any process or in other words can a DLL be injected into any process.
and finally
Is there anyway one can prevent others from injecting DLL into there process address space.
Thanks in advance
-- modified at 9:22 Monday 10th July, 2006
|
|
|
|
|
"any function" - how can you know a function name from a process on which you don't have control?
If you are talking about windows APIs, there is a nice article at CP try here
http://www.codeproject.com/system/hooksys.asp[^]
Regards
Abhishake
|
|
|
|
|
|
Why don't you check this[^] and this[^].
There are lots more here[^] too.
Enjoy.
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
<marquee behavior="alternate" scrollamount="5" scrolldelay="50">
|
|
|
|
|
Hi there,
Could anyone tell me what would be the requirement to use Microsoft mappoint for real time use. like I pass latitude and longitude upon request to mappoint and I could see the location of the device that sends the lat and long on the map. I do not know what should be the interface between my application that sends the lat and long to mappoint to this.
Appreciates any suggestions.
|
|
|
|
|
They have this info on the front page of mappoint.com.
Microsoft MapPoint 2004.
|
|
|
|
|
Hi all,
The thing is, lets say you have two windows open with the same name, for example:
- window1
- window1
and both of these windows are minimized, and you want to restore both of them.
The thing is I can do it for one window, but struggling with two of them.
This is what I have done so far:
WindowTitleName = "window1";
hWnd = ::FindWindow(NULL,WindowTitleName);
BringWindowToTop(hWnd);
How can I get the handle for the second window that has the same name??
Please someone help.
Mnay thanx in advance
Programm3r
|
|
|
|
|
Programm3r wrote: How can I get the handle for the second window that has the same name??
Do both windows share the same class name?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
How would I know that? What differences would exist between two windows that share the same name?
|
|
|
|
|
Sorry but I think they do have the same class names.....
|
|
|
|
|
Then you cannot use FindWindow() to uniquely identify one over the other.
Did you create the windows (e.g., CreateProcess() , ShellExecuteEx() )?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
No I didn't create the window, another application calls this dll and I check if the window is minimized and if it is I restore it. The application sends the dll a name that id'd the window name, and the rest of the problem I have already mentioned.
Do you have any advice / site / source?
Thanx for the response
Programm3r
|
|
|
|
|
Programm3r wrote: Do you have any advice / site / source?
Yes, just have the application send the DLL a window handle instead of a caption.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanx for the advice ..... I'll see if i can figure somting out.
Programm3r
|
|
|
|
|
Hi,
Iam sending data to ComPort and using RS-232 cable Iam trying to receive the data at the other end.
I set the properties also(BaudRate,Stop Bits,Parity etc..)both at sender and receiver.
Sending End:
char dataToSend[100];
dataToSend = "asdfsdf ....";
result = WriteFile(handlePort,dataToSend,99,&length,NULL);
Receiving End:
char dataReceived[100];
result = ReadFile(handlePort,dataReceived,99,&length,NULL);
cout << "Data Received = " << dataReceived<
|
|
|
|
|
Ayesha Farheen wrote: result = ReadFile(handlePort,dataReceived,99,&length,NULL);
What is the value of result ? If it is FALSE , what is the return value of GetLastError() ?
What is the value of length ?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
At both sending and receiving ends , its returning 1 (TRUE).
Ayesha
|
|
|
|
|
And length? What happens if you flush the buffer?
|
|
|
|
|
Before sending the data or receiving it , Iam flushing the buffer using following method.
int nReturnValue = PurgeComm(handlePort_,PURGE_TXCLEAR | PURGE_RXCLEAR);
And the return value is non-zero, i.e flushing succeded.
I checked both, with and without PurgeComm(). But still its not working.i.e Output is same for both.
And the length received is coming as 0.
I didnt understand one thing, Iam sending the data only ones, but why its receiving it those many times and why data is not coming?
Thank You.
Ayesha
-- modified at 2:54 Tuesday 11th July, 2006
|
|
|
|
|
Flush the buffer after sending the data using FlushFileBuffers. This ensures that nothing gets stuck in a buffer waiting to send.
If you are sending the data only once but the remote end is receiving it many times, make sure you have your line enders right -- it could be that the remote end is getting confused. Try 13 10, just 10, and just 13 -- I can never remember which of those are the usual line enders.
earl
|
|
|
|
|
Ayesha wrote:
result = WriteFile(handlePort,parameterNCheckSumData,99,&length,NULL);
What is parameterNCheckSumData? Should'nt it be dataToSend.
Adios,
Cool Ju
Dream Ur Destiny
|
|
|
|