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