Solved

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

Posted on 2006-06-25
4
238 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PDF library for Delphi 2 107
C++ Class Serialization, Encapsulation and Formatted Output 8 56
Best book to learn C++ 4 70
Path to  STL Map header file 1 44
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
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…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

863 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

27 Experts available now in Live!

Get 1:1 Help Now