georeference.org
Subscribe to this thread
Home - General / All posts - VB.Net and forms
cperret36 post(s)
#09-May-06 03:31

I want to developp a form under Manifold 6.5 using VB.Net language. I'm trying to find some samples or information to init and access to the properties and components inside this form (text, list, button...) but i don't find any.All are in VBscript which is a little bit different. Is anybody has experienced Forms developping in this situation and could provide some easy samples of VB.Net script FORM under Manifold (i don't want to use VS). thanks in advance

howardt
129 post(s)
#09-May-06 09:22

I appreciate you bringing this up. I seek to learn how to do the same. (use script components and forms with vb.net language and the script is a component under a manifold .map file). Almost all the examples we see are VBscript.

I have used vb.net (vb2005) with the manifold mapcontrol application that is available via down load. I developed under Visual Studio (VS). Having VS, the debugger, intellisense was very helpful in developing applications.

adamw


4,661 post(s)
#10-May-06 22:28

There are several ways of creating custom forms in Manifold:

1. You can use form components. This way, you create a form component and insert the desired event handlers such as Button_Click into the attached script component. This is only available for non-.NET scripts, that is, VBScript and JScript.

2. You can use COM objects. This way, you create a COM object using the language and technology of your choice (VC++ / ATL, VC++ / MFC, VC++ / raw Win32 API, VB 6, VB .NET / WindowsForms, C# / WindowsForms, anything else), and call that COM object from within a script. This is available for both non-.NET and .NET scripts.

3. You can use various system and third-party libraries to build a form on the fly using code. For example, you can use WindowsForms to build forms in .NET scripts.

Example:

'VB .NET

Imports Manifold.Interop.Scripts

Imports System

Imports System.Drawing

Imports System.Windows.Forms

Class Script

  Shared Sub Main

    Dim f As New MyForm

    f.ShowDialog

  End Sub

  Class MyForm

    Inherits Form

    Public Sub New

      Dim b As New Button

      b.Location = New Point(20, 20)

      b.Text = "Say Hello"

      AddHandler b.Click, AddressOf B_Click

      Controls.Add(b)

      Text = "My Form"

    End Sub

    Private Sub B_Click(ByVal _sender As ObjectByVal _args As EventArgs)

      MessageBox.Show("Hi")

    End Sub

  End Class

End Class 

KlausDE


3,189 post(s)
#09-May-06 22:44

In addition to Howardt's experiance with vb2005: Why don't you want to use vb for development? If you don't like a dll in the end then you stil could rebuild the design of the form in Manifold and copy all the tested code to a manifold script.

cperret36 post(s)
#10-May-06 01:21

It is mainly because i don't have information about Manifold DLL. Is there any object model for the vb.net manifold dll ? I didn't find either the manifold mapcontrol application. Could you tell me where i can download it please ? thanks

KlausDE


3,189 post(s)
#10-May-06 03:26

You don't even need to know that it's called Ext.dll and contains the mapcontrol and all the rest of the object model. Open a project in VB, add a reference to the COM component 'Manifold System Type Library' and add the 'Manifold MapControl Object' from the General section of the ActiveX Toolbox to your form. The Oject Browser then presents the MapControl under AxManifold.Interopt and the rest of Manifold under Manifold.Interopt.

howardt
129 post(s)
#16-May-06 13:24

What is different with Manifold 7 and using Mapcontrol? Has other usrs encounted success wth the mapcontrol and Manifold V7

My vb2005 programs are not working with Manifold V7. Visual Stuio 2005 is not finding the mapcontrol object so all refrences are generating errors.

I attempted add the reference to the (v3) Manifold System Type Lib. That seems to be OK. The Manifold MapControl is a no show on the toolbox.

I attempted CHOOSE ITEMS ... Com OBJECTS and selected the Manifold mapcontrol object. Still I do not see the object on the tool box.

I was thinking that if I deleted the mapcontrol object from my form and then re-added the map control object, the problems would be resuolved. I cannot get get a reference to the map control object to work.

WillH


1,415 post(s)
#16-May-06 16:35

When you add the control to the toolbox, it will be added to whatever grouping you right clicked on to add it. Given this, it may be hidden from sight.

I'm looking at the control in one of my addins running in v7.00; so it is working fine.

Under references, do you see AxInterop.Manifold and is it set to Copy Local?


Will Howell

howardt
129 post(s)
#17-May-06 19:52

If I start a brand new VB project, I get what you describe above. After I set a reference to Manifold System Type, this reference property 's local copy = false.

I then add the com mapcontrol. MaControl appears on the tool bar. I add the mapcontrol to a form, the projecct then has AxManifold refrences with local copy=true.

When I open a vb project with an exisiting mapcontrol component on a form (which was built with v6.5 and it worked), the references to both AxManifold and to Manifold are lost. VS2005 project explorer shows the warning symbols in the refrences to AxManifold and to Manifold.

So, in the existing VB project that use to work, I removed the refrences to Manifold and also removed the refrences to AxManifold. I add a refrences to Manifold. This seems to work fine. It is added, shows in project explorer. Tons of compiler errors get corrected.

Then I click on General in the Tools, ADD ITEMS, go through the dialogue to add the mapcontrol component. It does not show up in the tools.

adamw


4,661 post(s)
#25-May-06 05:59

I have replied in this thread.

howardt
129 post(s)
#10-May-06 07:41

I needed to do one added step to KlauseDE's instructions below.

After you add the reference and before adding the MapControl to your form ...

Right Click on the Tool box general section, in the context menu select CHOOSE ITEMS ... click the COM COMPOENTS tab, check the box Manifold MapControl OBject

That placed the mapcontrol on my tool box so that I can select it and place it ona form.

cperret36 post(s)
#10-May-06 08:12

Thanks for the details...I might use it for the moment ! hoping that the VB.net development module will improve in the next future with Manifold !

jjamjatra38 post(s)
#11-May-06 10:52

You wrote.."Why don't you want to use vb for development?"

Do you mean VB6, VBScript, or VB.Net?

I would like to extend cperret3's question and howardt's question a bit further...

I want to use the latest Visual Studio 2005 to develop ASP.NET web forms that call upon Manifold to render maps. I do not see any value in attempting to create "script" objects using the Manifold 6.5 GUI. That is very old technology and removes all the advances of several versions of Visual Studio.

Are there any examples anywhere of this being done with modern ASP.NET server side languages? It does not really matter if Manifold is an unmanaged COM object but if the EXPORT (to web page) facility of Manifold were to offer something besides Javascript that would be ideal.

adamw


4,661 post(s)
#12-May-06 07:33

I think Klaus was referring to VB .NET. It is relatively easy to do 99% of all development in VB .NET (or C#, or managed C++), living in Visual Studio, and limit Manifold scripts to mere calls of external objects in one or more .NET DLLs.

As regards ASP .NET, the web pages exported by Manifold are mostly old-style ASP code. If you want to leverage the full power of ASP .NET, right now you have no choice but to roll out your own framework. I remember seeing at least one such framework on the old forum (we really have to add search facilities to this forum site, I know). This is certainly one area that we look into improving in the future.

42 msec Copyright (C) 2007-2008 Manifold.net. All rights reserved.