You can use std::basic_fstream for creating a log file. You can use open(), write() etc to write to the file. If multiple applications will use the log file, use some synchronization objects, for eg: Mutex.
Rems Kris
Posts
-
How to create log file and how it use? -
How to create and use a lib file ?Include the library in your project settings and specify its path in Additional lib path.
-
error LNK2001Yes.lib is available..Header everything is ok..
-
error LNK2001Thanks for your response. I've already added the lib.
-
error LNK2001Hi, I've created an ActiveX control. The Control class (***Ctl) in it should be derived from a class in another dll (which is also created by me). I want to load the ActiveX control dynamically in a container exe and check if the Ctl class is derived from the base class in the dll (This container is also created by me). The base class in the dll is called TusMacroOcxBase and it is derived from COleControl. The Ctl class in the ActiveX control which is derived from TusMacroOcxBase is called CTusSampleOcxCtrl. I decided to make use of CRuntime class's methods to check the class type information (Since COleControl is already derived from CObject). So I proceeded by using the DECLARE_DYNAMIC/DECLARE_DYNCREATE and IMPLEMENT_DYNAMIC/IMPLEMENT_DYNCREATE macros. I also enabled RTTI in the container exe. My problem is that when I write IMPLEMENT_DYNCREATE(CTusSampleOcxCtrl, TusMacroOcxBase) in CTusSampleOcxCtrl class's .cpp file, it gives error LNK2001. The error message is given below. TusSampleOcxCtl.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const TusMacroOcxBase::classTusMacroOcxBase" (?classTusMacroOcxBase@TusMacroOcxBase@@2UCRuntimeClass@@B) Here is the code snippet: Base class - .h class _declspec(dllexport) TusMacroOcxBase : public COleControl { public: DECLARE_DYNAMIC(TusMacroOcxBase) .... Base class - .cpp IMPLEMENT_DYNAMIC( TusMacroOcxBase, COleControl ) Derived class - .h class CTusSampleOcxCtrl : public TusMacroOcxBase { DECLARE_DYNCREATE(CTusSampleOcxCtrl) .... Derived class - .cpp IMPLEMENT_DYNCREATE(CTusSampleOcxCtrl, TusMacroOcxBase) I can solve the error easily by replacing IMPLEMENT_DYNCREATE(CTusSampleOcxCtrl, TusMacroOcxBase) with IMPLEMENT_DYNCREATE(CTusSampleOcxCtrl, COleControl), but I cant do that since I need to get the exact base class of CTusSampleOcxCtrl in the container exe. If I give COleControl there, I will get the base class as COleControl only. Is there any other way? I've tried different combinations of DECLARE_DYNAMIC/DECLARE_DYNCREATE and IMPLEMENT_DYNAMIC/IMPLEMENT_DYNCREATE also. Any help will be greatly appreciated. Thanks in advance, Rems.