Solved

Send message from 16bit application to 32bit application and vice versa

Posted on 2006-06-25
4
227 Views
Last Modified: 2010-04-01

Hi,

I have an 16bit application coded with MSVC 1.52 and a more recent application 32bit application coded with VS C++ 6.

I need some help. I don't know how to send/receive message from the 16bit application to the 32bit application.

Thanks
0
Comment
Question by:TungVan
4 Comments
 
LVL 86

Assisted Solution

by:jkr
jkr earned 25 total points
Comment Utility
If you have the window handles, you can just use 'SendMessage()' or 'PostMessage()'. The problem is the data you want to transmit.
0
 
LVL 39

Assisted Solution

by:itsmeandnobodyelse
itsmeandnobodyelse earned 25 total points
Comment Utility
>>>> If you have the window handles

You may query the window handles bei EnumWindows (or GetWindow).

>>>> The problem is the data you want to transmit

You can't pass pointers, e. g. char pointers, cause the pointers were not valid at the receiving side. So, the only data you may pass beside of the message id is a 16bit word (wparam) and a 32bit longword (lparam).

If you have data to transmit you have some choices:

- file interface (sure but slow)
- pipes
- sockets
- shared memory (fastest)
- global memory (pass the handle via windows message)

Regards, Alex





0
 
LVL 17

Accepted Solution

by:
rstaveley earned 175 total points
Comment Utility
Take a look at WM_COPYDATA - see http://www.codeproject.com/system/wm_copydata_32_-_16_bit.asp - apparently the API deals with converting the pointer for you.
0
 
LVL 11

Assisted Solution

by:cup
cup earned 25 total points
Comment Utility
Remember that in the 32 bit apps, both the WORD and DWORD parameters are 32 bits.  In 16 bit apps, the WORD parameter is 16 bits but the DWORD parameter is 32 bits.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now