|
What your looking for is in this[^] post. Or, if your using VB.NET, you can use Process.Start and Process.StartInfo to do the same thing. Docs on that can be found here[^].
RageInTheMachine9532
|
|
|
|
|
I have been trying to monitor the handshake (signal) from
a printer for each page it printed but i have not been
able to do so. Can any out there help me.
|
|
|
|
|
|
Hello All:
I'm using an SDK from a device that uses the USB to communicate in the SDK theres is a function that Initializes the port but there is no function or method to free the port, I already try to contact the vendor but I am not having any responce so if someone can helpme whit this, I will very tankful.
JA
|
|
|
|
|
If there isn't a function to Close/Release/Free the port, then your going to have to contact the manufacturer and find out why and what should be done. Another possibility is searching for any sample code, either in the docs for the SDK or on the web, that shows what should be used. But, as with any SDK, what the procedures are and what function names are used depends ENTIRELY on the SDK and the device your using.
RageInTheMachine9532
|
|
|
|
|
Thanks for your response, I have other question, when I exit the application the port, becomes available, is there a way to close this reference in the application?, or in the main form ?(This is were I'am using this device).
Javier Ayala
|
|
|
|
|
The port becomes available because when your app quits, it releases its resources. This is apparently causing the API to close the port it has open. Once again, it's all in the SDK, there is no standard method of talking to all devices when using an SDK. It MUST be done through calls into the SDK. But if they are not documented, your best bet is the manufacturer.
RageInTheMachine9532
|
|
|
|
|
Tanks, I already contact the vendor of the device and It toll me that It doesnt have this method, so I thing I am going to try a low level approach, what you thing?
JA
|
|
|
|
|
Probably possible, but if your SDK doesn't have to functionality to close a port that it opens, be prepared for a crash when you close the port, but not have the SDK release its resources.
RageInTheMachine9532
|
|
|
|
|
I am in the process of writing an Add-In for MS Office XP in MS VB.NET. So far, it amends the office commandbars to add an MsoPopup with two MsoButtons. My next step is to get the events for these two MsoButtons associated with a keycode shortcut; i.e., ALT + L.
I cannot seem to find any information on how this could be achieved. I have looked at the KeyBindings collection in Office, but don't see a way to attach the keycodes to the addin.
Any help gratefully accepted.
John
|
|
|
|
|
Hi
I have a MDI form where i want to display a mdi child. but i want this child to behave like 'modal()' so the user can't get out the form when it is not completed correctly.
When i import a dialog in the project and form.show it after pressing a menu item in the mdi parent ... then the dialog is only shown when i minimize the mdi parent.
What's the problem here? :s
And another little thing
I dont' seem to find a method for deleting an entry in a listview.
You guys can help?
Greetings
Jens
|
|
|
|
|
Remove listitem:
ListView1.ListItems.Remove(lngI)
As for the form:
The QueryUnload event has a second parameter called
UnloadMode. By testing this mode, the program will know what is causing
the form to unload. Then you can decide what you want to do, etc
These are the constants and a brief explanation:
Select Case UnloadMode
Case vbFormControlMenu
'The "X" button or the "Close" menu
'from the form's System menu.
Case vbFormCode
'The Unload statement is called from code.
Case vbAppWindows
'Windows is shutting down.
Case vbAppTaskManager
'The Task Manager is closing the app.
Case vbFormMDIForm
'The form is an MDI child and the
'MDI form is closing.
Case vbFormOwner
'The form is closing because its
'owner is closing.
End Select
"Since we don't know where we're going, we have to stick together in case someone gets there." - Ken Kesey 1935 - 2001
|
|
|
|
|
Hi
Thanks for the reply.
About the form i really meant ... When i want to show a form within an MDI parent (the form has property MDI child: false)... Then that form is not shown within the MDI but apart. I want to be able to show the form nice in the MDI parent without making it MDI child. Because i want to be able to 'DoModal()' the form.
I hope you understand my problem :x
Greetings
Jens
|
|
|
|
|
You can solve this problem programmatically using the mouseover event. When the mouse escapes the form: put it back on the form. As for the form itself, when you move the non MDI form reset the left and top properties to keep the non mdi form within the MDI form. Hope this helps.
Grtz Guus
|
|
|
|
|
Well, i don't move the form myself ... I just show the form that has to be displayed within the MDI parent itself. So it has to behave like an MDI child but it needs to be displayed modally.
I'll explain situation. I have a menu in the MDI parent .. When i click a menu option .. i want a form to display that is not mdi child. So the form is not shown within the mdi child, but minimised.
Because i don't know well what you meant
Greetings
Jens
|
|
|
|
|
How do lock a file in VB6 without hardcoding to append a .lock ext to the file name?
How do i unlock? Pls help
|
|
|
|
|
What do you mean by lock? It doesn't sound like the standard definition of the term. Besides, using .lock just changes the file extension, not any exclusive rights to the file.
Are you trying to get exclusive access to the file? If so, then your Open statement should look something like:
Open "filename.ext" For Binary Access Read Lock Read Write As #1
Use whatever File Mode and Access you want, but the important part is the Lock modifier.
RageInTheMachine9532
|
|
|
|
|
hi RageInTheMachine9532,
you r right i dint mean the std locking of files. i want many app instances to share a folder of .tif files. if app1 is using a file, it renames it with a .lock ext so app2 knows it is being modified by checking the ext.
before an app exits, it renames files its been using from .lock to .tif.
problem is if app1 crashes, the files remain with a .lock ext n neither app1 nor app2 can use them!
how do i handle this? i mean without resorting to the normal windows locking..
|
|
|
|
|
Well, the locking is the only "sure" way to control file access and you don't have to deal with renaming stuff back when you crash.
The problem you have is this:
When AppInstance1 checks for the availability of File1.tif, it's there. The next step, is for it to rename File1.tif to File1.locked. But, What if AppInstance2 found that File1.tif was available at (nearly) the same time, say, between AppInstance1 finding the file and renaming it? In this case, BOTH instances will find the file, but only one will succeed in renaming it. How is this case handled?
It's too much of a pain to write your own file locking scheme when Windows has locking built in. It also has the advantage of being "thread safe", where your custom scheme does not.
RageInTheMachine9532
|
|
|
|
|
hi..i have still problem with chart,the problem how too generate graph from database,example access
adhizz
|
|
|
|
|
hi Adhizzz. i hope this helps
Print a Microsoft Access report from VB 6.0
As you may know, Microsoft Access provides a much more robust reporting
system than Visual Basic. As a result, if you use Access as a back-end
to your application, you may want to print Access reports from your VB
application. Fortunately, you can do just that with Automation.
The following code shows one way to do so, using late binding. remember to replace dbName and rptName with correct values:
Dim objAccess As Object
Private Sub Command1_Click()
Dim dbName As String
Dim rptName As String
Dim Preview As Long
Const acNormal = 0
Const acPreview = 2
dbName = "D:\PathToDB\db1.mdb"
rptName = "MyReportName"
Preview = acPreview 'acNormal
With objAccess
.OpenCurrentDatabase filepath:=dbName
If Preview = acPreview Then
.Visible = True
.DoCmd.OpenReport rptName, Preview
Else
.DoCmd.OpenReport rptName
End If
End With
End Sub
Private Sub Form_Load()
Set objAccess = CreateObject("Access.Application")
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
objAccess.Quit
On Error GoTo 0
Set objAccess = Nothing
End Sub
|
|
|
|
|
hi Adhizzz. i hope this helps
Print a Microsoft Access report from VB 6.0
As you may know, Microsoft Access provides a much more robust reporting
system than Visual Basic. As a result, if you use Access as a back-end
to your application, you may want to print Access reports from your VB
application. Fortunately, you can do just that with Automation.
The following code shows one way to do so, using late binding. remember to replace dbName and rptName with correct values:
Dim objAccess As Object
Private Sub Command1_Click()
Dim dbName As String
Dim rptName As String
Dim Preview As Long
Const acNormal = 0
Const acPreview = 2
dbName = "D:\PathToDB\db1.mdb"
rptName = "MyReportName"
Preview = acPreview 'acNormal
With objAccess
.OpenCurrentDatabase filepath:=dbName
If Preview = acPreview Then
.Visible = True
.DoCmd.OpenReport rptName, Preview
Else
.DoCmd.OpenReport rptName
End If
End With
End Sub
Private Sub Form_Load()
Set objAccess = CreateObject("Access.Application")
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
objAccess.Quit
On Error GoTo 0
Set objAccess = Nothing
End Sub
|
|
|
|
|
Hello Sir,
I have been assigned a task to auto mate a school system. i.e. Timetabling issues, Teacher Replacemts, Employee Attendances(HR), Exam control and Student Records...
although .. i have analysed almost everything.. database tables are finalized as well...
but coz of being untouch with all this development issue since a year.. i am just strugling as to how and where to start design and development of the software....?
if anyone having idea about this kind of software? please help me ...
or i would be grateful if anyone can come up and exchange emails with me regarding this project... i mean, the one, who can help me step by step..as how to start
i'll be using VB.NET and SQL Server...
thanks ..
All Praises are for the Lord of the universe...
Regards,
Tahir
|
|
|
|
|
My advise to you is prioritize. Seems to me that the functionalities you describe can best be split in several solitary programs. Prioritize and start from there.
Grtz, Guus
|
|
|
|
|
Yes! I am trying to priortize the functionalities...
looking for Teacher and Student Records Managent at first hand...
but still kind of confused..
any more suggestions please?
thank you
|
|
|
|