The program used to do fine. Then I upgrade to Windows 10 and now I have these 2 error when running the program in Visual Studio.
Warning 1 : Cannot find wrapper assembly for type library "Microsoft.mshtml". Verify that (1) the COM component is registered correctly and (2) your target platform is the same as the bitness of the COM component. For example, if the COM component is 32-bit, your target platform must not be 64-bit.
Error 2 : Unable to open module file "C:\Users\jim2\AppData\Local\Temp.NETFramework,Version=v4.0.AssemblyAttributes.vb" : The system cannot find the file specified.
Basically, my code builds fine when I was in windows 7. I upgraded to windows 10 and then I got this error.
I've checked C:\Users\jim2\AppData\Local\Temp\ folder.
There is no file .NETFramework,Version=v4.0.AssemblyAttributes.vb. I don't know how it happened in Windows 7. In Windows 7, before I upgraded, the program compiled just fine.
It seems that this issue is about files that are not there, but searched by project. After deleting it from project the files got created. Now, I still have the same problem.
I guess you are referencing INTERNET EXPLORER which is NOT installed into that Windows 10. The default browser is EDGE and probably the called function of IE is not present in that new browser.
Your question needs more details...
UPDATE:
The Microsoft.mshtml.dll file is a PIA file (from Office). You can try one of these solutions (it may vary sometimes from machine to machine):
1) remove Microsoft.Mshtml.dll reference from your project.
2) Use ADD REFERENCE, NET, select the PIA file
3) In DLL properties, set the COPY LOCAL = TRUE.
But, if the system reports "The module is not signed", you may also try:
1) remove Microsoft.Mshtml.dll reference from your project.
2) Use ADD REFERENCE and choose BROWSE.
3) Point to "C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies" (it depends of x32/x64 systems) and select directly the microsoft.mshtml.dll file.
4) Set the COPY LOCAL = TRUE too.
I just want to add to David BS answer.
It seems that the original microsoft.mshtml is gone in windows 10 and deleting and referencing it works. No need to set copy=true, etc.
I am using version 7.0.3300.0
Related
I am working with SDL2 and its add-on libraries SDL2_image and SDL2_ttf, using Visual Studio 2017. The libraries, and the .dll files that come with them, are in another folder (C:\SDL2.0\lib\x86), which is in the system path.
When I run, it fails, with this error message:
The procedure entry point InterlockedCompareExchange#12 could not be located in the dynamic link library C:\SDL2.0\lib\x86\SDL2.ttf.dll.
I can fix this by putting libfreetype-6.dll, which comes with SDL2_ttf, in the same folder as the .vcxproj file; or in the Debug folder. I can also fix it by putting the .dll into c:\windows\SysWOW64. But I want to distribute my code, and I don't want to put that file in each folder or require users to have admin access (to access c:\windows\SysWOW64); I want Windows to find it in the PATH, as it does with the other .dll files it's using here.
A few things I tried as I looked around the web for solution (to no effect):
Recompiling libfreetype-6.dll
Downloading the latest versions of all associated libraries
Rearranging the .lib files in Project Properties, Linker, Input, Additional Dependencies. Admittedly I may not have tried all possible arrangements as there are several dependencies
regsvr32 libfreetype-6.dll. This led to a different error message:
The module "libfreetype-6.dll" may not be compatible with the version of Windows that you're running. Check if the module is compatible with an x86 (32-bit) or x64 (64-bit) version of regsvr32.exe.
I saw here that maybe I should use the version of regsvr32 in the system32 folder; when I do that, I get
The module "libfreetype-6.dll" was loaded but the entry-point DllRegisterServer was not found. Make sure that "libfreetype-6.dll" is a valid DLL or OCX file and then try again.
So: is there a way to get the program to find libfreetype-6.dll in another folder in the PATH, and eliminate the error message about the procedure entry point?
The program I'm testing on now is from the TrueType tutorial from the LazyFoo website (source).
I am working on a program which uses Access 97 databases (with DAO350.DLL). My goal is to make this program use Access 2007 (and so ACEDAO.DLL) and then deploy the new version on several computers (win7 64bits sp1 without office at all), which don't necessarily had the previous version of the program installed.
I made a new setup by modifying the former setup of the program (created with Package & Deployment Wizard). I thought it was a good idea since PDW doesn't find all the dependencies of the program (former setup contained added-by-hand files) and so I added ACEDAO.DLL.
The setup is made of : Setup.exe, Setup.Lst (which list all files to install and their properties) and a bunch of .CAB archives that contain the files to install.
The line of Setup.Lst concerning ACEDAO is the following :
File97=#ACEDAO.dll,$(CommonFiles)\Microsoft Shared\OFFICE12\,$(DLLSelfRegister),$(Shared),08/21/11 04:52:00 PM,573440,12.0.6650.5000
When I execute Setup on an other pc, I get this error :
ACEDAO.DLL was loaded but entry point for DLLRegisterServer was not
found
I learned afterwards that ACEDAO does not contain DLLRegisterServer function, therefore it couldn't work.
Moreover, ACEDAO needs MSO.dll. When I add MSO to the Setup, this one keeps loading the last file (VB6FR.DLL) from [Bootstrap Files] section of the .Lst file forever :
Traitement de VB6FR.DLL (9/9)
My questions are :
What can I do to register ACEDAO using the setup ?
Any idea why the setup stops when I add MSO.dll ?
I apologize for the grammar quality, English isn't my native language.
Replacing/adding DLLs manually is not going to work, there is a large tree of additional file dependencies involved - for example the COM libraries that wrap ACEDAO.DLL driver.
You need to include the correct redistributable which is probably:
Microsoft Access Database Engine 2010 Redistributable
Your installer will need to run this to install all the files & prerequisites.
I've got a new system. I am trying to connect to and run the system through a 64-bit Windows 7 PC. The company sent me a Visual Basic project for that. It uses .NET framework 4 and Windows Form Applications. The target CPU is x86.
In the References tab, next to three of the COM references there are "The system cannot find the reference specified" statements. When built, the project gives the namespace errors and warnings because of these objects. The other references work fine. I've then seen those .dll files in the debug folder. I think they are generated by the company before sending me. They also exist in the bin\debug folder.
I've removed the three from the references list in the project and tried the following separately:
1) In the project, refer to the .dll files that exist in the debug folder. (Seems a fake way, but removes all the errors when the project is built. When debug, it gives the "Retrieving the COM class factory for component with CLSID ... failed due to the following error: 80040154" error.)
2) Copy the .dll files in the debug folder to C:\Windows\SysWOW64 folder, then register through regsvr32 "name.dll" in the console as admin. This way, I get the ".dll was loaded, but the DllRegisterServer entry point was not found" error. (In the regedit window, the registry editor cannot find the ID's of those references that are seen in the project properties in VB.)
3) Do the item (2), but with the C:\Windows\System32 folder instead of SysWOW64. The same error when registering.
4) Changed the solution platform to x86 and tried the items 1,2, and 3. Still the same errors.
Do I have to register these dll files? And, am I supposed to register exactly these dll files that exist in the debug folder? Or are they supposed to be generated after build by referring to some 'missing' type libraries in the references tab? I don't have these type libraries, though.
All suggestions are welcome ASAP. Thanks in advance.
You have three Interop dlls for your project, correct? These dlls just allow you to use a COM dll without having to talk directly to the COM dlls yourself.
Referencing the dlls in the bin/Debug directory should be fine, since those are probably the correct dlls that the project was built with. However, you will want to move them to another folder before continuing.
What you need to get from the company that sent you the project is the original COM dlls and their dependencies, if any. Usually an interop dll is called Microsoft.Phone.Interop.dll where it is performing interop with Microsoft.Phone.dll. Microsoft.Phone.dll needs to be registered on your computer using regsvr32 and then you just need a reference to the interop dll.
I'm struggling to get a simple COM Server running in Visual D 2010. These are the steps I did so far:
Clean Visual D 2010 solution of type Dynamic Library (DLL)
I've copied contents of dserver.d into dllmain.d
I've copied file chello.d and dserver.def into the solution's source folder, as well as advapi32.lib and ole32.lib from the <D install dir>\dmd2\windows\lib.
I've added the copied file into the solution by right-clicking the project in the solution explorer and Add->Existing item...
Renamed file dserver.def into dll.def, overwriting existing project's file.
Applied a patch to the chello.d and dllmain.d (originally dserver.d) as written on this forum thread
Build Debug. No errors.
Calling regsvr32 COMServer.dll returns these four message boxes:
then
then
and finally
I am still unable to access the COM object from VBA. And referencing the DLL directly (by Browse... button and pointing to the COMServer.dll) fails with "Can't add a reference to the specified file."
I took another look at the forums and the problem with the samples seems related to TLS on Windows XP. I posted a (somewhat hacky) solution to it here:
http://forum.dlang.org/thread/mqoxluonyjdtjxauaxnl#forum.dlang.org?page=2
I can't provide you with a working answer. It looks like this was a year ago, I was trying to get an example of using a COM server working. This uses Juno (not 64bit ready), has nothing to do with Visual D, and most importantly I couldn't get to work. The issue I hit was related to registering the server ("side-by-side configuration is incorrect").
My qualifications for COM are all there in the history of Juno (so not much of any). If you're more familiar with COM you may get further, if it doesn't compile for the latest DMD let me know (2.064 isn't out yet anyway).
I tried to convert a project that relies on the vjs runtime to vs2010, but it errors out when trying to run.
It's giving the error that "Could not load file or assembly 'vjslib' or one of its dependencies. An attempt was made to load a program with an incorrect format."
I reinstalled the vjs runtime, but it didn't seem to help.
Is there any way to get get .net 4 to work with this?
Very simple solution - Calling J# code from .NET 4.0
You take control and load it first supplying an explicit path. Then next time it's needed, it already knows the path (or it's already loaded in the AppDomain).
You will need to use LoadLibrary function, so import the pinvoke reference:
[DllImport("kernel32", SetLastError = true)]
static extern IntPtr LoadLibrary(string lpFileName);
The on load (either Main function in Console/WinForms or in Global.asax Application_Start):
if (Environment.Version.Major >= 4)
{
string folder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), #"..\Microsoft.NET\Framework\v2.0.50727");
folder = Path.GetFullPath(folder);
LoadLibrary(Path.Combine(folder, "vjsnativ.dll"));
}
I have downloaded Microsoft Visual J# Version 2.0 Redistributable Package from http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=4712 and installed it.The issue is resolved.
I got this to work by copying C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vjsnativ.dll (for 64 bit Microsoft.NET\Framework64\v2.0.50727\vjsnativ.dll) to my application's debug/release directory.
I suspect Microsoft will need to release another j# redistributable package to work with .net 4.0. Meanwhile, this work-around does a fine job.
The only way I could get it to work was to copy the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vjsnativ.dll to the C:\Windows\Microsoft.NET\Framework\v4.0.30319 folder. See http://community.microfocus.com/borland/managetrack/starteam/w/knowledge_base/17108.error-unable-to-load-dll-vjsnativ-the-specified-module-could-not-be-found-exception-from-hresult-0x8007007e.aspx
To add to the existing answers, I found that the solutions didn't work for me.
First thing I did was to repair the Microsoft Visual J# 2.0 Redistributable Package -SE (x64) using Windows Control Panel (Just right click and click repair). This was in case I did any damage in my previous attempts to fix the problem.
I had already implemented the solution provided by David Thielen.
1 Extra step closed the deal for me (solved the problem):
Copy "vjscor.dll", "vjslib.dll" and "vjsnativ.dll" from C:\Windows\Microsoft.NET\Framework64\v2.0.50727 To C:\Windows\Microsoft.NET\Framework\v2.0.50727
So basically the Microsoft package placed the correct dlls into the 64-bit .NET framework and I had to manually move them into the 32-bit folder which is then copy-pasted into my solution folder by David Thielen's solution (above).