G
Guest
I'm having a problem with DLL that I'm using through COM interop from VB6.
The DLL has some custom structs that are defined as follows.
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Public Structure ToolEventStruct
Public ToolEvent_ID As Integer
<MarshalAs(UnmanagedType.BStr)> _
Public EventName As String
Public EventCode As Integer
<MarshalAs(UnmanagedType.BStr)> _
Public EventDescription As String
Public EventType_ID As Integer
Public CreateDate As Date
End Structure
When I create a msi file to install this DLL the following entry is put in
the msi registry table which then gets installed on the target computer. The
problem is that this codeBase value is hard coded to the path of my dev
computer instead of using the install directoy entered by the user when the
msi is run. The COM registry entries (inprocServer,...) for this DLL are
getting the correct codeBase value. Why is this "record" registry keys being
generated and why is the codeBase hosed. This causes my DLL to throw an
expection when the CLR cannot find the DLL and the dev location.
[HKEY_CLASSES_ROOT\Record\{0F94C157-4F0C-3A32-A1F5-1ACC74171A27}\1.0.0.1]
"CodeBase"="file:///C:/Documents and Settings/Gil/My
Documents/LEI/2XX-SparTool/Visual Studio
Projects/290b-LaSHDataAccess-Jerry/112305/LaSHDataAccess/obj/Release/LaSHDataAccess.DLL"
"Class"="LaSHDataAccess.DataAccess+ToolEventStruct"
"Assembly"="LaSHDataAccess, Version=1.0.0.1, Culture=neutral,
PublicKeyToken=475da81253b912e1"
The DLL has some custom structs that are defined as follows.
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Public Structure ToolEventStruct
Public ToolEvent_ID As Integer
<MarshalAs(UnmanagedType.BStr)> _
Public EventName As String
Public EventCode As Integer
<MarshalAs(UnmanagedType.BStr)> _
Public EventDescription As String
Public EventType_ID As Integer
Public CreateDate As Date
End Structure
When I create a msi file to install this DLL the following entry is put in
the msi registry table which then gets installed on the target computer. The
problem is that this codeBase value is hard coded to the path of my dev
computer instead of using the install directoy entered by the user when the
msi is run. The COM registry entries (inprocServer,...) for this DLL are
getting the correct codeBase value. Why is this "record" registry keys being
generated and why is the codeBase hosed. This causes my DLL to throw an
expection when the CLR cannot find the DLL and the dev location.
[HKEY_CLASSES_ROOT\Record\{0F94C157-4F0C-3A32-A1F5-1ACC74171A27}\1.0.0.1]
"CodeBase"="file:///C:/Documents and Settings/Gil/My
Documents/LEI/2XX-SparTool/Visual Studio
Projects/290b-LaSHDataAccess-Jerry/112305/LaSHDataAccess/obj/Release/LaSHDataAccess.DLL"
"Class"="LaSHDataAccess.DataAccess+ToolEventStruct"
"Assembly"="LaSHDataAccess, Version=1.0.0.1, Culture=neutral,
PublicKeyToken=475da81253b912e1"