|
Hmm,... reading a few times what MSDN, I understood that you cannot return data in the buffer given by the sending application... but, since I've never tried myself, I would consider David's interpretation. Have already found some sample code on CP using such technique to share memory... 2 ways.
Well, it wouldn't be the first time when MSDN is missleading!
Still, the opinions found are divided almost 50-50. If you're planning to try it out, please let us know about your findings. It would be great if you can try it out on different OS versions.
While searching more info about it, I came across an interesting aspect:
http://www.flounder.com/wm_copydata.htm[^]
Hope you'll find this idea useful, and couldn't hurt using a GUID as explained there.
Best wishes,
|
|
|
|
|
hi all
i wana add my control icon into vc++ toolbox control. ex: i have my own button class drived from CButton. is there any way to put my button's icon in toolbox and than make vc++ ide to produce my button's source code? i mean the new button class will be drived from mybutton class. (sorry for my pure english )
thx much.
EmptyBox
|
|
|
|
|
Try Project --> Add to Project --> Components and Controls.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
thx DavidCrow.
i think it works in vc++ 6.0. does it work in 2003, too?
EmptyBox
|
|
|
|
|
eagle51 wrote: does it work in 2003, too?
I don't know. Mark Salsbery will have to answer that one.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
not sure if this is the right place, but i need a script to login and download some results on HyperTerminal. is there a script that can be used?
|
|
|
|
|
What are the best ways to send messages from one process to other process?
|
|
|
|
|
The "best" way depends on the message type/size/etc.
For messages between windows or threads that can fit in two INT_PTR-sized variables there's
PostMessage()/PostThreadMessage() (note you can't pass pointers).
For larger "messages" between windows there's the WM_COPYDATA message.
For anything else...
Interprocess Communications[^]
This episode brought to you by the letter N
|
|
|
|
|
What does a notepad open two similar process when invoked on a single file. What is the rational. It looks logical to do that when doing it over a network between two machines.
|
|
|
|
|
tom groezer wrote: What does a notepad open two similar process when invoked on a single file.
Like other text editors/word processors, Notepad does not actually keep the file open. Therefore, when opening the same file more than once, Notepad does not communicate with other instances of itself to see what they are doing.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Is there a way to set a size for message queue? Also is there any performance consideration to be made while selecting PeekMessage or GetMessage.
-- modified at 5:13 Sunday 8th July, 2007
|
|
|
|
|
tom groezer wrote: Is there a way to set a size for message loop?
loops have a size?
tom groezer wrote: is there any performance consideration to be made while selecting PeekMessage or GetMessage.
In a loop, yes. GetMessage() will wait for posted messages. PeekMessage() will not.
Looping calling PeekMessage() when no messages are available in the queue will use CPU time
needlessly.
Mark
This episode brought to you by the letter N
|
|
|
|
|
I think you can set a quota.
I am pretty sure the upper limit is 10,000 messages.
We have abandoned 'window message queues' in a few areas because of the limit.
Given the nature of your other queries, you might want to consider using TCP/IP or named pipes for your interprocess communications.
|
|
|
|
|
How could I achieve versioning of archive files.
|
|
|
|
|
The simplest way would be to insert a version number when storing (before writing anything else)
and when loading, extract the version number and use it to appropriately load the archive.
Mark
This episode brought to you by the letter N
|
|
|
|
|
I need to write a console application to write a state log. It will be executed as a task periodically and record the condition of things to a log file.
When I execute the application it causes the screen to flicker in the best of circumstances and a phantom console window to appear and disappear in the worst of circumstances even though I don’t write anything to the console. Everything is appended to a log file.
Is there any way of suppressing the flicker or phantom console window from appearing?
|
|
|
|
|
For similar problems I always recommend switching from a Console app to a Windows app and then not actually opening any Windows. Most of my test apps run that way.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
I was thinking about running a windows application instead of a console application but need to pass command line parameters. Is there a way to get the equivalent of the argv array when executing a windows app?
|
|
|
|
|
Check out the remarks section here: GetCommandLine()[^]
This episode brought to you by the letter Q
|
|
|
|
|
Mark Salsbery wrote: GetCommandLine()
Excellent! That along with Mathew's suggestion to use a windows application is just what I need to get rid of the flicker.
|
|
|
|
|
Can we overload a function by return type?
|
|
|
|
|
|
The simple answer is no. Two functions which differ only by return type are not allowed.
You can make a function return a template defined type but unless that type is also used for one of the parameters you're going to find it hard to get the compiler to recognise which type you intend to replace your template argument with in any given case. some experimentation required I think.
You could consider passing in the return value by reference and then you'd have no problem doing ordinary overloading.
int Myfunc(void)
{
}
float Myfunc(void)
{
}
void Myfunc(int& iRef)
{
}
void Myfunc(float& fRef)
{
}
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
No. Because when you call the function the compiler won't be able to know which overload you're calling.
|
|
|
|
|
In general no. The only exception (I believe) is casting operators.
Steve
|
|
|
|