thientung / winforms-geplugin-control-library

Automatically exported from code.google.com/p/winforms-geplugin-control-library
GNU General Public License v3.0
0 stars 0 forks source link

Attempted to read or write protected memory. This is often an indication that other memory is corrupt #34

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile the FC.GEPluginCtrls
2. Embed it my application
3. Run outside of VS 2010

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
Visual Studio 2010

Please provide any additional information below.

Hi when I compile the FC.GEPluginCtrls and use it my application, I get the 
following error when running out side of Visual Studio 2010

"Attempted to read or write protected memory. This is often an indication that 
other memory is corrupt"

Original issue reported on code.google.com by acm...@gmail.com on 28 Jun 2010 at 1:24

GoogleCodeExporter commented 9 years ago
Hi, could you let me know which OS you are using? e.g. Vista 64bit, Win7 32bit, 
etc.
Also, you say that it fails outside VS - can I ask, does the application run in 
the debugger OK? Thanks, F. 

Original comment by fraser.c...@gmail.com on 28 Jun 2010 at 2:19

GoogleCodeExporter commented 9 years ago
Windows XP 32 bit

Original comment by acm...@gmail.com on 28 Jun 2010 at 2:24

GoogleCodeExporter commented 9 years ago
Runs in Debug mode. When I try to publish, it sayes file XMLFile1.xml is missing

Original comment by acm...@gmail.com on 28 Jun 2010 at 2:25

GoogleCodeExporter commented 9 years ago
Hi, there is no file in the project called XMLFile1.xml. I guess you must have 
added this yourself somewhere - I would suggest you search for "XMLFile1.xml" 
to find the reference. 

As for the protected memory issue, simply delete the reference to the GEPlugin 
Type Library (GEPlugin) for the project in Visual Studio. Once this is done, 
re-reference GEPlugin to the project. 

This process forces visual studio to use tlbimp.exe to convert the latest 
version of the plug-in type library on your machine.

Original comment by fraser.c...@gmail.com on 28 Jun 2010 at 9:12

GoogleCodeExporter commented 9 years ago
Thanks for all the help. I did as you suggested and still get the memory error. 
After the error, the plugin loads (Google Earth) but all the controls are not 
enabled and the tree view doesnt load. Thoughts

Original comment by acm...@gmail.com on 29 Jun 2010 at 11:26

GoogleCodeExporter commented 9 years ago
Hi, I updated the source last night, please check it out and recompile....The 
memory error is 100% due to the version difference in the dll. Also, you need 
to set the browser instance (SetBrowserInstance) on the various controls for 
them to work with the GEWebBrowser. See the geWebBrowser1_PluginReady method in 
the example form: 
http://code.google.com/p/winforms-geplugin-control-library/wiki/ExampleForm

Original comment by fraser.c...@gmail.com on 29 Jun 2010 at 12:13

GoogleCodeExporter commented 9 years ago
Ok I will give it a try. By version difference do you mean FC.GEPluginCtrls.dll 
or 
GEPlugin.dll?

Original comment by acm...@gmail.com on 29 Jun 2010 at 1:41

GoogleCodeExporter commented 9 years ago
Hi, I mean there is a difference between the version of the Google earth plugin 
installed on your machine and the one referenced in the FC.GEPluginCtrls 
project. As I indicated the best way to resolve this is to.

1) Open a copy of FC.GEPluginCtrls in visual studio.
2) Remove the reference to the GEPlugin Type Library from the references folder.
3) Build the project (this will cause errors saying "The type or namespace 
GEPlugin could not be found"
4) Re-add the reference to the GEPlugin Type Library in the references folder. 
This can be done by; right clicking on references, choosing add reference, 
click on COM tab, then double clicking on GEPlugin Type Library in the list.
5) Finally, rebuild the solution.

Once this is done the version referenced by the solution and the version 
installed on your machine will be identical and the protected memory issue will 
be gone.

On this note I am considering re-factoring the FC.GEPluginCtrls project to use 
late (rather than early) binding to make it independent of the plug-in version 
installed on the users machine.

Original comment by fraser.c...@gmail.com on 29 Jun 2010 at 1:58

GoogleCodeExporter commented 9 years ago
hmm I tried all your suggestions. The program runs fine on my computer, but not 
my co-workers...

I am about ready to give up :( 

It's a great set of controls you put together. I wish I could resolve the 
problem

Original comment by acm...@gmail.com on 29 Jun 2010 at 3:19

GoogleCodeExporter commented 9 years ago
I guess the version plug-in version on your co-workers machine is different 
than yours. Have them remove and reinstall the Google Earth Plugin to make sure 
they are using the latest version.

Original comment by fraser.c...@gmail.com on 29 Jun 2010 at 4:00

GoogleCodeExporter commented 9 years ago
Thanks for your help. The plugin versions were different. Now the only problem 
is that the overlays stop working. If I create a kml with google earth, like a 
polygon, the FC.GEPluginCtrls doesnt show the polygon. Sample attached.

Original comment by acm...@gmail.com on 2 Jul 2010 at 4:36

Attachments:

GoogleCodeExporter commented 9 years ago
Hi, you would need to add the kml to the plug-in once it has loaded...

Original comment by fraser.c...@gmail.com on 5 Jul 2010 at 6:15

GoogleCodeExporter commented 9 years ago
Hmmm I did. When I load the kml into the plugin, Google Earth goes to the long 
lat, but doesn't show the polygon. It was working until I updated to the latest 
version of the plugin. I think this might be a bug with the plugin.

I think I am going to scrap the plugin idea. If I need to compile the 
application with the same version as the client's version, it will me a 
nightmare to manage. This is why Apple doesn't allow 3rd party APIs... Now I 
see why. 

Original comment by acm...@gmail.com on 5 Jul 2010 at 8:58

GoogleCodeExporter commented 9 years ago
You can use the version-independent library then. check out: 
http://code.google.com/p/winforms-geplugin-control-library/source/browse/#svn/br
anches/dynamic

As this dynamic version uses late binding to the COM object it will work with 
any version of the plug-in. I plan to update the main source to this branch 
once I have fully tested it. That said it works well so far with no errors.

Original comment by fraser.c...@gmail.com on 5 Jul 2010 at 9:25

GoogleCodeExporter commented 9 years ago
...I have merged the dynamic version to the trunk and have updated the test 
application . The project is now version independent of the Google Earth 
Plug-in :) 

Original comment by fraser.c...@gmail.com on 5 Jul 2010 at 11:18

GoogleCodeExporter commented 9 years ago
Thanks. I appropriate all the help.

Original comment by acm...@gmail.com on 6 Jul 2010 at 12:49

GoogleCodeExporter commented 9 years ago
Just to follow up. I reported the bug about the polygons not showing up in the 
plugin. The bug has been confirmed:

http://code.google.com/p/earth-api-samples/issues/detail?id=488

Once again, thanks for all your help!

Original comment by acm...@gmail.com on 8 Jul 2010 at 6:15