I have a VB6 application which utilizes NI4882 api (VBIB32) with gpib-32.dll and is working fine in all deployed PCs (windows server 2003 32 bit).
However, recently we have a new PC (windows server 2019 64 bit) and the application could not find the gpib-32.dll even though i checked the dll is in C:\Windows\SysWOW64.
The error "File not found: gpib-32.dll" prompted out when the apps called function from the dll.
I am not sure if this is the dll compatibility issue on 64bit or is there something that I missed?
Edit:
this is some of the DLL entry function declaration:
' NI-488.2 DLL entry function declarations
Declare Function ibask32 Lib "gpib-32.dll" Alias "ibask" (ByVal ud As Long, ByVal opt As Long, value As Long) As Long
Declare Function ibbna32 Lib "gpib-32.dll" Alias "ibbnaA" (ByVal ud As Long, sstr As Any) As Long
Declare Function ibcac32 Lib "gpib-32.dll" Alias "ibcac" (ByVal ud As Long, ByVal v As Long) As Long
' the rest .....
Related
VS 2017 crashes on startup.
I've tried:
Updating to latest build 15.5.2
Running VS as admin
Deleting the .vs folder
Repairing VS installation
devenv.exe /ResetSettings
devenv.exe /ResetUserData
devenv.exe /SafeMode
devenv.exe /ResetSkipPkgs
Checking if font MT Extra had a long path rather than file name in registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
Cleared out %TEMP% folder
Renaming/deleting %LOCALAPPDATA%\Microsoft\VisualStudio\15.xxx
Uninstalling GitExtensions
Uninstalling VS Professional, installing VS Enterprise
Uninstalling again, this time searching for every folder named VisualStudio and deleting every string match of VisualStudio in registry (regedit), and installing again
Formatting my C drive. VS started normally as soon as I installed it, but as soon as I started adding additional programs (Steam, Notepad++, Office, etc) it starting crashing again.
None of the above has fixed the issue.
I am running win 10 enterprise, Intel Core i7-5960X CPU # 3GHz, 32GB RAM, 64 bit OS
From event viewer:
Fault bucket , type 0
Event Name: APPCRASH
Response: Not available
Cab Id: 0
Problem signature:
P1: devenv.exe
P2: 15.0.27130.2010
P3: 5a31e4ea
P4: KERNELBASE.dll
P5: 10.0.16299.15
P6: 2cd1ce3d
P7: c000041d
P8: 001008b2
P9:
P10:
Faulting application name: devenv.exe, version: 15.0.27130.2010, time stamp: 0x5a31e4ea
Faulting module name: KERNELBASE.dll, version: 10.0.16299.15, time stamp: 0x2cd1ce3d
Exception code: 0xc000041d
Fault offset: 0x001008b2
Faulting process id: 0x17b0
Faulting application start time: 0x01d37a24c40d6287
Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: bdb4ae52-6612-4f9d-a016-d19e68f0ee59
Faulting package full name:
Faulting package-relative application ID:
Fault bucket 1293705288626429016, type 5
Event Name: CLR20r3
Response: Not available
Cab Id: 0
Problem signature:
P1: devenv.exe
P2: 15.0.27130.2010
P3: 5a31e4ea
P4: mscorlib
P5: 4.7.2600.0
P6: 59d789f1
P7: 5f9e
P8: 4
P9: System.ArgumentException
P10:
Faulting application name: devenv.exe, version: 15.0.27130.2010, time stamp: 0x5a31e4ea
Faulting module name: KERNELBASE.dll, version: 10.0.16299.15, time stamp: 0x2cd1ce3d
Exception code: 0xe0434352
Fault offset: 0x001008b2
Faulting process id: 0x17b0
Faulting application start time: 0x01d37a24c40d6287
Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: e821f1e4-bfff-4775-9131-2c3d763b5848
Faulting package full name:
Faulting package-relative application ID:
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32, IntPtr)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32, IntPtr)
at MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32)
at MS.Internal.Text.TextInterface.Font.DisplayMetrics(Single, Single)
at MS.Internal.FontFace.PhysicalFontFamily.MS.Internal.FontFace.IFontFamily.LineSpacing(Double, Double, Double, System.Windows.Media.TextFormattingMode)
at MS.Internal.TextFormatting.SimpleTextLine..ctor(MS.Internal.TextFormatting.FormatSettings, Int32, Int32, System.Collections.ArrayList, Int32 ByRef, Int32 ByRef, Double)
at MS.Internal.TextFormatting.SimpleTextLine.Create(MS.Internal.TextFormatting.FormatSettings, Int32, Int32, Double)
at MS.Internal.TextFormatting.TextFormatterImp.FormatLineInternal(System.Windows.Media.TextFormatting.TextSource, Int32, Int32, Double, System.Windows.Media.TextFormatting.TextParagraphProperties, System.Windows.Media.TextFormatting.TextLineBreak, System.Windows.Media.TextFormatting.TextRunCache)
at MS.Internal.TextFormatting.TextFormatterImp.FormatLine(System.Windows.Media.TextFormatting.TextSource, Int32, Double, System.Windows.Media.TextFormatting.TextParagraphProperties, System.Windows.Media.TextFormatting.TextLineBreak, System.Windows.Media.TextFormatting.TextRunCache)
at MS.Internal.Text.Line.Format(Int32, Double, System.Windows.Media.TextFormatting.TextParagraphProperties, System.Windows.Media.TextFormatting.TextLineBreak, System.Windows.Media.TextFormatting.TextRunCache, Boolean)
at System.Windows.Controls.TextBlock.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.DockPanel.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Border.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Grid.MeasureCell(Int32, Boolean)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean, Boolean ByRef)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean)
at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at Microsoft.VisualStudio.PlatformUI.Shell.Controls.WindowContentPresenter.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Window.MeasureOverrideHelper(System.Windows.Size)
at System.Windows.Window.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Interop.HwndSource.Process_WM_SIZE(System.Windows.UIElement, IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr)
at System.Windows.Interop.HwndSource.LayoutFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
UPDATE 12-23-17
Decided to format my drive again, install Visual Studio, and launch the application after each subsequent program installation. I think I narrowed down the issue to the Microsoft Office installer, unless something was running in the background without my knowledge. As soon as I started installing Office, I launched Visual Studio and it triggered the crash. Will update this post with new information as I learn more. -Leo
UPDATE 2: Issue solved (NOT TRUE, SEE NEXT UPDATE). Microsoft Office was the culprit. In path C:\Program Files\Microsoft Office\root\Office16, renamed file MLCFG32.CPL to MLCFG32.CPL.old, signed out of Windows, signed back in, and opened Visual Studio successfully. Thank you Joyce over at the MSDN forum.
UPDATE 12/31/17 (also added in answer)
This is not a permament fix.VS 2017 starts crashing after executing a not yet determined process. I have to repeatedly rename the file MLCFG32.CPL to .old and back, and then VS starts normally. Then the next day, it would start breaking again.
UPDATE 1/11/18
Issue solved! The problem was with the installation of WindowBlinds 10.65 (048 - Windows 10 Edition) - 64 bit OS, and using a theme that applies style system wide fonts.
The fix is to disable this feature by checking "Do not apply any style system wide fonts" by clicking Style on the left hand side menu (1), clicking Fonts (2), then checking the box described above.
Link to Stardock forums with fix details.
UPDATE 12/31/17
This is not a permament fix.VS 2017 starts crashing after executing a not yet determined process. I have to repeatedly rename the file MLCFG32.CPL to .old and back, and then VS starts normally. Then the next day, it would start breaking again.
Issue solved. Microsoft Office was the culprit. In path C:\Program Files\Microsoft Office\root\Office16, I renamed file MLCFG32.CPL to MLCFG32.CPL.old, signed out of Windows, signed back in, and opened Visual Studio successfully.
Thank you Joyce over at the MSDN forum.
I'm trying to use CreateTextServices function in TextServ.h. It seem I have to link riched20.lib to project to use this function.
But when I add riched20.lib to Linker/Input/Additional Depedencies, VS say error LNK1181: cannot open input file 'riched20.lib'.
How to fix this error?
I'm using VS 2013, Win 8.1 32 bit.
Had the same issue. I think there's no lib available for recent versions of richedit/msftedit, but textserv.h provides a definition of the function, so what you can do without any need for an extra .lib is this:
// load the dll and get the function address
// PCreateTextServices is declared in textserv.h:
HMODULE h = LoadLibrary(L"msftedit.dll");
PCreateTextServices createTextServices = (PCreateTextServices)GetProcAddress(h, "CreateTextServices");
...
ITextServices svc*;
int hr = createTextServices(NULL, host, (IUnknown**)&svc);
...
svc->Release();
FreeLibrary(h);
My VBA code can't access to my DLL in the C:\Windows\System32 folder on Windows 7 64bit and Word 2010 32bit.
Private Declare Function my_func Lib "mydll.dll" (ByVal param As String) As Long
Public Sub MyFuncTest
n = my_func("a")
End
I copied mydll.dll into C:\Windows\System32 and called MyFuncTest but got an error message like "Error 53: 'mydll.dll' not found".
However, I changed the declaration in code to:
Private Declare Function my_func Lib "C:\Users\myname\Documents\mydll.dll" (ByVal param As String) As Long
then I copied mydll.dll into C:\Users\myname\Documents, my account's Documents folder, and MyFuncTest successfully executed.
Changing "mydll.dll" to "C:\Windows\System32\mydll.dll" in the declaration did not work. And I tried accessing C:\Windows\System32\mydll.dll with FileSystemObject#FileExists method on the same VBA environment, but it returned False (not found).
There was no problem on Windows XP and Word 2003.
Can anyone help?
This is a 32 bit DLL and a 32 bit process running in the WOW64 emulator on 64 bit Windows. File redirection is in play and so when a 32 bit process looks in system32 it is actually redirected to the 32 bit system directory SysWOW64.
The simple and quick solution is to move the DLL to C:\Windows\SysWOW64. However, as Cody Gray points out in a comment, it is not recommended for you to place application DLLs in the system directory. Normal practice is to place the DLLs in your application folder in the program files directory and make sure that folder is in the DLL search path when the DLL needs to be loaded.
Seems like UAC is the problem. Try running the VBA script as Administrator. It may help you.
A recent developer suggested the following fix which allowed a 32bit .dll to be registered on a 64 bit machine
1) Open a DOS command window.
2) Navigate to C:\Windows\Microsoft.NET\Framework64\v2.0.50727
3) Enter the following and press enter.
regasm /codebase "C:\Users\myname\Documents\mydll.dll"
I have had exactly the same problem yesterday. The program run on my machine, but not on others.
In fact, the message fron Excel is wrong. He obviously find lhe dll file, but this dll is calling orher dll, missing in the system : MSVCR100D.dll and NTDLL.dll.
I found that by using Dependency Walker free software, able to examine which dll are call by a dll.
I need to do one serup application with couple of dll's:
In the pas-script do used compinstkey.dll which call the aspr_ide.dll.
I did in the iss-script:
[Files]
Source: aspr_ide.dll; DestDir: {app};Flags: ignoreversion
Source: CompInstKey.dll; DestDir: {app}; Flags: ignoreversion
....
[Code]
....
function GetRegistrationKeys: PAnsiChar;
external 'GetRegistrationKeys#files:aspr_ide.dll stdcall';
procedure Installinfo(ApplicationName, Version, UserName, Key: PAnsiChar);
external 'Installinfo#files:CompInstKey.dll stdcall';
....
function InitializeSetup: Boolean;
begin
Result := False;
ExtractTemporaryFile('aspr_ide.dll');
ExtractTemporaryFile('CompInstKey.dll');
end;
.....
in the Windows XP it work fine, but Windows7 do throw the error "Cannot import dll: C:...\Temp\tp.GHPtmp\aspr_ide.dll". At the pause of installation the aspr_ide.dll in this moment exist at the "C:...\Temp\tp.GHPtmp\".
What do I wrong? Why dont run under Windows 7? How can I correct it?
You should use the delayload keyword on your function declarations like:
function GetRegistrationKeys: PAnsiChar;
external 'GetRegistrationKeys#files:aspr_ide.dll stdcall delayload';
procedure Installinfo(ApplicationName, Version, UserName, Key: PAnsiChar);
external 'Installinfo#files:CompInstKey.dll stdcall delayload';
The delayload causes the setup to only load the DLL when it is called rather than at startup as documented at http://www.jrsoftware.org/ishelp/index.php?topic=scriptdll.
First, I suggest you update Inno to version 5.5.9, which has the fewest bugs. Second, recompile the DLL on the Win7 system because DLLs may not be the same in the XP and Win7 dependent dynamic libraries.
I have been struggling for days on this issue now and nothing seems to work.
I have had visual studio on my pc (windows xp pro) for 18 months and it has worked fine, but recently visual studio (2010) has started crashing before it fully opens up.
I have tried uninstalling vs2010 fully then reinstalling but it is just doing the same thing.
The error message recorded in event viewer is a devenv runtime .net error.
Here is the full error message.....
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.InteropServices.COMException
Stack:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32, IntPtr)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32, IntPtr)
at MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32)
at MS.Internal.Text.TextInterface.FontCollection.FindFamilyName(System.String, UInt32 ByRef)
at MS.Internal.FontCache.FamilyCollection.LookupFamily(System.String, System.Windows.FontStyle ByRef, System.Windows.FontWeight ByRef, System.Windows.FontStretch ByRef)
at System.Windows.Media.FontFamily.LookupFontFamilyAndFace(MS.Internal.FontCache.CanonicalFontF amilyReference, System.Windows.FontStyle ByRef, System.Windows.FontWeight ByRef, System.Windows.FontStretch ByRef)
at System.Windows.Media.FontFamily.FindFirstFontFamilyAndFace(System.Windows.FontStyle ByRef, System.Windows.FontWeight ByRef, System.Windows.FontStretch ByRef)
at System.Windows.Media.Typeface.ConstructCachedTypeface()
at System.Windows.Media.Typeface.get_CachedTypeface()
at MS.Internal.TextFormatting.SimpleTextLine..ctor(MS.Internal.TextFormatting.FormatSettings, Int32, Int32, System.Collections.ArrayList, Int32 ByRef, Int32 ByRef)
at MS.Internal.TextFormatting.SimpleTextLine.Create(MS.Internal.TextFormatting.FormatSettings, Int32, Int32)
at MS.Internal.TextFormatting.TextFormatterImp.FormatLineInternal(System.Windows.Media.TextForm atting.TextSource, Int32, Int32, Double, System.Windows.Media.TextFormatting.TextParagraphProperties, System.Windows.Media.TextFormatting.TextLineBreak, System.Windows.Media.TextFormatting.TextRunCache)
at MS.Internal.TextFormatting.TextFormatterImp.FormatLine(System.Windows.Media.TextFormatting.T extSource, Int32, Double, System.Windows.Media.TextFormatting.TextParagraphProperties, System.Windows.Media.TextFormatting.TextLineBreak, System.Windows.Media.TextFormatting.TextRunCache)
at System.Windows.Controls.TextBlock.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement, System.Windows.Size)
at System.Windows.Controls.ContentPresenter.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Border.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Control.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.DockPanel.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Control.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)
at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
at System.Windows.UIElement.Measure(System.Windows.Size)
at Microsoft.Internal.VisualStudio.PlatformUI.VisualTargetPresentationSource.set_RootVisual(Sys tem.Windows.Media.Visual)
at Microsoft.Internal.VisualStudio.PlatformUI.WorkerThreadElementContainer.UIWorkerThreadStart( System.Object)
at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart(System.Object)
If not installed download and install Microsoft Visual Studio 2010 Service Pack 1
If service pack is already installed, remove SP and VS.NET, reboot and perform clean installation of VS.NET and then SP.
Update:
Visual Studio (devenv.exe) could be run with different options
/ResetSettings Restores the IDE's default settings, optionally resets to
the specified VSSettings file.
/SafeMode Launches the IDE in safe mode loading minimal windows.
The /SafeMode switch will ensure you are launching the IDE without any additional addins. If the problem does not persist, chances are it's being caused by an extension. Use the extension manager and addin manager to enable/disable the extensions.
The /ResetSettings will restore default settings.
Run command propmt, navigate to VS.NET path and call devenv with one of the switches
CD C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\
devenv.exe /ResetSettings