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

L

looi_sookchan

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-
when compile, more than 1 linking error occur..

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

regards,
shizu
 
O

Ole Nielsby

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.
 
S

Stuart Redmann

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-

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
 
J

Jim Langston

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-
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?
 
S

Stuart Redmann

Ole said:
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
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top