'VB'에 해당되는 글 18건
- 2008.11.17 vb - Quick Sort
- 2008.11.17 vb 문서 내용에 있는 Url를 찾아내어 자동으로 링크를 구성하는 함수
- 2008.11.17 vb - 정규표현식을 이용한 대치
- 2008.11.17 VB 문자열을 원하는 길이만큼 자르기
- 2008.10.28 [CAR] Problem with VB/Samples/DAQ/Analog Input/Continuous Acquistion
- 2008.10.24 Visual Basic 6.0용 서비스 팩 6: 런타임 재배포 팩
- 2008.10.24 [REF] MSVCRT.dll 파일이 포함된 Microsoft Visual Basic 6.0 응용 프로그램을 설치하면 컴퓨터가 다시 시작되지 않는다
- 2008.10.23 [VB6] INI 화일 읽고 쓰기
' --------------------------------------------------------
' Quick Sort
' --------------------------------------------------------
Function QuickSort(vec, loBound, hiBound)
Dim pivot,loSwap,hiSwap,temp
' QuickSort는 정렬이 안된 배열을 정렬할 때 가장 빠른 방식이다.
' 정렬되어야 할 아이템이 두 개일 경우
if hiBound - loBound = 1 then
if vec(loBound) > vec(hiBound) then
temp=vec(loBound)
vec(loBound) = vec(hiBound)
vec(hiBound) = temp
End If
End If
' 정렬되어야 할 아이템이 세 개 이상일 경우
pivot = vec(int((loBound + hiBound) / 2))
vec(int((loBound + hiBound) / 2)) = vec(loBound)
vec(loBound) = pivot
loSwap = loBound + 1
hiSwap = hiBound
do
' 적절한 loSwap 찾기
while loSwap < hiSwap and vec(loSwap) <= pivot
loSwap = loSwap + 1
wend
' 적절한 hiSwap 찾기
while vec(hiSwap) > pivot
hiSwap = hiSwap - 1
wend
' loSwap이 hiSwap보다 작으면 값 교체
if loSwap < hiSwap then
temp = vec(loSwap)
vec(loSwap) = vec(hiSwap)
vec(hiSwap) = temp
End If
loop while loSwap < hiSwap
vec(loBound) = vec(hiSwap)
vec(hiSwap) = pivot
' QuickSort의 백미 : 재귀 호출(Recursively call function)
'첫 번째 섹션에서 두 개 또는 그 이상의 아이템
if loBound < (hiSwap - 1) then Call QuickSort(vec,loBound,hiSwap-1)
'두 번째 섹션에서 두 개 또는 그 이상의 아이템
if hiSwap + 1 < hibound then Call QuickSort(vec,hiSwap+1,hiBound)
End Function
' --------------------------------------------------------
' 문서 내용에 있는 Url를 찾아내어 자동으로 링크를 구성하는 함수
' --------------------------------------------------------
Function auto_link(text)
Dim regex_file, regex_http, regex_mail
regex_file= "gz|tgz|tar|gzip|zip|rar|mpeg|mpg|exe|rpm|dep|rm|ram|asf|ace|viv|avi|mid|gif|jpg|png|bmp|eps|mov"
regex_http = "(http|https|ftp|telnet|news):\/\/(([\xA1-\xFEa-z0-9_\-]+\.[][\xA1-\xFEa-z0-9:;&#@=_~%\?\/\.\,\+\-]+)(\/|[\.]*[a-z0-9]))"
regex_mail = "([\xA1-\xFEa-z0-9_\.\-]+)@([\xA1-\xFEa-z0-9_\-]+\.[a-z0-9\-\._\-]+[\.]*[\xA1-\xFEa-z0-9\?=]*)"
' img tag 와 a tag 의 경우 링크가 여러줄에 걸쳐 이루어져 있을 경우
' 이를 한줄로 합침 (합치면서 부가 옵션들은 모두 삭제함)
text = eregi_replace("<(a|img)[^>]*(href|src)[^>]*(" & regex_http & "|mailto:" & regex_mail & ")[^>]*>","<$1 $2=""$3"">", text)
' 특수문자와 링크시 target 삭제
text = eregi_replace("&(quot|gt|lt)","!$1", text)
' html 사용시 Link 보호
text = eregi_replace("href=""(" & regex_http & ")""[^>]*>","href=""$2_orig://$3"" target=""_blank"">", text)
text = eregi_replace("href=""mailto:(" & regex_mail & ")"">","href=""mailto:$2#-#$3"">", text)
text = eregi_replace("(background|codebase|src)[ \n]*=[\n""' ]*(" & regex_http & ")[""']*","$1=""$3_orig://$4""",text)
'링크가 안된 Url및 Email Address 자동 링크
text = eregi_replace("(" & regex_http & ")" ,"<a href=""$1"" target=""_blank"">$1</a>", text)
text = eregi_replace("(" & regex_mail & ")","<a href=""mailto:$1"">$1</a>", text)
' 보호를 위해 치환된것 복구
text = eregi_replace("!(quot|gt|lt)","&$1", text)
text = eregi_replace("(http|https|ftp|telnet|news|mms)_orig","$1", text)
text = eregi_replace("#-#","@",text)
' File Link시 Target을 삭제
text = eregi_replace("(\.(" & regex_file & ")"") target=""_blank""","$1", text)
auto_link = text
End Function
' --------------------------------------------------------
' 정규표현식을 이용한 대치
' --------------------------------------------------------
Function ereg_replace(pattern, strReplace, text)
Dim eregObj
' Create regular expression
Set eregObj= New RegExp
eregObj.Pattern= pattern ' Set Pattern(패턴 설정)
eregObj.IgnoreCase = False ' Set Case Insensitivity(대소문자 구분 여부)
eregObj.Global = True ' Set All Replace(전체 문서에서 검색)
ereg_replace = eregObj.Replace(text, strReplace) ' Replace String
End Function
Function eregi_replace(pattern, strReplace, text)
Dim eregObj
' Create regular expression
Set eregObj= New RegExp
eregObj.Pattern= pattern ' Set Pattern(패턴 설정)
eregObj.IgnoreCase = True ' Set Case Insensitivity(대소문자 구분 여부)
eregObj.Global = True ' Set All Replace(전체 문서에서 검색)
eregi_replace = eregObj.Replace(text, strReplace) ' Replace String
End Function
Function ereg(patrn, strng)
Dim regEx, Match, Matches, i, regs() ' Create variable.
Set regEx = New RegExp ' Create a regular expression.
regEx.Pattern = patrn ' Set pattern.
regEx.IgnoreCase = False ' Set case insensitivity.
regEx.Global = True ' Set global applicability.
Set Matches = regEx.Execute(strng) ' Execute search.
regs(0) = strng
i = 1
For Each Match in Matches ' Iterate Matches collection.
regs(i) = Match.Value
i = i+1
Next
ereg = regs
End Function
Function eregi(patrn, strng)
Dim regEx, Match, Matches, i, regs() ' Create variable.
Set regEx = New RegExp ' Create a regular expression.
regEx.Pattern = patrn ' Set pattern.
regEx.IgnoreCase = True ' Set case insensitivity.
regEx.Global = True ' Set global applicability.
Set Matches = regEx.Execute(strng) ' Execute search.
i = 1
regs(0) = strng
For Each Match in Matches ' Iterate Matches collection.
regs(i) = Match.Value
i = i+1
Next
eregi = regs
End Function
' --------------------------------------------------------
' 문자열을 원하는 길이만큼 자르기
' --------------------------------------------------------
function cutstr(long_str, cutting_len)
dim i, short_str, tail
tail = "..."
long_str = trim(long_str)
for i = 0 to cutting_len-1
if asc(mid(long_str, i+1, 1)) >= 128 then
kor = kor + 1
else
eng = eng + 1
end if
next
if len(long_str) > cutting_len then
if kor mod 2 = 1 then
cutting_len = cutting_len - 1
end if
short_str = mid(long_str, 1, cutting_len)
cutstr = short_str & tail
else
short_str = mid(long_str, 1, cutting_len)
cutstr = short_str
end if
end function
[CAR] Problem with VB/Samples/DAQ/Analog Input/Continuous Acquistion
| Car/Engine 2008. 10. 28. 08:18결론은 DAQmx에서 제공하는 Sample을 사용하는것이 나을듯하다.
Hi,
Hello Saroj,
From the looks of that line of code that you sent it appears that you are using or trying to use Component Works commands to call your DAQ board.
ComponentWorks uses our older Traditional DAQ calls, so you will not be able to use DAQmx 8.0 if you want to run that program. Instead, you will need to install Traditional DAQ 7.4.1 and it should allow you to run that program and avoid the error.
Regards,
개요
시스템 요구 사항
- 지원하는 운영 체제: Windows 2000; Windows 2000 Advanced Server; Windows 2000 Server; Windows 2000 Service Pack 2; Windows 2000 Service Pack 3; Windows 2000 Service Pack 4; Windows 95; Windows 98; Windows 98 Second Edition; Windows ME; Windows NT; Windows Server 2003; Windows XP
Link :http://www.microsoft.com/downloads/details.aspx?displaylang=ko&familyid=7b9ba261-7a9c-43e7-9117-f673077ffb3c
[REF] MSVCRT.dll 파일이 포함된 Microsoft Visual Basic 6.0 응용 프로그램을 설치하면 컴퓨터가 다시 시작되지 않는다
| Programming/VB 2008. 10. 24. 13:50MSVCRT.dll 파일이 포함된 Microsoft Visual Basic 6.0 응용 프로그램을 설치하면 컴퓨터가 다시 시작되지 않는다
기술 자료 ID | : | 330314 |
마지막 검토 | : | 2004년 3월 8일 월요일 |
수정 | : | 1.0 |
이 페이지에서
현상
? | Microsoft Windows NT 4.0:
STOP: c000021a {치명적인 시스템 오류} Windows Logon Process 시스템 프로세스가 0x00000080 (0x00000000 0x00000000) 상태로 갑자기 종료되었습니다. 시스템이 종료되었습니다. |
? | Microsoft Windows 2000:
일부 시스템 파일이 현재 시스템의 이전 버전에서 작성된 파일이므로 설치를 계속할 수 없습니다. 이 파일을 업데이트하고 설치하려면 [확인]을 누르십시오. 다시 설치하기 전에 Windows를 다시 시작해야 합니다. 시스템 파일을 업데이트하지 않고 설치를 종료하려면 [취소]를 누르십시오. Windows 2000이 다시 시작된 후에 설치를 다시 시작하면 오류 메시지가 다시 나타납니다. |
? | Microsoft Windows 98:
MSVCRT.dll 파일이 손실된 export NTDLL.dll에 연결되었습니다. RtlGetNTVersionNumbers. 이 오류가 발생하면 다음과 같은 메시지가 나타나 있는 Stop 대화 상자가 나타납니다. |
원인
해결 방법
시스템 복구
Windows NT 4.0
파일 할당 테이블(FAT) 파일 시스템을 실행하는 Windows NT 4.0 운영 체제를 복구하려면 명령 프롬프트로 컴퓨터를 부팅한 다음 수동으로 C:\WINNT\System32 폴더의 MSVCRT.dll을 Windows NT 4.0 CD에 있는 복사본이나 Windows NT 4.0 운영 체제를 성공적으로 실행 중인 컴퓨터에 있는 복사본으로 대체하십시오.NTFS 파일 시스템을 실행하는 Windows NT 4.0 컴퓨터를 복구하려면 ERD(응급 복구 디스크)를 사용하여 컴퓨터를 부팅하십시오. 이 항목에 대한 자세한 내용은 Microsoft 기술 자료의 다음 문서를 참조하십시오.
Windows 98
Windows 98 운영 체제를 복구하려면 시동 디스크를 사용하여 명령 프롬프트로 컴퓨터를 부팅해야 합니다. 그런 다음 수동으로 C:\Windows\System 폴더의 MSVCRT.dll을 Windows 98 CD에 있는 복사본이나 Windows 98을 성공적으로 실행 중인 컴퓨터에 있는 복사본으로 대체하십시오.MSVCRT.dll의 재배포 방지
다음에 이 문제가 다시 발생하지 않도록 하려면 설치 패키지를 사용할 때 MSVCRT.dll이 재배포되지 않게 하십시오. MSVCRT.dll은 Microsoft C 런타임 라이브러리에 있으며 운영 체제와 함께 설치됩니다. 운영 체제 서비스 팩을 사용하여 MSVCRT.dll만 업데이트하십시오.패키지 및 배포 마법사를 사용하여 응용 프로그램을 패키지로 만들 경우에는 패키지에 포함될 파일 목록에서 MSVCRT.dll을 제거하십시오. 또는 설치 패키지를 이미 어셈블한 상태에서 MSVCRT.dll이 설치되지 않도록 설치 패키지를 수정하려면 다음과 같이 하십시오.
1. | 메모장이나 기타 텍스트 편집기를 사용하여 Setup.lst 파일을 엽니다. |
2. | [Bootstrap Files] 섹션과 [Setup1 Files] 섹션을 검사하여 MSVCRT.dll이 포함되어 있는지 확인합니다. |
3. | MSVCRT.dll에 대한 File= 행을 제거한 다음 해당 섹션의 나머지 행 번호를 다시 매깁니다. |
4. | 파일을 저장합니다. 다음 번에 Setup.exe를 실행하면 Setup.exe가 MSVCRT.dll을 설치하지 않게 됩니다. |
현재 상태
추가 정보
문제를 재현하는 방법
1. | Scrrun.dll에 대한 종속 파일을 엽니다. 다음 항목에 유의합니다.[scrrun.dll] Dest=$(WinSysPath)Register=$(DLLSelfRegister)Version=4.0.0.2926 Uses1=MSVCRT.dllCABFileName=ScrRun.cabCABDefaultURL=http://activex.microsoft.com/controls/vb6CABINFFile=ScrRun.inf [MSVCRT.dll] Dest=$(WinSysPathSysFile)Uses1= |
2. | Visual Basic 6.0에서 표준 EXE 프로젝트를 만듭니다. |
3. | 프로젝트 메뉴에서 참조를 누릅니다. |
4. | Microsoft Scripting Runtime 라이브러리를 누른 다음 확인을 누릅니다. |
5. | 프로젝트를 저장한 다음 컴파일된 EXE를 만듭니다. |
6. | 패키지 및 배포 마법사를 사용하여 기본 설정으로 설치 패키지를 만듭니다. |
7. | 메모장에서 Package 폴더의 Setup.lst 파일을 엽니다. |
8. | Setup1 Files에서 다음 항목에 유의합니다.File1=@msvcrt.dll,$(WinSysPathSysFile),,,8/29/02 5:41:08 AM,323072,7.0.2600.1106이 항목을 보면 최신 버전의 MSVCRT.dll이 설치 패키지를 통해 재배포됨을 알 수 있습니다. 이 경우 Windows 98 운영 체제나 Windows NT 4.0 운영 체제에서 실행되는 컴퓨터에 이 패키지를 설치하면 이 문서의 "현상" 절에 설명되어 있는 오류 중 하나가 발생합니다. Windows 2000 운영 체제에서 실행되는 컴퓨터에 이 패키지를 설치하면 설치 프로그램이 시스템 파일을 업데이트하고 시스템을 다시 시작할 것인지 묻습니다. Windows 2000을 다시 시작하고 설치를 다시 시작하면 오류 메시지가 다시 나타납니다. |
사용법
Private Sub Command1_Click()
Dim o As New INIClass
o.FileName = App.Path & "\화일지정"
o.ApplicationKey = "AppKey"
o.SetValue "이름", "값"
MsgBox o.GetValue("이름", "p")
Set o = Nothing
End Sub
'클래스 정의
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "Cini"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
Private Declare Function WritePrivateProfileString _
Lib "kernel32" Alias "WritePrivateProfileStringA" _
(ByVal lpApplicationname As String, ByVal lpKeyName As Any, _
ByVal lsString As Any, ByVal lplFilename As String) As Long
Private Declare Function GetPrivateProfileInt Lib _
"kernel32" Alias "GetPriviteProfileIntA" (ByVal lpApplicationname As String, _
ByVal lpKeyName As String, ByVal nDefault As Long, _
ByVal lpFileName As String) As Long
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias _
"GetPrivateProfileStringA" (ByVal lpApplicationname As String, _
ByVal lpKeyName As String, ByVal lpDefault As String, _
ByVal lpReturnedString As String, ByVal nSize As Long, _
ByVal lpFileName As String) As Long
Private m_strFile As String ' for file name
Private m_AppName As String '
Public Property Get FileName() As String
FileName = m_strFile
End Property
Public Property Let FileName(ByVal strFile As String)
m_strFile = Trim(strFile)
End Property
Private Sub Class_Initialize()
m_strFile = ""
m_AppName = ""
End Sub
Public Property Get ApplicationKey() As String
ApplicationKey = m_AppName
End Property
Public Property Let ApplicationKey(ByVal strAppKey As String)
m_AppName = Trim(strAppKey)
End Property
Private Function fConvert(str As String) As String
Dim i As Integer
Dim strOP As String
Dim intAsc As Integer
str = Trim(str)
strOP = ""
For i = 1 To Len(str)
intAsc = Asc(Mid(str, i, 1))
If intAsc > 31 And intAsc < 127 Then _
strOP = strOP & Chr(intAsc)
Next
fConvert = strOP
End Function
Public Function GetValue(ByVal keyName As String, ByVal strDefault As String) As String
Dim strVal As String * 100
Dim ret As Long
ret = GetPrivateProfileString(m_AppName, keyName, strDefault, strVal, Len(strVal), m_strFile)
If ret <> 0 Then
GetValue = fConvert(strVal)
Else
GetValue = "Error"
End If
End Function
Public Function SetValue(ByVal keyName As String, ByVal strValue As String) As Boolean
Dim ret As Long
ret = WritePrivateProfileString(m_AppName, keyName, strValue, m_strFile)
If ret = 0 Then
SetValue = False
Exit Function
End If
SetValue = True
End Function