Re: Runtime error in explorer.exe when right clicking with vim70f gvimext.dll installed

2006-06-17 Thread Bram Moolenaar

Mathias Michaelis wrote:

 first of all: THANKS!
 
  This issue is explained in MSDN in section about SxS - Side by
  Side Components.  I've attached patch against current
  GvimExt/gvimext.rc that would make resource compiler add manifest
  inside generated DLL - this is what is required to make it run on
  WinXP SP2 and Win2k3.
  
 I first tried your patch, but then the resource compiler complained
 he couldn't find a file named winres.h. I then restored the
 original files, applied the following patch to your patch, and then
 applied your patch again. This was a full success! The dll now
 worked! The patch that I had to apply to your patch was: Change the
 names winres.h -- winresrc.h:

[...]

I have seen a few messages on the subject.  Can someone merge everything
and send me a patch for the final solution?  I don't have this compiler
thus I can't try it out myself.

-- 
ZOOT:  I'm afraid our life must seem very dull and quiet compared to yours.
   We are but eightscore young blondes, all between sixteen and
   nineteen-and-a-half, cut off in this castle, with no one to protect us.
   Oooh.  It is a lonely life ... bathing ...  dressing ... undressing ...
   making exciting underwear
 Monty Python and the Holy Grail PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Runtime error in explorer.exe when right clicking with vim70f gvimext.dll installed

2006-05-29 Thread Mathias Michaelis
Hello Vim List

I have a similar problem with the final vim 7.0, if I try to compile
it with Microsoft Visual Studio 2005 Express Edition. I don't get a
runtime error, but simply get no Edit with vim ... context menu
entries when I right-click on any file.

 When I right click on a file in explorer I get an MSVC Runtime error
 dialog:

 msvcr80.dll is the problem, but it isn't that the dll is missing,
 gvimext.dll loads it from c:\windows\system32.  The problem is that
 gvimext.dll is loading the dll incorrectly (according to the error
 dialog). Obviously the source for gvimext.dll hasn't changed in a
 while, but I believe this means that the gvimext.dll can't be built
 against VC 8.0 until this problem is resolved. :/
 
 Try copying src\GvimExt\gvimext.dll.manifest to wherever you've placed
 gvimext.dll.
 
This was the first thing I tried. Then I checked with Dependency
Walker and saw that MSVCR80.DLL was now found. But in spite of
that: I got no context menus.

Then I tried

mt -outputresource:gvimext.dll -manifest gvimext.dll.manifest

to include the dll into the resources of gvimext.dll. That helped
nothing.

Then I tried to add a file/file session to gvimext.dll.manifest:

file name=gvimext.dll
  comClass
description=VIM Editor Context Menu Handler
clsid={51EEE242-AD87-11d3-9C1E-0090278BBD99}
threadingModel=Apartment/
/file

Helped nothing, independent of running mt.exe or not.

I am searching for solutions for days now, browsed all the msdn
library, but found nothing: gvimext.dll doesn't work when linked
against MSVCR80.DLL with Visual Studio 2005 Express Edition.

The only workaround is: I have to link gvimext.dll statically
against the C runtime library. Then, gvimext.dll needs about five
times more space on disk, but like that the context menu entries
appear although I hardly can't believe it any more %-]

Thanks in advance for any suggestions or hints!

With best regards

Mathias



Re: Runtime error in explorer.exe when right clicking with vim70f gvimext.dll installed

2006-05-29 Thread Ilya

Mathias Michaelis wrote:

Hello Vim List

I have a similar problem with the final vim 7.0, if I try to compile
it with Microsoft Visual Studio 2005 Express Edition. I don't get a
runtime error, but simply get no Edit with vim ... context menu
entries when I right-click on any file.
  

Solution to this problem partly depends on a Windows version you have.
  

When I right click on a file in explorer I get an MSVC Runtime error
dialog:



msvcr80.dll is the problem, but it isn't that the dll is missing,
gvimext.dll loads it from c:\windows\system32.  The problem is that
gvimext.dll is loading the dll incorrectly (according to the error
dialog). Obviously the source for gvimext.dll hasn't changed in a
while, but I believe this means that the gvimext.dll can't be built
against VC 8.0 until this problem is resolved. :/
  
Starting from Windows XP SP2 and Windows 2003, msvcr80.dll should be 
loaded from C:\WINDOWS\WinSxS\directory for the correct version of 
MSVCR 8.0\msvcr80.dll.  At least runtime linker now uses this 
approach.  This is part of Windows Side by Side Components subsystem.

Try copying src\GvimExt\gvimext.dll.manifest to wherever you've placed
gvimext.dll.

This would not work - DLLs does not use manifest files.  For a DLL 
manifest should be embedded as a resource inside the DLL itself.

This was the first thing I tried. Then I checked with Dependency
Walker and saw that MSVCR80.DLL was now found. But in spite of
that: I got no context menus.
  
This also happened to me - Dependency Walker reported that DLL could be 
found, but runtime linker fails to load the DLL.  Maybe, Dependency 
Walker does not load a DLL, just checks that it could be found using 
algorithm, that is outdated.

Then I tried

mt -outputresource:gvimext.dll -manifest gvimext.dll.manifest

to include the dll into the resources of gvimext.dll. That helped
nothing.
  
To include the manifest as a resource into the dll?  I don't know 
exactly why this was not working for you - maybe your manifest was wrong 
or maybe it was included with wrong resource id.

Then I tried to add a file/file session to gvimext.dll.manifest:

file name=gvimext.dll
  comClass
description=VIM Editor Context Menu Handler
clsid={51EEE242-AD87-11d3-9C1E-0090278BBD99}
threadingModel=Apartment/
/file

Helped nothing, independent of running mt.exe or not.

I am searching for solutions for days now, browsed all the msdn
library, but found nothing: gvimext.dll doesn't work when linked
against MSVCR80.DLL with Visual Studio 2005 Express Edition.
  


This issue is explained in MSDN in section about SxS - Side by Side 
Components.  I've attached patch against current GvimExt/gvimext.rc that 
would make resource compiler add manifest inside generated DLL - this is 
what is required to make it run on WinXP SP2 and Win2k3.  And you'll 
have to put these two manifests in GvimExt directory, resource compiler 
would embed one of them depending on build type.

The only workaround is: I have to link gvimext.dll statically
against the C runtime library. Then, gvimext.dll needs about five
times more space on disk, but like that the context menu entries
appear although I hardly can't believe it any more %-]

Thanks in advance for any suggestions or hints!

With best regards

Mathias
  


In case you compile and link gvimext.dll on Windows with installed 
Visual Studio 2005, then it automatically links DLL with the most recent 
version of MSVCR - 8.0.  This version is installed during VS 2005 
installation.  So, you would not be able to run this DLL on any other 
version of Windows, without installing new version of MSVCR.  There is a 
redistributable for this, on comes with VS 2005 itself.  VS 2005 even 
knows when it is required and can automatically (at least sometimes) 
merge this redistributable when you are creating an installation inside 
VS 2005.
?xml version='1.0' encoding='UTF-8' standalone='yes'?
assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'
  dependency
dependentAssembly
  assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' /
/dependentAssembly
  /dependency
/assembly
?xml version='1.0' encoding='UTF-8' standalone='yes'?
assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'
  dependency
dependentAssembly
  assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' /
/dependentAssembly
  /dependency
/assembly
Index: gvimext.rc
===
RCS file: /cvsroot/vim/vim7/src/GvimExt/gvimext.rc,v
retrieving revision 1.2
diff -c -r1.2 gvimext.rc
*** gvimext.rc  6 Mar 2006 23:16:53 -   1.2
--- gvimext.rc  21 Mar 2006 22:49:44 -
***
*** 2,7 
--- 2,14 
  //
  #include resource.h
  
+ #include winver.h
+ #if