hello
this is the way i built my dll , i don't know if it is right ot not , i could not figure out how to make your solution work .
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\RUNCLASS.h"
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\RUNCLASS.cpp"
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\Libs.h"
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\Shader.h"
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\Shader.cpp"
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\Camera.h"
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\Camera.cpp"
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\Model.h"
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\Model.cpp"
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\Texture.h"
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\Texture.cpp"
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\Window.h"
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\Window.cpp"
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\Light.h"
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\Light.cpp"
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\Mesh.cpp"
#include "C:\Users\pouya\source\repos\Clonident\Project_Theis\Mesh.cpp"
//C:\Users\pouya\source\repos\Clonident\Project_Theis
extern "C" __declspec(dllexport) void Take_snapShot(const void* pbuffer, size_t plenght, std::vector<float> angoli, std::string output_path, float Increase_scale, bool _x_axis, bool _Y_axis, bool _Z_axis)
{
RUNCLASS RC(pbuffer, plenght, angoli, output_path, Increase_scale, _x_axis, _Y_axis, _Z_axis);
RC.snapshot_wih_loop_in_memory_output_path();
}
|
plus , as i mentioned , the opengl c++ app , utilizes external dlls itself , i just add those dependencies the same way to the dll project , in properities/ c/c++ and linker
-----------------
on the c# side :
1 2 3 4 5 6 7 8 9 10 11 12
|
[DllImport("C:\\Users\\pouya\\source\\repos\\Clonident\\Release\\Clonident_DLL.dll")]
public static extern void Take_snapShot(System.String pbuffer, System.UInt32 plenght, Array angoli, string output_path, float Increase_scale, bool _x_axis, bool _Y_axis, bool _Z_axis);
string filePath = @"C:\Users\pouya\source\repos\Clonident\Project_Theis\Models\MaxillaryPreScan.stl";
byte[] my_file = File.ReadAllBytes(filePath);
// list
float[] lst_num = new float[5] { 10, 40, 200, 800, 890 };
Take_snapShot(Encoding.Default.GetString(my_file), (uint)my_file.Length, lst_num, "_dll_tst.jpg", 10, true, true, true);
|
--------------------
- the dll file of the project is placed in the Release folder of the project.
- i don't know if the dependencies should also be in Relase folder or not ( they are headers and .lib files )
- the opengl uses opengl in linker as an external library ( plus a bunch of other dlls ) , the dll also need to make use of them .
- i have iimplemented a simple math operation using this approach and it workd , agian , your solution seems hard to me since i don't understand it
- please provide the name of your approach , what should i search on the net to find a more detailed solution
Thanks