Hi,
i'm using c#.net, i made a wrapper for the ocx
Visual Studio prompt:
aximp <ocx-file> /source /keyfile:<key-file>
the key doesn't matter, output are two files
1. AxMapPoint.dll
2. MapPoint.dll
First i got the Problem that the ActiveX needed
a parent
using AxMapPoint;
AxMappointControl mapPoint = new AxMappointControl();
form1.Controls.Add(mapPoint);
mapPoint.NewMap(2);
if you use something like this on a simple Form it's no problem.
I made a class for using the Control and want to
use it for calculation even without displaying.
i got a form, simply said MyForm form1 = MyForm()
then i give the ControlCollection of the Form.Panel to the Class
an do following things (ControlCollection controls):
AxMappointControl mapPoint = new AxMappointControl();
controls.Add(mapPoint);
mapPoint.NewMap(2);
...
form1.Show(); //not in the class, just to show that i try to display
the form afterwards
On the NewMap() Operation it bangs.
Little bit of testing showed that if i make the Form Visible and
do Operations like NewMap and Calculate everything works
finy, but as soon as the form isn't visible no Operation works.
It's not the problem that something crashs but i want to
calculate distances of Routes even without displaying.
Additional:
First i used an Activator to call MapPoint.Application.EU.13
and did InvokeMember calls to use it, calculation and
everything works fine, but i can't display it. 2 Ways of doing
things for each part but they don't work together. I read
about the object model but in c#.net there is just a
Application interface, can't figure it out how this should work.
I think that i use the object model with the Activator but
little do i know ^^.
(can't paste the whole code because of interfaces, factory
and other stuff that i need for the project to make
mappoint an optional part, but the problem is quite simple)
I would like to use the OCX without displaying the Form
but can't find a solution. Thanks for help.