473,394 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Interprocess Communication

I'm trying to pas data back and forth between a vb app, and a c++ app.
I have tried several methods:

Through a dll (written in C++), doesn't work because each app has it's
own instances of the variables declared in the dll. Is there a way to
force one instance?

Windows messaging - I could only get it working by broadcast, then it
calls Internet Explorer, and wierd stuff happens.

FileMapping - I'm working on this method now, having trouble with some
of the api's in C.

Can anyone offer any suggestions?

Thanks in Advance

John Norman
Jul 17 '05 #1
5 5915
Through a dll (written in C++), doesn't work because each app has it's
own instances of the variables declared in the dll. Is there a way to
force one instance?

To this....the API would let you search for an existing instance of the
object and use that one instead of creating a new instance

--
Stéphane Richard
Senior Software and Technology Supervisor
http://www.totalweb-inc.com
For all your hosting and related needs
"John Norman" <re***@throughnewsgrp.com> wrote in message
news:je********************************@4ax.com...
I'm trying to pas data back and forth between a vb app, and a c++ app.
I have tried several methods:

Through a dll (written in C++), doesn't work because each app has it's
own instances of the variables declared in the dll. Is there a way to
force one instance?

Windows messaging - I could only get it working by broadcast, then it
calls Internet Explorer, and wierd stuff happens.

FileMapping - I'm working on this method now, having trouble with some
of the api's in C.

Can anyone offer any suggestions?

Thanks in Advance

John Norman

Jul 17 '05 #2
Ok,
since you have full control of the CPP DLL and the VB App,
- this is how I do it

1) RegisterWindowsMessage using a unique string ID
- that gives you a 'unique' Windows Message Number
2) Broadcast on this number, and make all recipients reply
- sending back their hWnds
3) SendMessage using WM_COPYDATA to then now known hWnd(s)

If you can understand Delphi / Pascal then I could post you an example
that 'chats' - or a DLL that encapsulates it

On Mon, 07 Jul 2003 17:40:54 -0700, John Norman
<re***@throughnewsgrp.com> wrote:
I'm trying to pas data back and forth between a vb app, and a c++ app.
I have tried several methods:

Through a dll (written in C++), doesn't work because each app has it's
own instances of the variables declared in the dll. Is there a way to
force one instance?

Windows messaging - I could only get it working by broadcast, then it
calls Internet Explorer, and wierd stuff happens.

FileMapping - I'm working on this method now, having trouble with some
of the api's in C.

Can anyone offer any suggestions?

Thanks in Advance

John Norman


Jul 17 '05 #3
John Norman <re***@throughnewsgrp.com> wrote in message news:<je********************************@4ax.com>. ..
I'm trying to pas data back and forth between a vb app, and a c++ app.
I have tried several methods:

Through a dll (written in C++), doesn't work because each app has it's
own instances of the variables declared in the dll. Is there a way to
force one instance?

Windows messaging - I could only get it working by broadcast, then it
calls Internet Explorer, and wierd stuff happens.

FileMapping - I'm working on this method now, having trouble with some
of the api's in C.

Can anyone offer any suggestions?

Thanks in Advance

John Norman


A pretty complete documentation on how to pass data between processes
can be found at the following URL:
http://msdn.microsoft.com/library/de...unications.asp

Robert
Jul 17 '05 #4
Stephane,
Do you know which api's handle this?

Thanks
John

On Tue, 08 Jul 2003 00:57:08 GMT, "Stephane Richard"
<st**************@verizon.net> wrote:
Through a dll (written in C++), doesn't work because each app has it's
own instances of the variables declared in the dll. Is there a way to
force one instance?

To this....the API would let you search for an existing instance of the
object and use that one instead of creating a new instance


Jul 17 '05 #5
This is a complete red herring

DLLs leech of the Data Area of their parent EXEs
- although they all share the same Code Area, they all have different
Data Areas - if they belong to different EXEs

There is just one curious exception, which seems to be memory mapped
files - I still have not got to the bottom of that.

Passing data between VB Apps (not VB to CPP) is pretty easy, you
simply use an AX EXE
- which _does_ have its own Data Area
- and hence that is 'shared' between anything using the EXE
(providing the instancing of the AX EXE has been correctly set up)

This is probably of little use for Inter-Language and App
communication - but nifty for VB to VB

On Tue, 08 Jul 2003 05:32:14 -0700, John Norman
<re***@throughnewsgrp.com> wrote:
Stephane,
Do you know which api's handle this?

Thanks
John

On Tue, 08 Jul 2003 00:57:08 GMT, "Stephane Richard"
<st**************@verizon.net> wrote:
Through a dll (written in C++), doesn't work because each app has it's
own instances of the variables declared in the dll. Is there a way to
force one instance?

To this....the API would let you search for an existing instance of the
object and use that one instead of creating a new instance


Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jeroen | last post by:
Question, We are in the process of creating a windows service in C#. Another GUI application, also written in C# has to communicate from another machine to this service. What is the best...
7
by: Daniel | last post by:
I search for a good way to communicate between processes. I have a main application(might be more instances) and an tool that should exchange information such as which user is logged in into the...
4
by: Charles Packer | last post by:
I need to do the following simple interprocess communication (IPC) among these processes that are all on the same box: -- A daemon waits for "I'm here" announcements from multiple clients -- One...
5
by: guy | last post by:
In the past I've used sockets in C++ to allow apps to communicate with each other over a local network. Is there anything better/more advanced in .NET or should I continue to use sockets and the...
3
by: James Aguilar | last post by:
Oh wise readers of comp.lang.python, Lend a newbie your ears. I have read several old articles from this group about memory mapping and interprocess communication and have Googled the sh** out...
7
by: Michael Butscher | last post by:
Hi, this is not really Python-specific but I need it for Python. I'm wanting a method for interprocess communication which is OS- independent (sockets would be the normal way to go), but which...
4
by: batista | last post by:
Hello all, I need suggestions and possibly solutions to the problem stated below: I have an application written purely in .NET ( Windows Form Application) and another application that is...
0
by: Murali | last post by:
Hi Python Gurus, I am writing a GUI app (on linux) using pygtk which would launch some external applications and display their stdout and stderr inside the output window of my application...
2
by: Murali | last post by:
Hi Python Gurus, I am writing a GUI app (on linux) using pygtk which would launch some external applications and display their stdout and stderr inside the output window of my application...
3
by: madankarmukta | last post by:
Hi all, I am very new to Implementation of the Interprocess communication.I am trying to implement the concept in c++.I created the pipe using Createnamedpipe() function ,connecting to that pipe...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.