|
Hello,
How to pass arguments to application created by VB
Thanks
|
|
|
|
|
Project | Properties menu -> Make Tab -> Command Line arguements.
Good luck!
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Maybe what you want is how to receive them: through the Command$ function
Crivo
Automated Credit Assessment
|
|
|
|
|
I think the problem may be the fact I am running visual studio.net under NT4, SP6A and not Win2000 prof. but just in case...
I build a simple form and add a project ( deployemnt project)
Set the project output to the simple project and attempt to build the solution.
The problem is I always get an error which states File access violation.
I check the path and it is to the project file. No files are Read only.
Has anyone else experienced this problem.
I get the same error if I try to build a CAB project also.
Wynn
|
|
|
|
|
Whenever I compile my VB programs on my coding system, they run fine and without problem. If I were to send an application over to a friend through E-Mail or run it on another computer through floppy disk, I get this error message that the publisher isn't authorized. The same error message when you run a java applet that you haven't downloaded online from an unknown company. Any ideas on how to fix this so that the computer recognizes my programs and doesn't ask the user if they trust me?
First Programmer: "How many bits are in a bite?"
Second Programmer: "You spelled bytes wrong."
First Programmer: *stares* "It's a joke, moron."
Second Programmer: "Joke...?"
|
|
|
|
|
Have your friend copy the executable to their harddrive, then run it through explorer. This is probably a security measure that has been built into your friends email program.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Does any body know if I can control my cooling fan on my laptop computer manually because it does not seem to work auto. when it hits the right temp. I want to test it. If I can’t do it in VB. Can I do that in another language?
|
|
|
|
|
You could try a non-virtual language like "resistor, +5V, voila!". Other than that you can only (with some motherboards) observe its behaviour, which I regard a good thing. Imagine any program that could access (stop) the CPU fan and burn another Athlon?
|
|
|
|
|
Think you
Mike Nordell wrote:
Imagine any program that could access (stop) the CPU fan and burn another Athlon?
Your right that would be bad.
|
|
|
|
|
Mike Nordell wrote:
Imagine any program that could access (stop) the CPU fan and burn another Athlon?
Some of them burn with the fan running normally
Crivo
Automated Credit Assessment
|
|
|
|
|
I have a data control and I need to pass in a Data object in a function's parameter. I'm the one making the function, so I can change it to a recordset, which is "ok" but it just doesnt make a whole lot of sense to do 1/2 of what i want to do outside of a function, and the rest inside of a function! (if i would pass a recordset)
So any suggestions? my boss remembers doing it but he forgot how. (uhh huh, yeah ok)
I believe it can be done, but all i want is a Data object, because that's the only thing i've really messed with in messing with Databases (i'm pretty new to VB but a veteran to C++)
Ok, thanks in advance!
~Timothy T. Rymer
http://tim.xpertz.com
http://www.digipen.edu
http://www.ttrx.com
|
|
|
|
|
I'm not sure if this is what you are looking for.... You might what to do a search for "Data aware class" on the MSDN.
Private Sub mysub(Data As Object)
End Sub
|
|
|
|
|
You are better off passing the recordset object if thats what you are going to be playing with. Otherwise you are using late binding. Something like this :
Sub DrawData(ByVal oRec as ADODB.Recordset)
Dim dField as Field
For Each dField in oRec.Fields
MsgBox dField.Value & " " & dField.Name
Next
End Function
Sub Main()
Dim oRecord as ADODB.RecordSet
Dim ssql as String
Dim oConnect As ADODB.Connection
oConnect.Open "Blah,Blah"
ssql = "SELECT * FROM table1"
oRecord.Open ssql, oConnect, adOpenForwardOnly, adLockReadOnly
DrawData(oRecord)
MsgBox "Success"
End Sub
|
|
|
|
|
One of our VB6 apps is designed to be able to print, and prints using the basic printform command.
On most printers, it prints fine, except for one, an HP 930c DeskJet. The app gives the error "Can't print form image to this type of printer". (I believe the error code is 486.)
We've tried some of the solutions found on the 'net (even the Microsoft one), but nothing has worked so far.
Anyone have this kind of problem before?
|
|
|
|
|
Hello!!!
I would like to know how I can add background to the whole Form, while the background file is a smaller than the Form size.
I don't want to create a large background which is .bmp file, but JPEG or GIF.
Thank you !!!!
Ahuva
|
|
|
|
|
Just set the Picture property of the form.
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
Make a .JPEG that's the same size as your form and set it as the Picture property on your form... like David said
First Programmer: "How many bits are in a bite?"
Second Programmer: "You spelled bytes wrong."
First Programmer: *stares* "It's a joke, moron."
Second Programmer: "Joke...?"
|
|
|
|
|
Hello !!!
I need help !
I would like to know how I can operate a mp3 when an event is ocour. What is the code line ?
Thank You !!!
Ahuva
|
|
|
|
|
Help Please...!
I'm trying to add a shutdown routine to a program using the ExitWindowsEx API function. I'm running on Windows XP. The problem is that the LookUpPrivilegeValue function keeps crashing out saying : Instance of an object is not set. As far as I know I'm not referencing an object merely calling a function. Can anyone help?
Here is the code I am using:
Option Explicit On
Imports System
Imports System.Runtime.InteropServices
Public Class ShutDownAPI
Private Const EWX_LogOff As Long = 0
Private Const EWX_SHUTDOWN As Long = 1
Private Const EWX_REBOOT As Long = 2
Private Const EWX_FORCE As Long = 4
Private Const EWX_POWEROFF As Long = 8
<dllimport("user32.dll")> Public Shared Function ExitWindowsEx(ByVal dwOptions As Long, ByVal dwReserved As Long) As Long
End Function
<dllimport("kernel32.dll")> Public Shared Function GetLastError() As Long
End Function
<dllimport("kernel32.dll")> Public Shared Function GetVersion() As Long
End Function
<dllimport("kernel32.dll")> Public Shared Function GetCurrentProcess() As Long
End Function
<dllimport("advapi32.dll")> Public Shared Function OpenProcessToken(ByVal ProcessHandle As Long, ByVal DesiredAccess As Long, ByVal TokenHandle As Long) As Long
End Function
Private Declare Function LookupPrivilegeValue Lib "advapi32.dll" Alias "LookupPrivilegeValueA" (ByVal lpSystemName As String, ByVal lpName As String, ByVal lpLuid As LUID) As Long
<dllimport("advapi32.dll")> Public Shared Function AdjustTokenPrivileges(ByVal TokenHandle As Long, ByVal DisableAllPrivileges As Long, ByVal NewState As TOKEN_PRIVILEGES, ByVal BufferLength As Long, ByVal PreviousState As TOKEN_PRIVILEGES, ByVal ReturnLength As Long) As Long
End Function
<dllimport("kernel32.dll")> Public Shared Sub SetLastError(ByVal dwErrCode As Long)
End Sub
Private Const mlngWindows95 = 0
Private Const mlngWindowsNT = 1
Private glngWhichWindows32 As Long
Public Structure LUID
Public UsedPart As Long
Public IgnoredForNowHigh32BitPart As Long
End Structure
Public Structure LUID_AND_ATTRIBUTES
Public TheLuid As LUID
Public Attributes As Long
End Structure
Public Structure TOKEN_PRIVILEGES
Public PrivilegeCount As Long
Public TheLuid As LUID
Public Attributes As Long
End Structure
Public Enum sdAction
Reboot = 1
Shutdown = 2
Logoff = 3
End Enum
Private Sub AdjustToken()
Const TOKEN_ADJUST_PRIVILEGES = &H20
Const TOKEN_QUERY = &H8
Const SE_PRIVILEGE_ENABLED = &H2
Dim hdlProcessHandle As Long
Dim hdlTokenHandle As Long
Dim tmpLuid As New APITest2.TestAPI.LUID()
Dim tkp As New TOKEN_PRIVILEGES()
Dim tkpNewButIgnored As New TOKEN_PRIVILEGES()
Dim lBufferNeeded As Long
SetLastError(0)
hdlProcessHandle = GetCurrentProcess()
OpenProcessToken(hdlProcessHandle, (TOKEN_ADJUST_PRIVILEGES Or TOKEN_QUERY), hdlTokenHandle)
LookupPrivilegeValue("", "SeShutdownPrivilege", tmpLuid)
tkp.PrivilegeCount = 1 ' One privilege to set
tkp.TheLuid = tmpLuid
tkp.Attributes = SE_PRIVILEGE_ENABLED
AdjustTokenPrivileges(hdlTokenHandle, False, tkp, Len(tkpNewButIgnored), tkpNewButIgnored, lBufferNeeded)
End Sub
Public Sub ExitWin(ByVal Act As sdAction, ByVal Force As Boolean)
Dim iAction As Integer
AdjustToken()
If Act = sdAction.Logoff Then iAction = EWX_LogOff
If Act = sdAction.Reboot Then iAction = EWX_REBOOT
If Act = sdAction.Shutdown Then iAction = EWX_SHUTDOWN
If Force = True Then
ExitWindowsEx((iAction Or EWX_FORCE), CLng(&HFFFF))
Else
ExitWindowsEx(iAction, CLng(&HFFFF))
End If
End Sub
Public Sub New()
Dim lngVersion As Long
lngVersion = GetVersion()
If ((lngVersion And &H80000000) <> 0) Then
glngWhichWindows32 = mlngWindowsNT
Else
glngWhichWindows32 = mlngWindows95
End If
End Sub
End Class
Using the ExitWin Sub to call the shutdown procedeure. Any Ideas
|
|
|
|
|
Change your definition of LookupPrivilegeValue to this:
Public Declare Function LookupPrivilegeValue Lib "advapi32.dll" Alias "LookupPrivilegeValueA" (ByVal lpSystemName As String, ByVal lpName As String, lpLuid As LARGE_INTEGER) As Long
and LARGE_INTEGER is declared liek this:
Public Type LARGE_INTEGER
lowpart As Long
highpart As Long
End Type
Use the APIViewer tool in VB to create these function declarations for you.
Good luck.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
How can I access the DHTML objects from an activex created from new ActiveXObject("") jscript method?
Or I can just do this if I create an activex control?
thanks,
Luiz
|
|
|
|
|
You have a reference the ActiveX control first in Project/References.
JScript Example:
var objSession = new ActiveXObject("MAPI.Session"); VB Example:
Dim objSession As MAPI.Session
Set objSession = New MAPI.Session
Jeremy L. Falcon
"The One Who Said, 'The One Who Said...'"
<nobr>
Homepage : Sonork = 100.16311 01000010011011110110001000100000011101110110000101110011 00100000011010000110010101110010011001010010111000000000
|
|
|
|
|
I made an VBA Add-In template in MS Word 2000. Is there any way i could make it work in MS Word 97, too? Ive tried to use it in Word 97 but it gave me an error message saying it wont compile... Can anyone help?
|
|
|
|
|
How could I put a array of bytes into a file ???
|
|
|
|
|
Dim b() as Byte
'Do something with b
Open "filename.txt" For Binary As #1
Put #1, , b
Close #1
Should work...
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|