Registry Startup Error
Dim Reg As Object Set Reg = CreateObject("wscript.shell") Reg.RegWrite "HKEY_LOCAL_MACHINESOFTWAREMICROSOFTWINDOWSCURRENTVERSIONRUN" & "App.EXEName", App.Path & "" & App.EXEName & ".exe"
run time error 2147024770 (8007007e)
Set Reg = CreateObject("wscript.shell")
any ideas :S?thanks
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Registry Startup Key
I've tried reading through a couple of examples but I can't really differentiate between what's what. Here's what I want to do:
I have a checkbox that says 'Start with windows.' When it is ticked, I want to create a key in HKCU...RUN with the path and when it is unticked I want it to delete this key.
Thanks for any help.
Registry Startup With XP
I knwo how to add something to the startup in Windows with VB and I can do it in the LocalMachine or CurrentUser but forr XP that has multiple logins on the one machine, how can I have it run for all users without having to do the install on each user? If I do it on the LocalMachine key, it only works if users have admin access.
Any suggestions?
Thanks!
Registry To 'On StartUp'?!
I wanna put an option in my app so the user can choose if he wants the app to b open on startup of windows.
is there a key for that option in the registry so i can write to it?
Registry And Startup
I want to be able to search through the registry and the win.ini to find all programs that are started up with my computer and list them in a ListView.
Does anyone have any ideas how I can go about doing this?
Startup Registry
I'm trying to get my program to run on startup of windows. I know about the Start Up folder, but that sounds flimsy.
I searched for some info about using the registry and it says to use the key
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun
but I don't know what to do from then on(and how to) in visual basic. Any helps?
Registry Startup
Hi Folks,
Just wondered if any of you knew where the registry strings are that startup up programs and other files? I know I could use the startup folder or win.ini etc, but I want to know where abouts those registry settings are. Thanx
Rhys
--------------
VB6 LE
Startup With Registry
I need to know how to make my program start up when the computer turns on, and I don't want to put in in the Startup folder in the programs/start menu. Is there a startup key in the registry where I can add my program into? Please help. Thanx.
-Mike
Help On Run-at-startup In Registry
I need my program to run on startup... One way is to place a shortcut in the STARTUP folder in the Start menu and another is putting it in the registry (That's a scary place). I know where to put it to run on Startup on my Computer, but do all the Windows Platforms have that same path?
Add To Registry-Startup
Hi Guys...
Could someone please tell me, how do i add code into my program to add itself into:
"HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun"
Does any1 have the code to do this, and where do i insert this code, such as it only executes the code the 1st time, add itself(the program) to the registry, and makes the program start everytime windows start up??
I know how to do it manually, but how do i do it through code.
Thanks guys
<DIESEL>
If it wasn't for the last minute, NOTHING would get done!!!
How Do I Add A Startup Item To The Registry?
How do i add a startup item to the registry?
I want to add "c:Text.exe" to start up when windows start up.
So i want to edit the Registry location or the startup item, location is:
"My ComputerHKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersion Run"
i want to add this string to it
Value name: Test
Value data: c:Test.exe
How would i do this? I read the example at http://www.mentalis.org/apilist/RegCreateKey.shtml but i didn't get it.
Can any one help with this?
Startup Registry Key Problem
Hi,
I have developed an application called "Quick Access XP" it is a program that basicly has a series of command buttons which allows a user to open up notepad e.c.t using the "Shell" command. I have programed the application to start as a tray icon and when it is clicked once (by left or right mouse button) it displays my program. I have menus which allow the user to minimize to tray and to exit. Also I have a Help menu which displays an about form.
Anyway everything works fine but now I want to make my program (using a reg key in HKEY_LOCAL_MACHINEsoftwaremicrosoftwindowscurrentversion
un)
boot every time the PC starts so it is easily accessable by the user.
This is were I am having trouble I have tried reusing code from sample apps so many times it isn't funny but none of them seem to work.
This is my latest attempt:
On Error Resume Next ' Make sure no errors occur
If App.PrevInstance = True Then End ' If its already running , close this version
regkeyname = "QuickAccessXP"
UpdateKey &H80000002, "softwaremicrosoftwindowscurrentversion
un", regkeyname , App.Path & "" & App.EXEName & ".exe"
When it is run it comes up with this error "ByRef argument type mismatch"
and highlights the word in orange.
If you have read this far I THANK YOU very much in advance and if you chose to try and help me that is even better!
Thanks
How Can U Put A Program In Startup Via Registry?
how can you make the program automatically start up , by modifying the registry??
I find it more reliable.. but i dont know how to do it
can anybody tell me where the reg location is located?
Registry Startup Question
if i want to add an entry to my
HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun
does the 'name' have to be the name of the exe?
e.g... if this set the entry in registry
SetKeyValue HKEY_CURRENT_USER, "SoftwareMicrosoftWindowsCurrentVersionRun", "name", "C:lah.exe", Reg_String
would blah.exe startup everytime windows started, if that entry was in registry?
Startup Registry Code
VB Code:
Private Sub Form_Load()'Add the program to regedit. So it runs each time the computer restarts. Dim sAppEXE As String sAppEXE = App.Path & IIf(Right$(App.Path, 1) = "", "", "") & App.EXEName & ".exe" SaveSettingString HKEY_CURRENT_USER, "SoftwareMicrosoftWindowsCurrentVersionRun", App.Title, Chr$(34) & sAppEXE & Chr$(34)End Sub
do i need something for the 'SaveSettingString ' part? or will the code work fine as it is to make the program restart on my pc
Registry Startup Flags
Hello !
I am developing a software which loads itself in to the Systm Tray when windows loads.
I have created a value in the registry HKLM / Run section.
I have seen that many startup applications have put flags in the value data after specifying the path of the application.
i.e. /background /min -onboot -quite etc.
My question 1. What is the purpose of using thease flags?
My question 2. Could any body give the complete list of flags and it's Usage?
Thanks and looking forward to see the replies.
App As Startup Registry Problem.
Error:
Quote:
Compile error:
Argument not optional
Code
VB Code:
Private Sub cmdSaveChanges_Click() On Error GoTo cmdSaveChanges_Click_Err Dim SetNTService As Long SetNTService = App.Path & "" & App.EXEName & ".exe" If cboNTService.Text = "Enabled" Then SaveSetting "HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionRun", "Operations Manager Pro", SetNTService Else DeleteSetting "HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionRun", "Operations Manager Pro", SetNTService End If Unload Me Exit SubcmdSaveChanges_Click_Err: STZ_ErrHandleFILE "cmdSaveChanges_Click"End Sub
Add File To Startup-registry
I'm want to make a program that you enter a filename of a exe or batch file into a text box and you click on a cmd that file will start when your computer starts. I would want it to use the registry, unfortunately, I have no clue on how to do this. Can somebody tell me how to make add something to the registry to make an app load up on startup? Thank you for your time
API Find Startup Registry
IS there an API that will tell me that path to the RUN folder in the registry?
you know
"HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun""
thanks
Run On Startup / Code For Registry ???
How do you get a program to run when the PC is restarted.
For some reason, some methods dont work on the particular PC's I'm using it on eg: putting it in the windowsstart menuprogramsstart up directory wont work.
Could you therefore post any way you know even if there is already other methods posted.
Thanks All
Adding To Startup Registry
ide like a simple startup registry code. nothing special, just one that will aloow me to have my add startup on every boot up.
Registry And Windows Startup.
hello.
I just found in some of the faqs one that posted by kgo how to run your program when windows starts,
Code:Dim Reg As Object
Set Reg = CreateObject("wscript.shell")
Reg.RegWrite "HKEY_LOCAL_MACHINESOFTWAREMICROSOFTWINDOWSCURRENTVERSIONRUN" & App.EXEName, App.Path & "" & App.EXEName & ".exe"
but the problem is that I have a preferences in my prog with checkbox ("Execute the program when Windows starts") so if there is a V in the checkbox so the code is entered to registry, but if there is no V so it need to be deleted if it was there. Can anyone help?
Check Registry Setting For Your App Startup
I know how to add my app to the registry so it will startup when the users computer starts, but I am a little confused on how to retrieve that value to check if its already been saved. I know in the sub it shows you how to get a saved registry setting, but again im still confused on how to get the start up registry setting.
I am using this method to save the entry:
------------------------------------------------------------------------
Code:
Call MakeStartUp(AddFile(App.Path, (App.EXEName & ".exe")))
------------------------------------------------------------------------
and this is the sub for it:
-------------------------------------------------------------------------
Code:
Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Public Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Public Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As Long
Public Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long
Public Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Public Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
Public Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Public Const REG_SZ = 1 ' Unicode nul terminated String
Public Const REG_DWORD = 4 ' 32-bit number
Public Const HKEY_CLASSES_ROOT = &H80000000
Public Const HKEY_CURRENT_USER = &H80000001
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const HKEY_USERS = &H80000003
Public Const HKEY_PERFORMANCE_DATA = &H80000004
Public Const ERROR_SUCCESS = 0&
'Option Explicit
Const UNIT_NAME = "UTILITY"
Public Sub MakeStartUp(FileName As String)
Dim Counter As Integer
Dim MarkPos As Integer
Dim Application As String
Application = GetFileName(FileName)
Application = Left(Application, (Len(Application) - 4)) 'Replace(Application, ".exe", "", , , vbTextCompare) & "~@#"
Call SaveString(HKEY_LOCAL_MACHINE, "SOFTWAREMicrosoftWindowsCurrentVersionRun", Application, FileName)
End Sub
Public Sub SaveKey(hKey As Long, strPath As String)
Dim KeyHand&
Dim r As Long
r = RegCreateKey(hKey, strPath, KeyHand&)
r = RegCloseKey(KeyHand&)
End Sub
Public Function GetString(hKey As Long, strPath As String, strValue As String)
'EXAMPLE:
'
'text1.text = getstring(HKEY_CURRENT_USE
'
' R, "SoftwareVBWRegistry", "String")
'
Dim KeyHand As Long
Dim datatype As Long
Dim lResult As Long
Dim strBuf As String
Dim lDataBufSize As Long
Dim intZeroPos As Integer
Dim r As Long
Dim lValueType As Long
r = RegOpenKey(hKey, strPath, KeyHand)
lResult = RegQueryValueEx(KeyHand, strValue, 0&, lValueType, ByVal 0&, lDataBufSize)
If lValueType = REG_SZ Then
strBuf = String(lDataBufSize, " ")
lResult = RegQueryValueEx(KeyHand, strValue, 0&, 0&, ByVal strBuf, lDataBufSize)
If lResult = ERROR_SUCCESS Then
intZeroPos = InStr(strBuf, Chr$(0))
If intZeroPos > 0 Then
GetString = Left(strBuf, intZeroPos - 1)
Else
GetString = strBuf
End If
End If
End If
End Function
Public Sub SaveString(hKey As Long, strPath As String, strValue As String, strdata As String)
'EXAMPLE:
'
'Call savestring(HKEY_CURRENT_USER, "Sof
'
' twareVBWRegistry", "String", text1.t
' ex
' t)
'
Dim KeyHand As Long
Dim r As Long
r = RegCreateKey(hKey, strPath, KeyHand)
r = RegSetValueEx(KeyHand, strValue, 0, REG_SZ, ByVal strdata, Len(strdata))
r = RegCloseKey(KeyHand)
End Sub
Function GetDWord(ByVal hKey As Long, ByVal strPath As String, ByVal strValueName As String) As Long
'EXAMPLE:
'
'text1.text = getdword(HKEY_CURRENT_USER
'
' , "SoftwareVBWRegistry", "Dword")
'
Dim lResult As Long
Dim lValueType As Long
Dim lBuf As Long
Dim lDataBufSize As Long
Dim r As Long
Dim KeyHand As Long
r = RegOpenKey(hKey, strPath, KeyHand)
' Get length/data type
lDataBufSize = 4
lResult = RegQueryValueEx(KeyHand, strValueName, 0&, lValueType, lBuf, lDataBufSize)
If lResult = ERROR_SUCCESS Then
If lValueType = REG_DWORD Then
GetDWord = lBuf
End If
'Else
'Call errlog("GetDWORD-" & strPath, Fals
'
' e)
End If
r = RegCloseKey(KeyHand)
End Function
Function SaveDword(ByVal hKey As Long, ByVal strPath As String, ByVal strValueName As String, ByVal lData As Long)
'EXAMPLE"
'
'Call SaveDword(HKEY_CURRENT_USER, "Soft
'
' wareVBWRegistry", "Dword", text1.tex
' t)
'
'
Dim lResult As Long
Dim KeyHand As Long
Dim r As Long
r = RegCreateKey(hKey, strPath, KeyHand)
lResult = RegSetValueEx(KeyHand, strValueName, 0&, REG_DWORD, lData, 4)
'If lResult <> error_success Then
' Call errlog("SetDWORD", False)
r = RegCloseKey(KeyHand)
End Function
Public Function DeleteKey(ByVal hKey As Long, ByVal strKey As String)
'EXAMPLE:
'
'Call DeleteKey(HKEY_CURRENT_USER, "Soft
'
' wareVBW")
'
Dim r As Long
r = RegDeleteKey(hKey, strKey)
End Function
Public Function DeleteValue(ByVal hKey As Long, ByVal strPath As String, ByVal strValue As String)
'EXAMPLE:
'
'Call DeleteValue(HKEY_CURRENT_USER, "So
'
' ftwareVBWRegistry", "Dword")
'
Dim KeyHand As Long
Dim r As Long
r = RegOpenKey(hKey, strPath, KeyHand)
r = RegDeleteValue(KeyHand, strValue)
r = RegCloseKey(KeyHand)
End Function
Public Sub DeleteFromStartup(FileName As String)
Dim Counter As Integer
Dim MarkPos As Integer
Dim Application As String
Application = GetFileName(FileName)
Application = Left(Application, (Len(Application) - 4)) 'Replace(Application, ".exe", "", , , vbTextCompare) & "~@#"
Call DeleteValue(HKEY_LOCAL_MACHINE, "SOFTWAREMicrosoftWindowsCurrentVersionRun", Application)
End Sub
Public Function GetFileName(Path As String) As String
'returnes the filename from a path.
Dim Counter As Integer
Dim LastPos As Integer
LastPos = 1
For Counter = 1 To Len(Path)
If Mid(Path, Counter, 1) = "" Then
LastPos = Counter
End If
Next Counter
GetFileName = Mid(Path, (LastPos + 1), Len(Path))
End Function
Public Function AddFile(Path As String, File As String) As String
'This procedure adds a file name to a path.
If Right(Path, 2) = ":" Then
Path = Path & File
Else
Path = Path & "" & File
End If
AddFile = Path
End Function
Registry Keys To Start An App At Win Startup
are there any oher keys like
HKLMSoftwareMicrosoftWindowsCurrentVersionRun
HKLMSoftwareMicrosoftWindowsCurrentVersionRunOnce
HKCUSoftwareMicrosoftWindowsCurrentVersionRun
HKCUSoftwareMicrosoftWindowsCurrentVersionRunOnce
that i can use to run my app at windows startup i want a more hidden key than those
thnks
Registry Application Like Startup In Msconfig
i am new and need a little help. I have a project i am almost finished and am strugling with the last little bit of the project. i have created a listbox and have changed the type to checkbox. now what i want to do and need help with is this. I want to be able to list all the string names and values that exist at 7 different key and depending on what key they reside at, either have a check in the checkbox next to the string name and value that has been written to the listbox or not. for example: i want all the string names and values read from hkey_local_machinemicrosoftsoftwarewindowscurrentversion
un to be written to the listbox, as well as run-, runservices, runservices-,runonce, runonce-, etc...
If the string resides at a subkey that doesnt end in a "-" then the checkbox will be checked, but if the string and value do reside at a subkey that ends in a "-", the checkbox will be unchecked.
the second part i would like i to do is if you check or uncheck a box then it needs to copy the string value from the subkey with the "-" to the subkey without the "-" or vice versa.
basicly what this is is an application very similar to the startup portion of msconfig.exe in windows. please help me.
thank you
Mark
*RESOLVED* Windows Registry - Startup
Help!
I have an installation program that I wrote which installs an application on a clients PC. I would like to automatically add some code to the Windows registry so the application will start up each time the system re-boots. I have tried different API calls but have failed.
I am sure there is a "simple" API procedure for this. Can someone help me?
Thanks,
Puffgroovy
Edited by - Puffgroovy on 2/16/2005 7:10:18 AM
Editing The Registry To Launch My Program At Startup?
I know I need to use the win API of sorts to create a registry key to launch my program with windows. It's just basically my own personal little launch center... And rather than using the startup section (where my GF can delete the link - as she often does for no apparent reason) I'd like to have it in the registry where it will still come up but she will be sure not to find it =)
Thanks
Mike
Adding My File To The System Startup In The Registry
how can i add my file to the system startup in the registry
HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run"
HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\RunServices"
how is this done? i have seen source codes n searched this forum but nothings really got me any further
Unable To Read From Registry At Startup Everytime
Hi
I have a VB6 application which is in the startup folder. so it runs everytime the PC is turned on.
In the Main method - I am trying to find the name of the Computer from the Registry. The problem is that the code is not able to get the computer name every time. The field variable where the computer name is stored is g_cWorkStation. Perhaps the registry is inaccessible for a few milliseconds at startup ?
I am guessing here that the Registry has trouble sometimes getting hold of the Workstation name at startup OR there is a bug in my local class cRegistryAccess. cRegistryAccess handles all the information pertaining to the registry.
Has anyone heard of a similar problem ? where can I find out exactly what is going on ?
I set my registry object as follows
Set g_objReg = New cRegistryAccess
My code is as follow
'-----------------------------------------------------------------------------
Private Sub Main()
On Error GoTo ErrorHandler
'Init Prime/Drain labview event verification
g_bLabViewEventReceived = False
'Detect valid COM Port and connection
Set g_objDeviceInfo = New DeviceInfo
g_nCommPort = g_objDeviceInfo.DetectConnectedPort
g_objDeviceInfo.CommPort = g_nCommPort
'Set Device info XML Class
Set g_objDevice = New cDevice
' Show the splash screen.
frmSplash.Show
g_cWorkStation = g_objReg.GetRegistryValue(HKEY_LOCAL_MACHINE, _
"SYSTEMCurrentControlSetControlComputerNameActiveComputerName", "ComputerName")
Exit Sub
ErrorHandler:
MsgBox "Please ensure the device is connected properly, then try again."
If Not frmSplash Is Nothing Then
Unload frmSplash
End If
End Sub
RegOpenKeyEx Reads Registry Erratically In Startup
Hi Anyone expert in windows API function RegOpenKeyEx
I have a VB6 application. It is in startup folder - so it gets started as soon as the PC is turned on. In the MAIN method - I try to find the computer name. 90% of the time the application is successful. The error handler has been commented out - so I don't know what happens - but sometimes the application is unable to get the computer name.
Is there an access issue right at startup ?
following is my code.
I declare my windows API as follows
Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias _
"RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, _
ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As _
Long) As Long
in my MAIN method I am calling my class object to find the computer name
g_cWorkStation = g_objReg.GetRegistryValue(HKEY_LOCAL_MACHINE, _
"SYSTEMCurrentControlSetControlComputerNameActiveComputerName", "ComputerName")
----------------------------------------------------
My application then calls the following method
------------------------------------------
Public Function GetRegistryValue(ByVal RootKeyName As RootKeyConst, _
ByVal KeyPath As String, ByVal SubKeyName As String) As Variant
Dim lRetVal As Long 'result of the API functions
Dim hKey As Long 'handle of opened key
Dim vValue As Variant 'setting of queried value
GetRegistryValue = Null
lRetVal = RegOpenKeyEx(RootKeyName, KeyPath, 0, _
KEY_ALL_ACCESS, hKey)
'If Not Errors(lRetVal) Then
lRetVal = QueryValueEx(hKey, SubKeyName, vValue)
'If Not Errors(lRetVal) Then
If Len(CStr(vValue)) >= 1 Then _
If Asc(Right(CStr(vValue), 1)) = 0 Then _
vValue = Left(vValue, Len(vValue) - 1)
GetRegistryValue = vValue
'End If
'End If
RegCloseKey (hKey)
End Function
-----------------------------------------------------
i have no clue whats going on - Please help.
khalid
(khalidhaque@yahoo.com)
Error At Startup! I Need Help :(
I finished an application.. on my side everything is fine. when I send my app to another person this error shows up : application-defined or object defined error somebody knows what is this ? any solution ?
Stauf's Game Isn't Over
Error On Startup
I am using an ADODC connection to an Access 2000 database. I want to pass the project onto people and for the project to run no matter which directory the apllication is installed in. I have set the connection string as:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=database.mdb;Persist Security Info=False
i.e the source has no path, just the filename.
If I open the project by opening VB and open project (then run the project) I get an error stating file not found at C:Program FilesMicrsoft Visual StudioVB98database.mdb. (This is the directory where VB6 is installed).
However if I double-click the project file (ie not opening VB first) then I dont get the error and can run the project fine.
Any ideas why this happens? Also am I doing this correctly by not putting a path in the source? I just need the project to run on anyone's machine no matter where they put the files.
Startup Error
Hi all!
Today when I tried to launch VB6.0 all I get is a message box saying: System Error H8004005 (-2147467259), Undefined error.
And then it crashes back to Windows...
Does anyone have a clue?
Runtime Error 13 On Startup
hi,
iv been trying to install a program which i made in vb6, on windows 2000, but it doesnt want to run. the installation works, but when i run it, it gives me run time error 13, type mismatch. yet when i install the program on xp, it works fine.
to create the setup file i used innosetup 5,
i dont know what the reason could be! in my references i am used,
microsoft scripting runtime
microsoft activex data objects 2.5 library
microsoft activex data objects recordset 2.8 library
i have made this program on xp
if anyone knows what the problem might be...
thanks
Weird Error On VB6 Startup??
Twice in the last week or two I have gotten a weird error message at VB startup. Each time I shut VB down immediately and restarted it. The error did not recur.
Both times it happened I was in a hurry to work on an application and did not write down the exact message. It was something like the following.
Quote:
Method ?? Of object ?? Failed (Maybe not found instead of failed).
There was a strange shaped character where I have shown questions marks. I am sure that method was one of the words in the message.
VB seems to be working OK. I never tried using it without restarting after the error message occurred.
Does anybody have an idea about this?
Project Startup Error
Suddenly, for no apparent reason I am getting an error when trying to start up my project
It shows a message box headed "Data View"
With the error Method '~' of object '~' failed
Has anyone any insight into what this may mean ??
Thanks
(I have not added or removed any controls from the project for ages)
Unhandled Error At The Program Startup.
well to make my program autostart i did
my.computer.registry("HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCu rrentVersionRun" , "appname" , "c:/windows/app.exe")
then i restarted the computer and got the following error
unhandled exception has occurred in your application .If you click continue , the app will ignore this error and attept to continue . if you click quit the app will close immediatly.
The proccess cannot access the file ' c:/windows/app.exe' because it is being used by another process.
If i hit conntinue my app work as normal , but i dnt want this error dialog box to show up everytime my computer restarts.
thanks in advance.
ERROR: Must Have Startup Form Or Sub Main()
Hello
I'm creating Picture Viewer and every time I click 'Preview' (Start), it says Must have startup form or Sub Main() then it opens a new window (Project Properties)
Here's my code:
Code:
Private Sub Form_Load()
Left = (Screen.Width - Width) 2
Top = (Screen.Height - Height) 2
Combo1.Text = "All graphic files"
Combo1.AddItem "All graphic files"
Combo1.AddItem "All files"
End Sub
Private Sub Combo1_Change()
If ListIndex = 0 Then
File1.Pattern = ("*.bmp;*.wmf;*.jpg;*.gif")
Else
Fiel1.Pattern = ("*.*")
End If
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub DirSelect_Change()
File1.Path = Dir1.Path
File1.Pattern = ("*.bmp;*.wmf;*.jpg;*.gif")
End Sub
Private Sub DriveSelect_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
If Cmb1.ListIndex = 0 Then
File1.Pattern = ("*.bmp;*.wmf;*.jpg;*.gif")
Else
File1.Pattern = ("*.*")
End If
If Right(File1.Path, 1) <> "" Then
filenam = File1.Path + "" + File1.FileName
Else
filenam = File1.Path + File1.FileName
End If
Text1.Text = filenam
End Sub
Private Sub cmdShow_Click()
MMPlayer.FileName = Text1.Text
End Sub
Private Sub cmdShow_Click()
If Right(File1.Path, 1) <> "" Then
filenam = File1.Path + "" + File1.FileName
Else
filenam = File1.Path + File1.FileName
End If
Picture1.Picture = LoadPicture(filenam)
End Sub
What do I have to do? Please, help
Popup Menu And Form Startup Error
i have a problem,
my mdi child form, is loaded from a "popup" menu when the user clicks on a entry inside another mdi child form. for some reason, the loaded form loads in an unusal place (at the very bottom of the screen) where the user has to move it to see it. i have tried everything to set its startup position, even manualy through code, such as frmone.top=screen.height/2 etc etc nothing works it just loads over the top of the popup menu at the bottom of the screen.
any help will be appreciated, Cheers
Error In Pulling Up Microsoft Access Database With A Startup Form
I've got frmStartup that loads a hidden frmLogOutMonitor that closes out the original frmStartup form.
I have this because in other databases I may have frmStartup load other forms.
In the frmLogOutMonitor - Form_Open code I have the following:
Code:
Private Sub Form_Open(Cancel As Integer)
On Error Goto Err_Form_Open
'turns hourglass on
DoCmd.Hourglass (True)
'closes Startup form
SysCmd acSysCmdSetStatus, "Closing startup form ..."
DoEvents
DoCmd.Close acForm, "frmStartup"
'check properties for all databases
Call Check_Properties
The Check_Properties is a reference to Public Sub Check_Properties in a module and thus I have several of those that are under Form_Open that point to several modules in various areas. Each one of those modules also has error handling...
Keep in mind that frmLogOutMonitor is opened up as hidden - monitoring all kinds of events. It has a timer that uses ADODB to see if a table has a certain value that is checked off as false because if it isn't then it logs everyone out of the database!
If I don't have the proper Error Handling in this database (with another form) and it stops for some serious reason - then I start having issues with running the database. (even when I fix what's causing the error.)
Even if I decompile the database correctly - after all of that... remove the form from the Startup.... then decompile ... do a compression, then a repair...compile and save all modules.... then later put the form in the Startup....frmStartup it still will not run the database at all. It comes up with that Do you want to send this error to Microsoft?
So I know its technically corrupted. To overcome all this I create a new database and then load everything from the old one - since I can at least open the database if I don't have a form in the Startup. But I can't have this happen everytime I get an error. This is too serious to ignore that this will happen in the database.
When my .NET debugger comes up - it gives the following error:
Unhandled exception at 0x651078f1 in msaccess.exe 0xC0000005: Access violation reading location 0x001b89a7.
Address 651078f1 movzx eax, word ptr [edx+eax]
Do you want to Save changes to msaccess.sln?
An exception 'Unhandled Win32 Exception' has occurred in msaccess.exe
Any ideas how I can solve this?
Run VB Tray App At Startup But Not Via Startup Folder
Folks,
I have created a VB tray app and want to install it so that it runs when the machine is started, however I don't want to use the startup folder.
(You know like the MSN Messenger App.)
Someone told me that you can use the registry to do this but didn't say how.
Any suggestions would be greatly appreciated.
Cheers
John
Help With Registry Error
this gives me an error, can anyone help to fix it?
Code:
Public Sub GetAssoc(Extension As String, OutText As TextBox)
Dim vKey As Long
Dim vAppName As String
Dim vAppPath As String
RegOpenKey HKCR, Extension, vKey
RegQueryValueEx , vKey, "", 0, REG_SZ, vAppName, Len(vAppName)
RegOpenKey HKCR, vAppName & "shellopencommand", vKey
RegQueryValueEx , vKey, "", 0, REG_SZ, vAppPath, Len(vAppPath)
OutText = "The programs path associated to " & Extension & " is..." & vbCrLf & vAppPath
End Sub
also, can someone explain how to use ERROR_SUCCESS to see if it gave an error or not, thanks alot
Error On Getting Registry Val?
Hi all,
With this bit of code i can sucessfully return the value for a registry string value.
Code:
Dim Registry_Read As String
Dim Registry As Object
Set Registry = CreateObject("WScript.Shell")
Registry_Read = Registry.RegRead(someDefinedRegPath & "someKey")
However, that Registry_Read is in a loop that spins through a number of registries to check. But when it gets to the name of a registry that isn't there (was never created or has been deleted, etc), and yes it's possible that a particular registry entry isn't there yet in my app...it fails for a "invalid root in registry key".
without using something like 'on error resume next', how can i continue with the loop, bypassing the registry entry that wasn't found? later in the code I deal with what wasn't found.
I tried this, but of course it doesn't work:
Code:
If Len(Registry_Read) <> 0 Then
'process
end if
Any ideas?
Thanks.
|