oh, and here's a link to the MB documentation. courtesy of Bo Thomsen a couple months ago.
http://www.mapinfo.com/common/docs/mapbasic/mapbasic_userguide.pdf -----Original Message----- From: Simmonds, Ashley (PTB) [mailto:[EMAIL PROTECTED] Sent: Wednesday, 9 July 2003 8:21 PM To: Mapinfo List Subject: RE: MI-L Solution to opening a workspace with VB yeah you're right there. unless this is gonna be a serious application which combines a lot of visual basic and mapping concurrently and interactively, it's not worth your while delving into the deep and mysterious world of integrated mapping. just use AppActivate and sendkeys for the simple stuff, until your app eventually grows out of it and you're forced to write a gazillion lines of code followed by 3 gazillion lines of error trapping. to answer your question, there is no Maximize method for the application itself, as it is not a mapinfo specific function, it is a windows thing, so you'll need to delve into API's and such and end up writing 10 times as much code to do something simple. like i said, not worth it unless you're getting serious. what version of MapInfo are you using? with MI 7 you can use the TOOLS, REFERENCES (or PROJECT, REFERENCES in VB) to select the MapInfo OLE Automation Type Library. this will expose many useful properties and methods, and is a lot less cumbersome and much more stable than assigning it to a variant object. the main methods available are just the one's you probly know about already, such as DO, EVAL, RUNCOMMAND, and RUNMENUCOMMAND, but you still have to know the specific syntax to parse through. the fun starts when you're parsing a mapbasic string which contains multiple strings through the DO method. it's a quote nightmare. have sent you a present. :) -----Original Message----- From: Jure Ravnik [mailto:[EMAIL PROTECTED] Sent: Wednesday, 9 July 2003 7:52 PM To: Mapinfo List Subject: Re: MI-L Solution to opening a workspace with VB Ashley, Your solution is definately better. One flaw though, when MI starts it is not maximized and it does not become the active application. I'd like to have MI open in front of my VB application and take focus. I know this is possible to achieve, but I don't have a list of methods which are supported by the Mapinfo object. I tried Mapinfo.Maximize=true, but it doesn't work. Is there any online resurce regarding the events, methods and properties of the Mapinfo object? Thanks, Jure. ----- Original Message ----- From: "Simmonds, Ashley (PTB)" <[EMAIL PROTECTED]> To: "Mapinfo List" <[EMAIL PROTECTED]> Sent: Wednesday, July 09, 2003 11:23 AM Subject: RE: MI-L Solution to opening a workspace with VB > not sure why you're instantiating then killing then shelling the mapinfo > object. it's effectively the same as opening mapinfo twice, then closing > down the first one. actually, you may find that you have two mapinfo's open > when doing that. check your TASK MANAGER to see whether you have multiple > MAPINFOW.EXE's eating up your resources. i remember from the pre MI 7 days > that dimming the object as a generic object rather than a > MapInfo.Application had some erratic effects that took a lot of error > trapping and checking to ensure everything was valid. > > after your createobject line you could just... > > ####################### > MapInfo.Visible = True > MapInfo.Do "Run Application " & Chr$(34) & Imef & Chr$(34) > ####################### > > this should have the same effect... off the top of my head. > > i'm assuming this isn't an integrated mapping application, just perhaps a > button on a form which is supposed to fire up mapinfo based on a werkspace > name listed in a text box or something? > > if you wanted to maintain a reference to the mapinfo object throughout your > application you could just omit the unsetting of the MapInfo object until > your app closes. as long as it's a public variable, you'll be able to have > other stuff in your app play with mapinfo too. > > but if that's the extent of what you wanted to achieve with this, then leave > your code as is, coz it werks. > > -----Original Message----- > From: Jure Ravnik [mailto:[EMAIL PROTECTED] > Sent: Wednesday, 9 July 2003 6:36 PM > To: Mapinfo List > Subject: MI-L Solution to opening a workspace with VB > > > Hi, > special thanks to Laurence and Robert. > With their help I've managed to write this: > > Dim PotDoMi As String > Dim Mapinfo As Object > Dim imef as String > > imef="C:\test.wor" > Set Mapinfo = CreateObject("MapInfo.Application") > PotDoMi = Mapinfo.eval("programdirectory$()") > Set Mapinfo = Nothing > MyAppID = Shell(PotDoMi & "\Mapinfow.exe " & imef, 1) ' Run Mapinfo. > AppActivate MyAppID ' Activate Mapinfo. > > which starts Mapinfo and loads the Test.wor workspace. > > Thank you > Jure. > > --------------------------------------------------------------------- > List hosting provided by Directions Magazine | www.directionsmag.com | > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > Message number: 7552 > > --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 7553 --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 7554 --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 7555
