MySQL compiling

Topics: Bugs
Jul 14, 2011 at 2:13 PM

Hi Radioman,

Strangely I had a problem using the default SQLite settings. My app needs to be compiled with 32bits, so I changed the core into that. Rebuild the core, wpf and demo. The demo works on my machine (win 7 prof). When I transfer all the files to a laptop (win 7 home) all is ok. Next I incorporated the assemblies in my .net 4 app. Works ok on my machine, but not on the laptop. The laptop is saying "no sqlite.dll" (I didn't reference a sqlite in my app and there was indeed no dll present). I tried all my sqlite.dll on my machine on the laptop (and with x64/x86 subdirs), without any luck. I guess it has to do with the sqlite incorporated into the resources. Many years ago I also had some problems unpacking data from a resource at one of my users. Anyway I couldn't find the reason.

So I decompiled with the MySQL settings. There are a couple of errors then. You see them yourself and they are easy to fix.
Eg this is an example for MySQLPureImageCache.cs:
public bool PutImageToCache(MemoryStream tile, MapType type, GPoint pos, int zoom) => type has to become int

 if(GMaps.Instance.ImageProxy != null)
 MemoryStream stm = new MemoryStream(tile, 0, tile.Length, false, true);
 ret = GMaps.Instance.ImageProxy.FromStream(stm);
if(ret != null)
ret.Data = stm;
will become:
if (GMapProvider.TileImageProxy != null)
 MemoryStream stm = new MemoryStream(tile, 0, tile.Length, false, true);
 ret = GMapProvider.TileImageProxy.FromStream(stm);
 if (ret != null)
 ret.Data = stm;

 Using MySQL my app works again. Once again thanks for GMap,

Jul 14, 2011 at 2:22 PM

new version doesn't require setting targets or deploying folders or recompiling anything, all is automatic and targetng .net4 doesn't need any configs too ;} as for mysql, i'll fix it

Jul 14, 2011 at 2:33 PM

I read the discussions here. My best guess is that the unpacking of the resource fails. As I couldn't find the source I can't provide you more help how to solve my problem. Like I said I had this many years ago with a .net v2 application using data extraction from a resource; it worked everywhere except at one environment.

Jul 14, 2011 at 2:39 PM

hm, can you make a debug version and see the actual exception?

Jul 14, 2011 at 3:19 PM

The strange part is that the demo works, but not with my app. I have an old 3rd party component in it, which I believe uses a .net wrapper around its dll/ocx (I will get rid of that component and I'm evaluating other products). It uses ado/sqldrivers (but I don't know how), and I think there is a conflict. Before you incorporated sqlite (say a month ago) into Gmap I could reference both components on my home pc (xp 32bits) in Visual Studio, but not at my office (win 7 64 bits). VS reported conflicts with the sqlite drivers. Now VS reports no errors, but running the app on (that) another machine gives the dll not found error.

I do use CurrentDomain_AssemblyResolve btw. A component I'm using makes use of a fuscator and it crashed because I used that event (they fixed their fuscator).

But please don't put any effort in solving my problem. The MySQL workaround is ok.