I have often created C++ dll that export mathematical functions to C# or c++ .
However now I must have a C++ dll that can export a function to C# or c++ such as
mygraph(double xpointsin[],double ypointsin[],string xaxistitle, string yaxistitle, int numpointsin, double xpointsout[],double ypointsout[], int numpointsout);
There is already existing code in a c++ executable to do the drawing with the OnDraw method in a class called graphv.cpp which inherits from CView and is managed as DECLARE_DYNCREATE(graphv) and IMPLEMENT_DYNCREATE(graphv,CView). The drawing is done with the OnDraw method (CDC *pDC), and ASSERT pDOC->GetDoc();
How can I reorganize the code in the C++ .exe and rebuild as a C++ dll? Can you provide me a simple example, like code that does a simple LineTO with the *pDC pointer?
What I have looked at , but cant get to work with a CView , is a similar issue with a CDialog inherited class in a dll. There I can create an object of the CDialog class such as mycdlog. I can then decorate this object and call the DoModal method on the object which throws up a visual dialog to the screen. However CView inherited class seems to work differently needing DYNCREATE and messages to force an update to call the OnDraw.
The view will only be up when the c++ dll has assumed control from the calling program. IN the dll the user will add and move existing points, and hit the escape key to close the view and return control to the calling program.
Can you show me a simple dll that can do a LineTo between a pair of points?
As stated above, I have an existing C++ dll that exports a CDialog inherited function. In export.h I have a __standard dllexport statement such as int dlogout(file path... etc). In the export.cpp I instantiate an object of the CDialog inherited class Crudedlg : CDIalog by stating Crudedlg myobject; Then I can apply the DoModal method against myobject.
However the graphv class graphv :CVIew seems controlled by DYNCREATE so I cannot directly instantiate a graphv object such as mygraphobj update the members and then force an .mygraphobj.OnDraw also the OnDraw method needs a CDC pointer *pDC , how would I get that pointer?