I have a resource file that contains two files, but i dont know how to run them, they are both "custom" and labeled 101 and 102. Any help is appreciated.
Printable View
I have a resource file that contains two files, but i dont know how to run them, they are both "custom" and labeled 101 and 102. Any help is appreciated.
What type of files are stored in the resource file?
If it turns out that the res file contains strings, here is a routine you can use to get at them.It allows the strings to have replaceable parameters. The following calls the above routine with a variable named resINTEGNOTFOUND (which could have a value of 101). In this case the string has 3 replaceable parameters.Code:Function ResolveResString(ByVal resID As Integer, ParamArray vReplacements() As Variant) As String
'-----------------------------------------------------------
' FUNCTION: ResolveResString
' Reads resource and replaces given macros with given values
'
' Example, given a resource number 14:
' "Could not read '|1' in drive |2"
' The call
' ResolveResString(14, "|1", "TXTFILE.TXT", "|2", "A:")
' would return the string
' "Could not read 'TXTFILE.TXT' in drive A:"
'
' IN: [resID] - resource identifier
' [vReplacements] - pairs of macro/replacement value
'-----------------------------------------------------------
'
Dim nMacro As Integer
Dim sResString As String
sResString = LoadResString(resID)
' For each macro/value pair passed in...
For nMacro = LBound(vReplacements) To UBound(vReplacements) Step 2
Dim sMacro As String
Dim sValue As String
sMacro = vReplacements(nMacro)
On Error GoTo MismatchedPairs
sValue = vReplacements(nMacro + 1)
On Error GoTo 0
' Replace all occurrences of sMacro with sValue
Dim nPos As Integer
Do
nPos = InStr(sResString, sMacro)
If nPos > 0 Then
sResString = Left$(sResString, nPos - 1) & sValue & Right$(sResString, Len(sResString) - Len(sMacro) - nPos + 1)
End If
Loop Until nPos = 0
Next nMacro
ResolveResString = sResString
Exit Function
MismatchedPairs:
Resume Next
End Function
Code:MsgBox ResolveResString(resINTEGNOTFOUND, "|1", "Desired", "|2", gsDefIntegType1, "|3", sFirstIntegType), gnStyle, gsTitle
------------------
Marty
they are both .exe's.
I have no idea what that means Martin Liss
Check out the Previous Post
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819