Solved

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

Posted on 2006-06-25
4
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

726 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