I've a C++ application which is having many static ibs (*.lib) and DLLs. I'm creating an object in my EXE then i keep passing the pointer to this object from 1 library to another library using function calls.
During this process when this pointer moves from main EXE to DLL's function, i wanted to understand will it have any issue or do i need to take care any precautions.
Main.EXE with 3 static libs (A.lib, B.lib,C.lib) Main.EXE also links
with 2 DLL's - d1.dll, d2.dll. Each of these static library and DLL
also statically links to a static library X.lib.
Call Flow:
main() in main.EXE calls AFunc() in A.lib and passes a pointer to an object of some class X which is in X.lib.
Now AFunc() in A.lib calls BFunc() in B.lib & passes the "same pointer to an object of class X" which is in X.lib.
Now BFunc() in B.lib calls CFunc() in C.lib & passes the "same pointer to an object of class X" which is in X.lib.
Now CFunc() in C.lib calls D1Func() in D1.DLL & passes the "same pointer to an object of class X" which is in X.lib.
Now D1Func() in D1.DLL calls D2Func() in D2.DLL & passes the "same pointer to an object of class X" which is in X.lib.
My query is will the pointer passing across CFunc() in C.lib (part of main.EXE) AND the D1Func() of D1.DLL work ?
Aucun commentaire:
Enregistrer un commentaire