Solved

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

Posted on 2006-06-25
4
245 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
ID: 16979490
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
ID: 16985451
>>>> 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
ID: 17004910
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
ID: 17024988
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

770 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