473,394 Members | 1,702 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.

Two .exe which write in Visual C++ 6.0, can they call each other functions..??

Hi, I am new here..
I face problem when i try communicate two .exe together..
these two .exe i name it by App A and App B..
i try to call App A's function from App B's function..
i had create a App B's pointer at App A..name by BPointerAtA..
and i try to new this pointer ( BPointerAtA = new CAppB;)..
when i compile..i have a compile error, which is..

--------------------Configuration: A - Win32 Debug--------------------
Linking...
ADoc.obj : error LNK2001: unresolved external symbol "class CBApp
BPointerAtA" (?BPointerAtA@@3VCBApp@@A)
A.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

A.exe - 2 error(s), 0 warning(s)

it this two .exe, do no include any .lib files for me to do linking
setting..
when i try to enter B.obj file in the setting (Project->Settings-
>Link),
when compile, more than 1 linking error occur..

is it anything that i miss up..??
pls help..
thank you..

regards,
shizu

Aug 16 '07 #1
5 2319
<lo***********@yahoo.comwrote:
Hi, I am new here..
I face problem when i try communicate two .exe together..

is it anything that i miss up..??
You probably want to use an exe and a library of some kind,
rather than two exes. But you can get better advice in the visual c
newsgroups on news.microsoft.com - this newsgroup deals with
the c++ language as such, not with compiler specific issues such
as how to link on vc.

BTW if you want to use standard c++, better get vc8 express,
it is closer to c++ standards than vc6 and you can have it for free.
Aug 16 '07 #2
lo***********@yahoo.com wrote:
Hi, I am new here..
I face problem when i try communicate two .exe together..
these two .exe i name it by App A and App B..
i try to call App A's function from App B's function..
i had create a App B's pointer at App A..name by BPointerAtA..
and i try to new this pointer ( BPointerAtA = new CAppB;)..
when i compile..i have a compile error, which is..

--------------------Configuration: A - Win32 Debug--------------------
Linking...
ADoc.obj : error LNK2001: unresolved external symbol "class CBApp
BPointerAtA" (?BPointerAtA@@3VCBApp@@A)
A.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

it this two .exe, do no include any .lib files for me to do linking
setting..
when i try to enter B.obj file in the setting (Project->Settings-
>>Link),
If I interpret your posting right, you have two executables (two .exe files in
Win32 parlor) that do some stuff. These applications are written using
Microsoft's MFC library (a guess from the name CBApp), so you will most likely
have two classes CAApp and CBApp derived from CWinApp. Now you want to invoke a
member function of class CBApp inside the executable that uses CAApp. If this is
right, then you are violating against the design rules of the MFC library which
states that you have exactly one object of a class that is CWinApp or derived
from CWinApp (this object is usually declared as global variable, which can be
accessed by the MFC function AfxGetApp). The question you have to ask yourself
is whether CAApp needs functionality of CBApp that needs to access member
variables of CBApp (that means that the method will work only for CBApp
objects), or whether the CBApp method can be copied into the CAApp class. In the
first case, you have found some interdependencies between your executables that
need most probably very much attention (some means of inter-process
communication). In the second case, you can either a) copy the method into CAApp
and invoke it from there, or b) put the method into a new class which will serve
as base class for CAApp and CBApp (which would be SOP).

Regards,
Stuart
Aug 16 '07 #3
<lo***********@yahoo.comwrote in message
news:11**********************@q4g2000prc.googlegro ups.com...
Hi, I am new here..
I face problem when i try communicate two .exe together..
these two .exe i name it by App A and App B..
i try to call App A's function from App B's function..
i had create a App B's pointer at App A..name by BPointerAtA..
and i try to new this pointer ( BPointerAtA = new CAppB;)..
when i compile..i have a compile error, which is..

--------------------Configuration: A - Win32 Debug--------------------
Linking...
ADoc.obj : error LNK2001: unresolved external symbol "class CBApp
BPointerAtA" (?BPointerAtA@@3VCBApp@@A)
A.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

A.exe - 2 error(s), 0 warning(s)

it this two .exe, do no include any .lib files for me to do linking
setting..
when i try to enter B.obj file in the setting (Project->Settings-
>>Link),
when compile, more than 1 linking error occur..

is it anything that i miss up..??
pls help..
thank you..
A running .exe runs in its own environment, including memory. First off,
you don't have access to a running executables functions outside of the
executable. If you do need access to some shared functions, that is what
libraries are for. Now, it is possible to get App A to execute a function
and give the result to App B somehow. A common method is via sockets. Also
file IO, shared memory, etc.. have been used.

Now, it depends on what you are actually trying to accomplish to determine
what it is you need to do. So, what are you trying to accomplish by having
one app call a function in another app?
Aug 16 '07 #4
Ole Nielsby wrote:
BTW if you want to use standard c++, better get vc8 express,
it is closer to c++ standards than vc6 and you can have it for free.
I'm afraid that he'll have to stick to vc6 if he doesn't want to pay for vc8, as
he is using MFC. I don't know whether you can use MFC 6.0 with VC8 or not. If
you knew how, I'd be thankful for some advice, too.

Stuart

Aug 16 '07 #5
On 2007-08-16 10:11, Stuart Redmann wrote:
Ole Nielsby wrote:
>BTW if you want to use standard c++, better get vc8 express,
it is closer to c++ standards than vc6 and you can have it for free.

I'm afraid that he'll have to stick to vc6 if he doesn't want to pay for vc8, as
he is using MFC. I don't know whether you can use MFC 6.0 with VC8 or not. If
you knew how, I'd be thankful for some advice, too.
It's probably possible to get VC8 Express to work with the MFC files
from VC6, but a quick search gave no hints.

--
Erik Wikström
Aug 16 '07 #6

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

Similar topics

8
by: Zheng Da | last post by:
I don't know where should I ask the question, so send the email to this group. I choose this group, because I want to write the program with c++ :) I want to write a program which support...
13
by: Stumped and Confused | last post by:
Hello, I really, really, need some help here - I've spent hours trying to find a solution. In a nutshell, I'm trying to have a user input a value in form's textfield. The value should then be...
27
by: Sune | last post by:
Hi! Pre-requisites: ------------------- 1) Consider I'm about to write a quite large program. Say 500 K lines. 2) Part of this code will consist of 50 structs with, say, no more than at most...
7
by: Victor S. | last post by:
1. What is System.Windows.Forms.VisualStyles.TextMetricsCharacterSet good for? 2. Are the Indic scripts supported? Are all supported scripts fully supported? (for printing and fine measuring)...
88
by: Peter Olcott | last post by:
Cab you write code directly in the Common Intermediate language? I need to optimize a critical real-time function.
20
by: Newbie Coder | last post by:
MFC Application VC++.NET 2003 I have a certain registry key (HKCU\Software\MyKey) that contains between 30 & 64 string values I need to write a '*' to all those 30 - 64 string values under...
23
by: asit dhal | last post by:
hello friends, can anyone explain me how to use read() write() function in C. and also how to read a file from disk and show it on the monitor using onlu read(), write() function ??????
5
by: Immortal Nephi | last post by:
I would like to design an object using class. How can this class contain 10 member functions. Put 10 member functions into member function pointer array. One member function uses switch to call...
0
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.