|
|
Hi together,
I need some help. I'm having some old VC6 code which works fine:
FILE* pipe = _popen("MyPipe", "r");
streambuf* buf = new stdiobuf(pipe);
istream in(buf); However, I have to get it run in VS2005 where it doesn't compile. For example, the function stdiobuf() doesn't exist any more
As far as I understand it: The new template-based stream functions can't handle file descriptors any more.
So, here's my question: How can I get data from a pipe to an istream object? I need it this way, because the rest of the old code works on istreams.
Thank you very much for your help in advance!
Regards,
Marcus.
|
|
|
|
|
Imagine.. in the ATL implementation, we have a collection or an array, ie :
int num[5];
num[0]=100;..... [5]=500;
Now in my client, (i.e VB) , I need to access them like,
(Imagine collection is the property which points to the array I've mentioned above}
msgbox (MyComp.Collection[0])
It should popup 100.
A little bit urgent !
|
|
|
|
|
Meat Loaf wrote: int num[5];
num[0]=100;..... [5]=500;
If you are going to be accessing num[5] , you'll need to use:
int num[6]; That has no bearing on your problem however.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
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
|
|
|
|