Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 8 of 8

Delphi-MapPoint Type Library

This is a discussion on Delphi-MapPoint Type Library within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi EveryBody I'm trying to use MapPoint Inside my delphi application. I've read this very useful article: Using MapPoint In ...

  1. #1
    micheln is offline Junior Member Yellow Belt
    Join Date
    Jan 2007
    Posts
    16

    Delphi-MapPoint Type Library

    Hi EveryBody

    I'm trying to use MapPoint Inside my delphi application. I've read this very useful article: Using MapPoint In Delphi : it did work two months ago, but it does no more now!!

    I followed all the instructions in the article, but when I try to run my application, I get the following error:
    Code:
     [Pascal Error] MyProject.dpr(14): E2018 Record, object or class type required

    Here is the code of Myproject:

    program MyProject;

    uses
    Forms,
    Main in 'Main.pas' {FrmMain},
    MapPoint_TLB in 'MapPoint_TLB.pas';

    {$R *.TLB}

    {$R *.res}

    begin
    Application.Initialize;
    Application.CreateForm(TFrmMain, FrmMain);
    Application.Run;
    end.

    Besides, I can't find the activex tab in the component palette (neither MapPoint's TMap & Co, wherever I try to import the TLB?)
    Where am I mistaking?
    Do I have to start BDS in .Net Personality to use MapPoint?

    Thnk u for your help

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Delphi-MapPoint Type Library

    Hi,

    You dont have to include the TLB in your project. It only has to be in the uses clause of the units that really use it.

    Line 14 is Application.Run ?
    If so the the form's constructor runs without errors (but the problem can be over there as well).

    Set some breaks in the begin of the following events of your main form:
    FormCreate
    FormShow
    FormActivate

    Also if you post custom messages in the FormCreate event you should set a break there as whell. Then you come to the line of the offending code.

  3. #3
    micheln is offline Junior Member Yellow Belt
    Join Date
    Jan 2007
    Posts
    16

    Re: Delphi-MapPoint Type Library

    Quote Originally Posted by Wilfried View Post
    Hi,

    You dont have to include the TLB in your project. It only has to be in the uses clause of the units that really use it.

    Line 14 is Application.Run ?
    If so the the form's constructor runs without errors (but the problem can be over there as well).

    Set some breaks in the begin of the following events of your main form:
    FormCreate
    FormShow
    FormActivate

    Also if you post custom messages in the FormCreate event you should set a break there as whell. Then you come to the line of the offending code.
    Again: thnk u a lot

    I'm still learning so sorry for the 'wired' questions
    I'll do that right now.
    The problem is that I remember I Used to drag & drop the TMap component from the component palette on my forms and 'handle it' by code.
    Now, it's no more possible: why that? I'm using BDS 2006 and mappoint 2006 (I tested it for the first time with BDS 2005 and MapPoint 2004): does this make any difference or explain the problem?

  4. #4
    micheln is offline Junior Member Yellow Belt
    Join Date
    Jan 2007
    Posts
    16

    Thumbs up Re: Delphi-MapPoint Type Library

    That's AWESOME

    I just solved my problem (almost).

    The fact is that I tried to import the TLB in the project (and was automatically included in the current project). I did't included Mappoint_TLB in the units.

    But I still can't find TApplication, TMap in the component palette.
    Anyway, I use mappoint with the OleContainer and IT ROCKS

    If I manage to make a useful application (hopefully), I'll share it here.
    Again: THANKS EVERYBODY: this forum is GREAT.

  5. #5
    micheln is offline Junior Member Yellow Belt
    Join Date
    Jan 2007
    Posts
    16

    Arrow Re: Delphi-MapPoint Type Library

    I Still can't find <TApplication> in the component palette: any idea of why the problem? (If I can't figure out the problem, how will I find the solution )

  6. #6
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Delphi-MapPoint Type Library

    Hi Michel,

    Anyway, I use mappoint with the OleContainer and IT ROCKS
    This is already great news

    But I still can't find TApplication, TMap in the component palette.
    I don't know. I stopped upgrading Delphi. Latest version I have is Delph7 and this one does not work with the ActiveX component, only the object model. But if it is not in the component pallette then, in my version it is 'import - activeX' or something...

  7. #7
    danmincu is offline Junior Member White Belt
    Join Date
    Nov 2007
    Posts
    3

    Re: Delphi-MapPoint Type Library

    Just move the *_TLB.pas file higher(top) in the DPR uses clause and you will get rid of "E2018 Record, Object or class type required" error.

  8. #8
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Delphi-MapPoint Type Library

    Hi,

    Quote Originally Posted by danmincu View Post
    Just move the *_TLB.pas file higher(top) in the DPR uses clause and you will get rid of "E2018 Record, Object or class type required" error.
    Thanks for the reply. You right. Probably it is the conflict because Delphi has already an Application object, and now mappoint jumps in with an object of same name. Delphi search uses clause from bottom to top, so moving it solves.

    You can also solve it by renaming the Application object to something else in the TLB. This was what I did. I think I called it _Application or __Application

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. MapPoint Library Redistribution
    By Hamaze in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 02-24-2005, 01:38 PM
  2. mppoint object library
    By Anonymous in forum MP2K Magazine Articles
    Replies: 1
    Last Post: 10-21-2004, 07:19 AM
  3. I can't find the MapPoint COM library
    By Anonymous in forum Bing Maps and MapPoint Web Service
    Replies: 4
    Last Post: 10-05-2004, 07:16 AM
  4. How do you read from a FindResults type in delphi?
    By matt1168 in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 02-27-2004, 08:57 AM
  5. Control vs. Object Library
    By Labtek in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 05-24-2003, 01:39 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96