|
I've never done it (because I haven't had any reason to use a dot matrix printer in about 10 years!), but you'll probably need to send RAW data to the printer, bypassing the printing classes in the .NET FCL. You could TRY mapping LPT1: to your printer and sending the data out the LPT port using a Stream. I don't have any example code...
RageInTheMachine9532
|
|
|
|
|
I have created a registry search program, but it speed is crawling. It takes about 100 seconds to pass throught CLSID, Interface and Typelib keys. I wonder if i could speed up the search (by loading the whole keys into memory for example). I use VB6 with standart registry manipulation APIs: (RegOpenKey,RegEnumKey,RegEnumValue).
Only Absolute Power and Absolutely No power matters. The rest is slavery.
|
|
|
|
|
There's no way to load it in memory first. You might want to look at your code, very closely, for optimization opportunities. Since you didn't supply any code sample, it's really hard to tell you what you might try to get an advantage.
RageInTheMachine9532
|
|
|
|
|
Hi,
I want to know how I can retrieve the 'onchange'-Event of an HTML-Input-Element in my vb.net-code? I have access to the documentproperty (DOM) of the Webbrowsercontrol.
Thx,
Dartrax
|
|
|
|
|
|
I'm using VB.NET 2003. I've written a program to read registry keys from remote computers. However, I must be logged in with my domain ID & password for this to work. If I log in locally (same ID & password as my domain credentials) I get "permission to the registry key is denied".
I've searched high & low for documentation and examples of how to authenticate to a remote pc, but so far have come up with nothing.
Also, we have 2 domains. I have the same ID & password on both domains. If i'm logged in on a PC in Domain1, I can only access Domain1 PC's. So I also need to access Domain2 PC's from a Domain1 PC.
Any help is appreciated.
|
|
|
|
|
tolsen64 wrote:
Also, we have 2 domains. I have the same ID & password on both domains. If i'm logged in on a PC in Domain1, I can only access Domain1 PC's. So I also need to access Domain2 PC's from a Domain1 PC.
You must use your Domain2 credentials. Using your Domain1 (or local) credentials will not get you access to any machine in Domain2. Your app can be launched using different credentials (Run As) using Explorer, but I'm not aware of any equivelent in the .NET FCL.
RageInTheMachine9532
|
|
|
|
|
I need some information on how to calculate year's difference between two date. And if there is such a function already existing in dotnet for that kind of operations. Thank you in advance.
I am a not so total newbie
|
|
|
|
|
For those with same problem, there is a method substract who can help you very much
I am really a newbie
|
|
|
|
|
This is for VB6... not sure about .net
Say your first date is 20/12/2000 and your second date is 15/12/2004
Dim strDate1 As String
Dim strDate2 As String
Dim strDifference As String
strDate1 = "20/12/2000"
strDate2 = "15/12/2004"
strDifference = DateDiff("yyyy", strDate1 , strDate2)
msgbox strDifference
'This will be 4 years
Dont know if that is what you were looking for??
Anyway...
Later
|
|
|
|
|
I have an application that works with Excel. I am trying to add an Excel text box to a spreadsheet programmatically. I have the code, but I get a syntax errort which says that I need a reference to the Interop assembly Microsoft.Office.Core. I already have this reference in my project. what is going on here? I tried removing then adding the reference to my project. I can find the assembly in the Object Browser, but my code can't!
Thanks!
|
|
|
|
|
Is there a way to set where the printer starts printing... IE I need a 1" margin from the top, and a 1" margin from the left
can anyone help, thanks
|
|
|
|
|
I have built a custom control which contains a bunch of TextBoxes and 5 Comboboxes. I set the tab indices so that the user can tab through the controls in the proper order. I also wrote event handlers for all the controls so that pressing the return key is equivalent to pressing the tab key.
My problem is that pressing the return key while one of the 5 ComboBoxes has focus doesn't work - nothing happens. You must also press the tab key twice to move through this ComboBox. I have tried deleting the problem ComboBox and replacing it with a copy of one that works, and have also checked the code in my event handlers, but to no avail.
does anyone have any idea what might be wrong?
Thanks!
|
|
|
|
|
I dont know what is the problem with you. But the following event handler works fine for both the TextBox and ComboBox. Try this.
private void EnterToTab(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if (e.KeyChar == (char) 13)
{
SendKeys.Send("{tab}");
e.Handled = true;
}
}
|
|
|
|
|
Hi to all,
i have developed a Remote Desktop application.
The server in a Windows Service.
When i restart the PC, i send ctrl+alt+del from client, and then i must send the authntication data.
I'm not able to capture the login screen.
Can anyone suggest me a function to capture the login screen, or how i can log in my system by-passing the windows login window (not auto-login)
Thanks in advance
Davide Vitiello
|
|
|
|
|
Your app on the target machine is either going to have to run as a service, or your going to have to use the auto-login feature.
When you press C-A-D, all of your user processes are halted, for security reasons, so your app won't be able to do stuff like keylog the password. Services, on the other hand, stay running...
RageInTheMachine9532
|
|
|
|
|
hello to all
1. i have an mdi parent form.and there are some child forms. i want to restrict loading a child form to "only once". i don't want to allow loading a second instance of the same form (while the first instance is still exits) when the user choose to load the same form again.
i mean only one instance of any form at any point of time)
how can i restrict this ... shall i check each form in the MdiChildren array of the mdiparent or is there any other easy way ?
2. if more than one child form are loaded, i want to restrict the user moving through these forms. like if any transaction is in the middle state (not updated) in the present form and the user tries to go to the other form, then i want to cancel the present transaction and allow the user to go to the other form.
i have tried form_lostfocus and form_leave but these couldn't hlep me out ...
how i do this ?
any one please help me out.
thanx in adv.
Mohan G
|
|
|
|
|
Hi,
How can I start / stop a windows service from my vb application. can I get a sample
Shenthil
|
|
|
|
|
VB6 (w/o WMI): You'll have to call into the Windows API's to get in touch with the Service Control Manager to start and stop Services.
VB6 (with WMI): You can use WMI to get a list of Win32_BaseService objects. You can then use simple method calls to start and stop the service(s) you want.
VB.NET: Very easy. See the documentation on the ServiceController class.
RageInTheMachine9532
|
|
|
|
|
Thanks.
can u give me more detail about using with WMI in vb6.0. Now I am working without WMI.
shenthil
|
|
|
|
|
VB6 with WMI: This will stop a service and it's dependants:
' The "." mean the local computer.
strComputer = "."
' We're going to stop the NetDDE service.
' First, get the list of dependent services and stop them one by one.
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery("Associators of {Win32_Service.Name='NetDDE'} Where AssocClass=Win32_DependentService Role=Antecedent")
For each objService in colServiceList
objService.StopService()
Next
' We just told the dependent services to stop. Now we'll wait about 20 seconds
' before we tell the NetDDE service to stop.
Wscript.Sleep 20000
' ...and, finally, stop the NetDDE service.
Set colServiceList = objWMIService.ExecQuery("Select * from Win32_Service where Name='NetDDE'")
For each objService in colServiceList
errReturn = objService.StopService()
Next
RageInTheMachine9532
|
|
|
|
|
I have a IR device connected in my desktop pc, im trying to create a program that will transfer files from PC to my PocketPC (vise-versa), i need to write the program in
vb 6.0 and eVB 3.0, need help on this....thanks
|
|
|
|
|
If all your doing is transferring files, you could use Windows Networking to do it, just like two desktops on a LAN. Also, why reinvent the wheel? There are a bunch programs already out there that do file transfers already. Is the cost of one of those less than what it's going to cost you to develope the same thing? What do you get paid in the two months it's going to take to develop this, compared to the off-the-shelf solution?
You can start by looking at http://www.pocketpcdn.com/sections/irdaled.html[^].
RageInTheMachine9532
|
|
|
|
|
I'm having problem with my backend, my visual basic 6.0 program dont work, the winsock control doesn't have the IR protocol unlike its eVB counterpart, pls help me on this.
|
|
|
|
|
Winsock does support IrDA if any only if you have an IRDA adapter installed in the machine and it's drivers are loaded, and you have the IR protocol installed in the Network Settings.
Also, some IR ports only show up as Serial devices, not network...
The Winsock IRDA documentation starts here[^].
RageInTheMachine9532
|
|
|
|