How to use .Def File
-
Hello All, I am working on a legacy application , i am seeing it has some .Def file that is using to generate some cpp file and its used inside the same project. Can somebody help me in understanding how to invoke .Def file.
vikas da
-
These files are used to list the entry points that should be exported from the final library file. See -DEF (Specify Module-Definition File)[^].
Thank you so much
Richard MacCutchan
for reply. so project looks like this, project structure looks like this. it has a def file that has function to be exported, it has a generator.cpp that generates x.cpp file it has x.cpp file that expose some function that is used in other projects now first i have to use .def file to invoke methods in Generator.cpp to generate the x.cpp file and then compile the project so that the generated dll can be used by other application. what i am not aware of ...how to invoke Generator.cpp ...is there any parameter that i can tweak during compilation time so that it generate the CPP files first and then compile the DLL or any other possible way Thank you so much in advance
vikas da
-
Thank you so much
Richard MacCutchan
for reply. so project looks like this, project structure looks like this. it has a def file that has function to be exported, it has a generator.cpp that generates x.cpp file it has x.cpp file that expose some function that is used in other projects now first i have to use .def file to invoke methods in Generator.cpp to generate the x.cpp file and then compile the project so that the generated dll can be used by other application. what i am not aware of ...how to invoke Generator.cpp ...is there any parameter that i can tweak during compilation time so that it generate the CPP files first and then compile the DLL or any other possible way Thank you so much in advance
vikas da
-
I am sorry but it is impossible to guess what the build process is supposed to be. You need to find the person who set the project up in the first place.
-
Thank you Richard , the person has quit...:) i guess i would need some more time to understand this code.
vikas da
-
Sorry I cannot offer any better suggestions. But without seeing the entire project (which I do not want to do) it is difficult to make any useful guesses.
i am thinking to give some details ,:) my CPP file looks like this ... headers #ifdef _USRDLL #pragma comment(linker, "/EXPORT:GenerateFiles=?GenerateFile@@YGJPAUHWND__@@PAUHINSTANCE__@@PADH@Z") #endif __declspec(dllexport) HRESULT __stdcall GenerateFiles(HWND hwnd,HINSTANCE hinst,LPSTR lpCmdLine,int nCmdShow) { /// some code to generate CPP files exposing by the DLL } now can i invoke GenerateFiles method during build process some way ?
vikas da
-
i am thinking to give some details ,:) my CPP file looks like this ... headers #ifdef _USRDLL #pragma comment(linker, "/EXPORT:GenerateFiles=?GenerateFile@@YGJPAUHWND__@@PAUHINSTANCE__@@PADH@Z") #endif __declspec(dllexport) HRESULT __stdcall GenerateFiles(HWND hwnd,HINSTANCE hinst,LPSTR lpCmdLine,int nCmdShow) { /// some code to generate CPP files exposing by the DLL } now can i invoke GenerateFiles method during build process some way ?
vikas da