January 18, 2015, 4:41 am
When working with SCRRUN.dll, it is pretty intelligible to use codes, which are shown below, to access and alter file names and folder names.
vb Code:
file.name = filename
folder.name = foldername
Can't find any equivalent in vbRichClient but am I supposed to use cFSO.MultiFileRename?
↧
January 16, 2015, 1:37 pm
I wrote an mp3 player in VB6. I used to be a professional OS writer. No one has been successful with a conversion effort yet. The last time a vb6 image was successfully built was 2005. I do not remember what the version of Windows was. I do have the vb6 sources. Somehow mscomctl.ocx seems to be involved in the conversion errors.
It would mean much to me to convert the mp3 player to .Net. But when I went to install VB6 it never stopped running from disc 1 on the Windows 64 bit preview and I know the trick with java.
I need help with conversion which is both complex and straight forward. I've been a pedestrian hit by a car since then.
Renee
↧
↧
January 18, 2015, 7:44 pm
Forgive me. I know f10 single steps with the .Net debugger but I forgotten how with vb6.
Renee
↧
January 19, 2015, 2:48 am
Hello
I know this is an old language but the company I work for has a very old TAPI system and requires the ability to record from the TAPI line when a call is in progress.
It already plays messages and listens to DTMF tones successfully.
But after searching the net for any answer I cannot find any example / solution where someone has successfully recorded a telephone conversation in VB6.
I have been able to record using the MCISendCommand from the sound card but I cannot find anything that either lets me record the TAPI call or route the sound to the sound card so I can record it.
So my first question is, is this even possible using VB6?
If it is does anyone have any examples of VB6 code to put me on track.
Thanks in advance.
Neil
↧
January 19, 2015, 5:52 am
Hi guys...
I have a rich textbox, in which I load RTF file containing words of my regional language. Some letters of my language are on special characters like ]}[ \/{>< etc. I faced a problem in RTB that if the word at the end of line contains some special character, then letters prior to special characters remain in first line and the letters after the special character goes to next line, which spoil the whole word.
Suppose the word at the end of first line is s[jkvk then s remains in first line and [jkvk goes to next line,
However the requirement is that whole word go to next line (if contains special character at the end of line).
Thanks in advance.
↧
↧
January 19, 2015, 8:44 am
i have 2 controls in my form
DtStartDate which is a date value
DtStartTime which is a time value
i need to combine these 2 and insert it as a single value in the database
i tried a code but only the date was insert
Code:
StrSql = StrSql & "#" & Format(DtStartDate, "DD/MM/YYYY", DtStartTime) & "#,"
what is wrong?
any help will be appreciated
regards
salsa 31
↧
January 19, 2015, 12:18 pm
Hello guys ...
I have always been wondering if we could make a program which can re-structure its written code with additional files...
let me explain more : Imagine you have written and compiled a program into EXE format and then you want to control the program with some additional files , for example through internet usage. It means that If Sample.EXE is my program and its duty is to print statement "Hello Friends" , should re-structure itself with my ,for example , config file that orders program to print "Bye" instead of "Hello Friends". The most important point is that program should save the change , means re-compile itself as exe format again. By the way , the example I just gave you is an example! I know that we can do the same work as following :
Code:
Private Sub cmdPrint_Click()
Dim File As String
Open "D:\config.txt" For Input As #1
Input #1, File
Close #1
Print File
End Sub
My question might have no possible answer , but worths thinking!
Thanks in advance:wave:
↧
January 19, 2015, 2:26 pm
This will only apply to a small portion of our VB community.
I wanted to start moving my XP installation into a virtual hard drive. Still have my original XP CD, so no problem installing it there. However, I also wanted apply latest service packs & some other updates for XP. Launching from my XP virtual drive, Microsoft simply displays a window that says basically, "time to upgrade your pc" and doesn't offer the downloads. In fact "Windows Update" kept erroring even after opting to install their ocx.
Well as I'm waiting patiently for XP Service Pack 3 to install, thought I'd throw this out there. Simply use a higher O/S to get the downloads. Copy the downloaded file(s) to the virtual drive. During the download process, Microsoft will try to reroute you to the software more appropriate for your current O/S, but allows you to ignore & download anyway. I'd prefer to get the software from Microsoft vs. some untrusted generic download site.
FYI: Getting IE8 that would install on XP, from Microsoft, was more of a challenge.
↧
January 19, 2015, 2:51 pm
I have 1 MDIForm and 2 MDIChild forms, Form1, Form2.
Here is the codes.
---------------------------------------------------------
[MDIForm]
Private Sub MDIForm_Load()
Load Form1
End Sub
[Form1]
Private Sub Command1_Click()
Load Form2
'=========> wait until form2 is unloaded
'Do something here
End Sub
[form2]
Private Sub Command1_Click()
Unload Me
End Sub
---------------------------------------------------------
As you see, MDIForm load Form1.
Form1 load Form2.
At this point, I want to have form1 to wait until Form2 is unloaded(do something after Form2 is unloaded).
How could I do this?
Can anybody give me idea?
↧
↧
January 20, 2015, 12:44 am
i am trying to figure out how can i create an Appointment According to the day of the week
i have 2 controls
Code:
1)DatePicker
2)CmbDays ( a combobox which holds the days Sunday,Monday,.......and so on)
i know there is something with DateAdd that will change the Datepicker value
E.X
if today is Tuesday and the Datepicker is 20/01/2015
then if i choose From The combobox the Day Sunday then it will calculate the date from now(According to the Datepicker which is 20/01/2015) to the date which falls on sunday which is 25/01/2015
whatever day i pick from the combobox it will calculate the interval between them
is it possible with dateadd or something similar?
any help will be appreciated
regards salsa31
↧
January 20, 2015, 7:14 am
I have internet disks which has password and ID,and want to write code to access them.
My code is as below
Set wsh= WScript.CreateObject("WScript.Shell")
returnvalue=wsh.run ("net use address /ID password",0,true)
but sometimes the internet is slow or the password is changed ,wsh does not respond and the code hangs at returnvalue=wsh.run ("net use address /ID password",0,true)
How to modify the code and then it can check if the disk can be accessed(right password) and wait for a set time such that it passes the disk if takes too much time for responding?
↧
January 20, 2015, 8:37 am
First, I put some effort trying to find a better place to post this and could not, so if I guessed wrong please move.
I want to start teaching myself visual basic, and it seems the more research I do, the more confusing things become. My self-created "roadmap" isn't working and I suspect it's because I have it wrong.
My Plan:
1) Download and install whatever Visual Basic software necessary.
2)Find a "How to" guide, along the lines of "Visual Basic for Dummies"
3) Immediately write a small program that blanks the screen and says "Hello World"
My problem is that I can't get a clear understanding of what "visual basic software" I need to download & install. There seems to be different versions, different names, etc... From what research I've done, I can't get a clear idea of WHAT the software should be that I'm after. Nor do I find a download location.
I have a sort of "How to" guide, but it seems the whole text is intended to get the reader to use the Microsoft store, and write applications for the touch screen technology for Windows 8. Appears to be Microsoft-published, and seems to have an agenda trying to get people to write for Win8 rather than teaching them how to use Visual Basic. I get the feeling that I could spend a month or more trying to learn something from this e-book and at the end of the process discover that I know how to do something I don't want to do, and I don't know how to do something that I DO want to do.
So rather than continue to spin my wheels, I'm asking for help. I have some rudimentary knowledge of programming, and can teach myself what I need to know, as long as I get some basic guidance on where to start and where to go. Thanks in advance.
↧
January 20, 2015, 10:50 am
Morning everyone - I have what I hope is a fairly easy question, but I'm a bit lost... I have an old SQL DTS package that I need to modify. This is a billing application that runs for multiple "Hubs" a specific file I need is over-written multiple times for each run - I would like to save out a copy of the files for troubleshooting if there is a problem... I'm trying to attach a datetime stamp to the file name (it will take a few seconds to finish one, re-run the next one, so the names should be different) The spot that appears the easiest is when its "Ftp"ing the file.... Below is the code...
Code:
Function Main()
dim filename
' use the output file name to generate an FTP command file
set oFSO = CreateObject("Scripting.FileSystemObject")
set oFile = oFSO.OpenTextFile( DTSGlobalVariables ("TransferFTPGetOutput").Value , 2, 1)
oFile.writeline ("open " & DTSGlobalVariables("TransferFTPServer"))
oFile.writeline DTSGlobalVariables("TransferFTPLogin")
oFile.writeline DTSGlobalVariables("TransferFTPPassword")
oFile.writeline "cd edi"
oFile.writeline "cd output"
oFile.writeline "lcd \\Vmsqlsched\snf_edi_outbound\Beverly\EDI\GGNSC\837_Files"
oFile.writeline "get 8374010.txt"
oFile.writeline "lcd \\Vmsqlsched\snf_edi_outbound\Beverly\EDI\GGNSC\Current"
oFile.writeline "get 8374010.txt"
oFile.writeline "get error.txt"
oFile.writeline "get clesfile.txt"
oFile.writeline "get controlh.txt"
oFile.writeline "get RunStats.log"
oFile.writeline "lcd \\Vmsqlsched\SNF_EDI_OUTBOUND\Beverly\EDI\GGNSC\Keyword_Files"
oFile.writeline "get 8374010.txt"
oFile.writeline "delete keyword.txt"
oFile.writeline "quit"
oFile.Close
set oFile = nothing
Main = DTSTaskExecResult_Success
End Function
I have created a new directory called \\Vmsqlsched\SNF_EDI_OUTBOUND\Beverly\EDI\GGNSC\Keyword_Files\Archive and would like a copy of each file to be put there, so I would think I would make the modification as below:
Code:
Function Main()
dim filename
'dim newfileName As String = String.Format("keyword_{0}.txt", Now.ToString("MMddyyyy_hhmmss"))
'not sure about above, and not sure how to rename with FTP the VB name..??
' use the output file name to generate an FTP command file
set oFSO = CreateObject("Scripting.FileSystemObject")
set oFile = oFSO.OpenTextFile( DTSGlobalVariables ("TransferFTPGetOutput").Value , 2, 1)
oFile.writeline ("open " & DTSGlobalVariables("TransferFTPServer"))
oFile.writeline DTSGlobalVariables("TransferFTPLogin")
oFile.writeline DTSGlobalVariables("TransferFTPPassword")
oFile.writeline "cd edi"
oFile.writeline "cd output"
oFile.writeline "lcd \\Vmsqlsched\snf_edi_outbound\Beverly\EDI\GGNSC\837_Files"
oFile.writeline "get 8374010.txt"
oFile.writeline "lcd \\Vmsqlsched\snf_edi_outbound\Beverly\EDI\GGNSC\Current"
oFile.writeline "get 8374010.txt"
oFile.writeline "get error.txt"
oFile.writeline "get clesfile.txt"
oFile.writeline "get controlh.txt"
oFile.writeline "get RunStats.log"
oFile.writeline "lcd \\Vmsqlsched\SNF_EDI_OUTBOUND\Beverly\EDI\GGNSC\Keyword_Files"
oFile.writeline "get 8374010.txt"
'START NEW CODE
oFile.writeline "lcd \\Vmsqlsched\SNF_EDI_OUTBOUND\Beverly\EDI\GGNSC\Keyword_Files\Archive"
oFile.writeline "get keyword.txt" '<-- New file with appended timestamp
oFile.writeline "delete keyword.txt" '<- go ahead and remove old
oFile.writeline "quit"
oFile.Close
set oFile = nothing
Main = DTSTaskExecResult_Success
End Function
I hope its clear what I'm trying to do - any help would be greatly appreciated.
Thanks!
↧
↧
January 20, 2015, 3:19 pm
Hi just trying to make application which will run another program with parameter
path to program will get by right click on it and my application add parameter and then run highlighted program with parameter
Problem for now is how get file path when file is highlighted in windows
I am using vba 2010 expres
cheers in advance if anybody would like to share some knowledge with very green beginner
↧
January 20, 2015, 11:34 pm
Guys!
Need your help on this one. I'm creating a script in VB6 that will run a command prompt with a command then will extract on a text file.
On text file there's a word "groups" on it and I need to read those lines and assigned it to another string..
Example:
Private Sub Command1_Click()
Dim strComputer, strCommand, As String
strComputer = Text1.Text
strCommand = "ping " & " " & strComputer
Shell("CMD /k" & strCommand & " > C:\Text.txt", vbNormalFocus)
End Sub
this command will create a text file on C: drive named "Text.txt".. What I need is to read the a line of that text file and find a word that I need.
↧
January 20, 2015, 11:50 pm
Hello guys ...
I want to change position of shapes like rectangular in vb form. What I simply did is this :
-2 timers both with interval : 1 | Enabled = False
-A rectangular shape called "Shape1"
-2 Command buttons = First : cmdMove | Second : cmdStop
-Some labels to show information
Here is what I coded :
Code:
Private Sub cmdMove_Click()
Timer1.Enabled = True
Timer2.Enabled = True
LBTimer1.Caption = "Timer1 Enabled"
LbTimer2.Caption = "Timer2 Enabled"
LBTimer1.ForeColor = RGB(50, 250, 200)
LbTimer2.ForeColor = RGB(50, 250, 200)
End Sub
Private Sub cmdStop_Click()
Timer1.Enabled = False
Timer2.Enabled = False
LBTimer1.Caption = "Timer1 Disabled"
LbTimer2.Caption = "Timer2 Disabled"
LBTimer1.ForeColor = RGB(0, 0, 0)
LbTimer2.ForeColor = RGB(0, 0, 0)
End Sub
Private Sub Timer1_Timer()
Shape1.Left = Shape1.Left - 10
LBShape.Left = LBShape.Left - 10
End Sub
Private Sub Timer2_Timer()
If Shape1.Left = 0 Then
Call cmdStop_Click
End If
LbShapeLeft.Caption = Shape1.Left
End Sub
I actually got timer2 for checking every millisecond of the If statement
Here is the result :
1 :
![Name: 1.jpg
Views: 63
Size: 47.1 KB]()
2 :
![Name: 2.jpg
Views: 38
Size: 55.9 KB]()
3 :
IT works!!! :check: :eek: But there are some problems :
First :
If I change Timer1 code to :
Code:
Private Sub Timer1_Timer()
Shape1.Left = Shape1.Left - 100
LBShape.Left = LBShape.Left - 100
End Sub
Then it won't stop!!!:confused:
I think the problem occurs because we don't have interval less than 1 and on the other hand , the shape moves in faster range which Timer 1 can not handle!
Second :
It doesn't work in all situations. For example , If there CPU is devoted to other tasks in PC then it won't stop the shape accurately.
Any suggestion ?! :bigyello:
Thanks for reading! :wave:
↧
January 21, 2015, 1:42 am
is it possible to have a random login password each day based on date and time?
for security reasons.
Any idea?
↧
↧
January 21, 2015, 1:43 am
Hello guys,
I've got two codes, one for SYSTRAY (in a class module) and another for TRAYBALLONTIP (in a module), both working perfectly, (I mean SYSTRAY give me an icon that I implemented some menus, and the TRAYBALLONTIP display me a Tooltip in systray bar with its own icon; so in brief I have two ICON in the systray bar; It's really something that I do refuz !!!)
The Systray API use
Code:
Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pIconSystray As NOTIFYICONDATA) As Boolean
and TRAYBALLONTIP use this API
Code:
Public Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
plus
Code:
Public Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd As Long) As Long
and this is the whole code for the TRAYBALLONTIP in Module :
Code:
'Notice the changes here from the old 'standard' NOTIFYICONDATA
Public Type NOTIFYICONDATA
cbSize As Long
hWnd As Long
uID As Long
uFlags As Long
uCallbackMessage As Long
hIcon As Long
szTip As String * 128
dwState As Long
dwStateMask As Long
szInfo As String * 256
uTimeout As Long
szInfoTitle As String * 64
dwInfoFlags As Long
End Type
Public Const NOTIFYICON_VERSION = 3 'V5 style taskbar
Public Const NOTIFYICON_OLDVERSION = 0 'Win95 style taskbar
Public Const NIM_ADD = &H0
Public Const NIM_MODIFY = &H1
Public Const NIM_DELETE = &H2
Public Const NIM_SETFOCUS = &H3
Public Const NIM_SETVERSION = &H4
Public Const NIF_MESSAGE = &H1
Public Const NIF_ICON = &H2
Public Const NIF_TIP = &H4
Public Const NIF_STATE = &H8
Public Const NIF_INFO = &H10
Public Const NIS_HIDDEN = &H1
Public Const NIS_SHAREDICON = &H2
Public Const NIIF_NONE = &H0
Public Const NIIF_WARNING = &H2
Public Const NIIF_ERROR = &H3
Public Const NIIF_INFO = &H1
Public Const NIIF_GUID = &H4
Public Const WM_MOUSEMOVE = &H200
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONUP = &H205
Public Const WM_RBUTTONDBLCLK = &H206
Public Declare Function SetForegroundWindow Lib "user32" _
(ByVal hWnd As Long) As Long
Public Declare Function Shell_NotifyIcon Lib "shell32" _
Alias "Shell_NotifyIconA" _
(ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
another TRAYBALLONTIP code in GENERAL DECLARATION Section of the mainForm :
Code:
Private m_IconData As NOTIFYICONDATA
and the last TRAYBALLONTIP code in the mainForm to handle the event "MINIMIZE WINDOW", when the user try to minimize the window the TRAYBALLONTIP display a tooltip to inform, with message "the window has been minimized on the systray bar"
Code:
'Set up the structure
' IF szInfoTitle and szInfo are not terminated with 'null' the box is huge!
With m_IconData
.cbSize = Len(m_IconData)
.hWnd = Me.hWnd
.uID = vbNull
.uFlags = NIF_ICON Or NIF_INFO Or NIF_MESSAGE Or NIF_TIP
.uCallbackMessage = WM_MOUSEMOVE
.hIcon = Me.Icon
'.szTip = "Your Message Here" & vbNullChar
.dwState = 0
.dwStateMask = 0
.szInfo = " L'application est minimisée dans la zone de notification" & Chr(0)
.szInfoTitle = " Dictionnaire " & Chr(0)
.dwInfoFlags = NIIF_INFO
.uTimeout = 3000
End With
Shell_NotifyIcon NIM_ADD, m_IconData
Shell_NotifyIcon NIM_MODIFY, m_IconData
I tried to work on it with the aim of having only two APIs, instead of 3, and the whole in a module, but I failled, as I'm not really very EXCELLENT in this staff.
My concern is : I need to implement a SYSTRAY with the same code of TRAYBALLONTIP (I mean same APIs)
Please How to do?
↧
January 21, 2015, 3:51 am
Hey there,
I have a problem with a MSChart. It reads the data from a FlexGrid. Depending on the items selected in a checked listbox(corresponding to the columns of the flexgrid), I'd like to plot these two items on the same chart, but if I use a 2XY chart type the secondary y axis is not considered.
This is the code:
With MSFlexGrid
ReDim Data(0 To 100, 1 To 3)
For k = 0 To list.ListCount - 1
If list.Selected(k) Then
For lRow = 0 To 100
Data(lRow, 1) = val(.TextMatrix(lRow, 1)) 'X AXIS
Data(lRow, 2) = val(.TextMatrix(lRow, k+1)) 'Y AXIS
Data(lRow, 3) = val(.TextMatrix(lRow, k+1)) 'SECONDARY Y AXIS
Next lRow
End If
Next k
End With
How can I solve the problem?
Thanks all.
↧
January 21, 2015, 3:56 am
Please give suggestion and explanation about the following program and Errors.
Private Sub Command3_Click()
'Generate a string between 4 and 7 characters long, inclusive
MsgBox A(4, 7)
End Sub
Private Sub Form_Load()
Randomize
End Sub
Public Function A(intMin As Integer, intMax As Integer) As String
Dim intLen As Integer
Dim lngNdx As Long
'Valid characters
Const CHARACTERS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
'Determine length of output
intLen = Int((intMax - intMin + 1) * Rnd + intMin)
'Generate the output
For lngNdx = 1 To intLen
A = A & Mid$(CHARACTERS, Int((Len(CHARACTERS)) * Rnd), 1)
Next
Picture1.Print A
End Function
↧