Problems with x64 using Visual Basic Express Edition

Aug 5, 2010 at 11:31 AM
Edited Aug 5, 2010 at 11:34 AM

Dear Radioman,

I can't get GreatMaps to work with Windows 7 64-bit edition. I've downloaded the changeset 23f575a70f8d, made some adjustments to fit it to my needs, imported it in my program and tried to run it, without success. The demo is working fine, but when I add the control to my application, it doesn't work anymore. When I create a new application with the GreatMap as only control in it, it doesn't work either.
I get a nice form with the text "This program has stopped working" and the following info.


Description:
Stopped working

Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: p2000 monitor.exe
Problem Signature 02: 3.0.0.0
Problem Signature 03: 4c5a88c3
Problem Signature 04: P2000 Monitor
Problem Signature 05: 3.0.0.0
Problem Signature 06: 4c5a88c3
Problem Signature 07: 3
Problem Signature 08: 6
Problem Signature 09: System.NullReferenceException
OS Version: 6.1.7600.2.0.0.256.1
Locale ID: 1043

Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt


 

When I add an UnhandledException handler I get some more info, the exception message and stacktrace:


Er is een fout opgetreden bij het maken van het formulier. Zie ExceptionInnerException voor details. De fout is: Could not load file or assembly 'GMap.NET.WindowsForms, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
at WindowsApplication1.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 197
at WindowsApplication1.My.MyApplication.OnCreateMainForm() in C:\Documents and Settings\Thomas\Bureaublad\P2000 Monitor\P2000 Monitor\My Project\Application.Designer.vb:line 37
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()


 

Everything works fine at Windows XP 32-bit. I already set the reference in GMap.NET.Core to the x64 version of System.Data.SQLite, set the platform to x86 and set the compilation symbols in GMap.NET.Core to "MONOdisabled; MySQLdisabled; MsSqlCe" (I hope that's good?).

Do you have any clue about what's happening here? I personally think it's a problem in the SQL-stuff, because I can't find anything weird in GMap.NET.WindowsForms and that one references to GMap.NET.Core and his SQL references, so... But I'm really out of ideas. Do you have any?

With kind regards,
Thomas

Coordinator
Aug 5, 2010 at 3:28 PM

 if you use x64 sqlite dll, your target must be also x64, but you can still use x86 dll in x64 environment if you target x86

..and you don't need symbol of MsSqlCe if you use sqlite, you can use it if you do not want to use sqlite(wrong way to go) ;}

Aug 5, 2010 at 4:14 PM

Thanks for your reply. I tried it, but it doesn't seem to change anything, I still get the same error.

I made another guess, I added the unmodified version of GMap.NET.WindowsForms and GMap.NET.Core to a new WindowsApplication and tried to run it on Win7. It gives me the same error as the first one. The demo still works fine, but as soon as I use it in my (vb.net) project, I "load a program with an incorrect format."

Aug 5, 2010 at 4:53 PM

Got it! Some Googling yesterday made clear that "an incorrect format" means that a 64-bit exe loads a 32-bit dll orvice versa. It seems my Visual Basic Express Edition doesn't have a Configuration Manager (As the Visual C# Express Edition has), so I had to manually edit my .vbproj-file (as described here ) to make it work on x86. Thank you for pushing me in the right direction, it seems solved now =).

Coordinator
Aug 6, 2010 at 2:15 PM
great! ;}