Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2006-06-25
4
Medium Priority
?
274 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 100 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 100 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 700 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 100 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

618 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