|
hi,
i want design a windows application where i'll give a word document as input. from that document i have to separate only the email ids and store it in a separate file. how to start? anybody give me a clue or a skeleton of this task
David Boon
|
|
|
|
|
Hi,
You will have to create temporary Word document object in your project. Then on some event like button click write code to attach the word document to this temporary object and use the object to send commands to word document. Now for the email addresses part, you can use the regular expression class Regex for that. just search for it in msdn.
Anant Y. Kulkarni
|
|
|
|
|
We are using the MSScriptControl in VB.NET using interop. (VS.net 2005)
I have set the "Make assembly COM visible " in the assembly information of project.
This will allow me to pass " Me" to the AddObject method of scriptcontrol
I have a form with 3 labels. Label1,label2,label3
I am writing the following code in the Form Load event
Dim sc As New MSScriptControl.ScriptControl
Dim sParser As String
Dim sParser1 As String
Dim sParser2 As String
sc.Language = "VBScript"
sc.AddObject("Form1", Me)
sParser = " Form1(""label1.text"") = ""This is Label1"""
sParser1 = " Form1(""label2.text"") = ""This is Label2"""
sParser2 = " Form1(""label3.text"") = ""This is Label3"""
sc.ExecuteStatement(sParser)
sc.ExecuteStatement(sParser1)
sc.ExecuteStatement(sParser2)
Functionality i need to achieve is after the execution of the executeStatement methods
Label1.text should contain the value This is Label1
Label2.text should contain the value This is Label2
Label3.text should contain the value This is Label3
Right now the compiler throws the exception " Wrong number of arguments to Form1"
I think i am not creating the parser statement in the proper way .
Any insight on the right procedure would be a great help
Thanks
Deva (dpideva@gmail.com)
Deva
|
|
|
|
|
Dear sir,
I am in big problem ,please understand my problem,now i am going to describe my problem,
I am capturing live image using webcam, on clicking on picture box images is save on harddrive and display on another picture box,this is not my problem.
My problem is that how to transfer this image to another machine at the same time and show the image on that machine with same software running on that machine.
I hope you understand my problem,please help me
Thanks
prabhakar dwivedi
-- modified at 1:28 Friday 19th May, 2006
|
|
|
|
|
There are several ways on how to do this. I recommend either reading some Remoting[^] or Sockets[^] articles.
|
|
|
|
|
you will probly have to send if over the network using the winsock. just look up some winsock tut's its pretty simple. btw do you have any tips or tuts on how to capture from webcam?
|
|
|
|
|
I have create a project, and some guids is in register.
How can I drop the project completely with register?
|
|
|
|
|
I have a two part question here...
Question #1
When i have a virtual listview control, and try to set the "ShowCheckboxes" property i get an error saying that it can't use checkboxes when in virtual mode... so other using some tricks with images, and over complicating things by doing an owner drawn listview as well is there anyway i can get these checkboxes to show up?
Question #2
I was wondering if there is any possible way to make a virtual treeview control, there doesn't to be any "virtual*" properties on treeview controls like there are for Listview controls...
|
|
|
|
|
Hi all:
I’m having a problem connecting to a secure database using Microsoft ActiveX Data Object 2.8.
I have a database I password protected and I want to make a connection to this database using the connection string. When I include the User ID and Password in the connection string I get the following error: Error#: -2147217843 Error in Microsoft JET Database Engine à cannot start your application. The Workgroup information file is missing or opened exclusively by another user.
I’m testing this on my laptop. The database is being accessed solely by my VB6 application.
When I try to connect to the database without providing the User ID or Password I get this error: Error#: -2147217843. Error in Microsoft JET Database Engine à Not a valid password. Note: The error number are the same, but the problem is different.
I can open this database without any problems from Microsoft Access. Can anyone shed some light on how to fix this?
Here is the function I’m using to connect to the Access database:
Public Function Jet_Connection(strProv as string, strDB as string, strUser as string , strPasswd as string) As Integer
On Error GoTo Jet_Connection_Err
Dim strConn As String
strConn = "Provider=" & strProv & ";Data Source=" & strDB & ";User ID=" & strUser & ";Password=" & strPasswd & ";"
Set cnnMainDb = New ADODB.Connection
With cnnMainDb
.ConnectionString = strConn
.Open
If .State = adStateOpen Then
Set cat.ActiveConnection = cnnMainDb
Jet_Connection = adStateOpen
End If
End With
Jet_Connection_Exit:
Exit Function
Jet_Connection_Err:
Set cat = Nothing
If Not cnnMainDb Is Nothing Then
If cnnMainDb.State = adStateOpen Then cnnMainDb.Close
End If
Set cnnMainDb = Nothing
Jet_Connection = adStateClosed
If Err <> 0 Then
MsgBox "Error#: " & Err.Number & vbCr & "Error in " & Err.Source & " --> " & _
Err.Description, , "Error Jet_Connection"
End If
Resume Jet_Connection_Exit
End Function
Quecumber256
|
|
|
|
|
Is your Access DB password protected only?
Meaning no user name/password login?
If so, then your connection string should look something like this...
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
strDB & ";Jet OLEDB:Database Password=" & strPasswd
|
|
|
|
|
Hi Joshua:
I tried your connection string, and I received this error:
Error #: -2147467259
Error in Microsoft JET Database Engine --> Could not find installable ISAM.
Thsnk you,
Quecumber256
|
|
|
|
|
|
Joshua:
Thanks
Quecumber256
|
|
|
|
|
Hello. I'm having a problem with focus. I'm developing an application with VS 2005 that is like the Outlook mail notification. I have a NotifyIcon and at a time a winform appear. The problem is that when I'm typing for example a word document and the alert appear I lost the focus to the alert and I can't continue typing my document. I call the window with frmForm.Show();
Thanks a lot !!!
|
|
|
|
|
I need to call an .EXE VB program and pass a parameter to it. Could someone please post code that would except a parm.
Thank you
|
|
|
|
|
Calling Process.Start()[^] allows you to startup an exe and pass arguments to it.
For example:
System.Diagnostics.Process.Start("MyVbApp.exe", "Argument1 Argument2")
|
|
|
|
|
Look at Environment.GetCommandLineArgs()
Scott
-- modified at 17:13 Friday 19th May, 2006
Sorry, somehow I replied to the wrong message.
|
|
|
|
|
Scott Serl wrote: Sorry, somehow I replied to the wrong message.
I think there's a bug in the message board. My replies sometimes (but rarely) go to the wrong messages too.
|
|
|
|
|
I have got a method that recursively loops through directories and pulls either Pictures or Plans out of there respective directory.. Each plan or picture may or may not have a description associated with it.. I finally got the method to where everything is in sync and not throwing any errors..
Here is what i need help with..
Where i keep calling this method while i am still in the method but i would like to do this with these changes..
1. Remove the parameters and somehow reset the true and false with in the method itself
2. What is the best way to keep track of the built objects while the method is called over and over.. i loose my values when recalling...
I guess what i am saying is that once i am in the method i need a way to recursively keep calling the method and be able to keep track of my built object and then i need a way to step out of the method after certain events have happened..
One of the reason that i am asking is becasuse i just flat out need some advice on this one..
PLEASE.... SOS
Next (s)
End If
FileHandler(False, True) <-----something different here..
End Sub
------------------------
Thanks..
erik
Private Sub FileHandler(Optional ByVal ForPlan As Boolean = True, Optional ByVal ForPic As Boolean = False)
Dim strPlans() As String = Directory.GetFiles(Server.MapPath(m_Path & "Plans"))
Dim strPics() As String = Directory.GetFiles(Server.MapPath(m_Path & "Pictures"), "s_A-F-C-C-*")
Dim gstrFiles() As String = {}
Dim strPlanDesc() As String = Directory.GetFiles(Server.MapPath(m_Path & "Plans/Temp/"))
Dim strPicDesc() As String = Directory.GetFiles(Server.MapPath(m_Path & "Pictures/Temp/"))
Dim gstrDescr() As String = {}
Dim oFiles As AFCCServices.Files = Nothing
Dim strDirecType As String = ""
Dim strExt As String = ""
Dim strHolder As String = ""
Dim iNum As Byte = 0
---I know this is not right but i am still trying to figure all of this out
Dim i As Int16 = CShort(strPics.Length)
Dim ii As Int16 = CShort(strPlans.Length)
Dim iii As Int16 = i + ii
Dim aServ(iii)As AFCCServices.Files
-----
Dim aFsPicDescr(strPicDesc.GetUpperBound(0)) As AFCCServices.Files
Dim aFsPlanDescr(strPlanDesc.GetUpperBound(0)) As AFCCServices.Files
If ForPlan = True Then
gstrFiles = strPlans
gstrDescr = strPlanDesc
End If
If ForPic = True Then
gstrFiles = strPics
gstrDescr = strPicDesc
End If
If gstrFiles.Length > 0 Then
For Each s As String In gstrFiles
oFiles = New AFCCServices.Files
oFiles.Name = Path.GetFileName(s)
If ForPlan = True Then oFiles.Type = Global.AFCCServices.FilesType.Plan
If ForPic = True Then oFiles.Type = Global.AFCCServices.FilesType.Picture
s = Path.GetFileName(s)
strExt = Path.GetExtension(s)
s = s.Replace(strExt, "")
If gstrDescr.GetUpperBound(0) > 0 Then
For Each ss As String In gstrDescr
strHolder = ss
strHolder = Path.GetFileName(strHolder)
strExt = Path.GetExtension(strHolder)
strHolder = strHolder.Replace(strExt, "")
If strHolder.Replace("p_AFCC_PlanRef_", "") = s.ToString Then
'Get the text from the text file
Try
If ForPlan = True Then strDirecType = "Plans"
If ForPic = True Then strDirecType = "Pictures"
' Create an instance of StreamReader to read from a file.
Using sr As StreamReader = New StreamReader(Server.MapPath(m_Path & strDirecType & "/Temp/" & Path.GetFileName(ss)))
Dim line As String
' Read and display the lines from the file until the end
' of the file is reached.
Do
line = sr.ReadLine()
oFiles.Description = oFiles.Description & (line)
Loop Until line Is Nothing
sr.Close()
End Using
Catch e As Exception
' Let the user know what went wrong.
End Try
End If
Next (ss)
End If
If ForPlan = True Then aFsPlanDescr(iNum) = oFiles
If ForPic = True Then aFsPicDescr(iNum) = oFiles
aServ(iNum) = aFsPlanDescr(iNum)
iNum = CByte(iNum + 1)
Next (s)
End If
FileHandler(False, True)
End Sub
|
|
|
|
|
Hi everbody,
I am struggling with an error I do not understand. I intend to create a Windows Service to install and run in a SQL server to query a DB every few seconds, and to broadcast a UDP message to all clients within the network so that they can perform a task if need.
Now I created a regular Windows Application for testing purposes, and got it work just fine. The form has only a Timer that, when it ticks, submits the query, and if necessary, builds the message to be broadcasted, and sends it. This works fine.
On the other hand the client apps are listening to the UDP broadcast and are actually performing the appropriate task when they receive the message. This is also working.
Now, when I created the Windows Service, which I can successfully register, install, and start (no errors are shown in the Event Viewer), I copied and pasted the Timer’s event handler code as well as the subs and functions that are need, but nothing happens.
When I attach to the process in order to debug it, I can pause it and the Debugger takes me to an assembler address that shows this error message when examined through the Watch tool “CXX0013: error: missing operand”. Does anybody have a clue what could this be?
I copied and pasted the code from the Service into a new Windows Application, and it works!!! Thank you very much for your time and wonderful help.
Alex.
Still a very lost guy
-- modified at 13:49 Thursday 18th May, 2006
|
|
|
|
|
after installing the service go to control panel and open the services. right click on your service and check the logon info. may be the user used for the service do not have rights to perform the required operation.
try to give it admin user and password for testing.
Rizwan Bashir
|
|
|
|
|
I installed the service and have it running using the system account which has full access. I do not get any errors related to the SSPI, nor entries in the Logon details.
thanks for trying. have a nice weekend.
The lost dude!!!
|
|
|
|
|
Hi all,
I have installed my program on my network machine (EXE and the DB)
I have set the sharing & Security for the folder of the network machine
When I try to run the program from my machine I get the following error:
Request for the permission of type
System.Data.SqlClient.SqlClientPermission, System.Data,
Version= 1.0.5000.0, Culture =neutral,
PublicKey Token = b77a5c561934e089 failed
It runs fine from the network machine i.e. If run it from the NETWORK machine.
This is the code for me to open my conection:
Imports System.Data.SqlClient
....
Dim Conn As SqlConnection = New SqlConnection
Conn.ConnectionString = "Data Source=(local);" & _
"Initial Catalog=Rsch1;" & _
"Integrated Security=SSPI"
Conn.Open()
How do I set the permision for the network machine?
Tnx
|
|
|
|
|
Programs run from a network share run with a lower permission than applications run from the local machine. This is because the network share could be a WebDav drive out on the internet, etc.
The first thing is, the connection string won't work from your machine. When your machine runs the code, it will see "Data Source=(local)," and it will attempt to attach to your machine and not the networked machine. Presumably, you want to run against the databse on the network machine. So your connection string needs to look like:
Data Source=SERVER\.;Initial Catalog=Rsch1;Integrated Security=SSPI
Additionally both your machine and the server must be members of mutually trusted domains, or SSPI will fail. If you are in a workgroup, you probably can't use integrated security (SSPI) reliably, but your milage may vary.
Of course, in my version of the connect string, SERVER needs to be either the IP Address of your SQL Server or its machine name -- it shouldn't be the word SERVER unless that happens to be what its name is. Also, you need to make sure that SQL Server is configured to allow remote connections (Surface Area Manager in newer versions configures it for connections from the same machine only by default -- you can change this in your management tool).
Additionally, when you are running from a network share, you lose permissions from the .NET framework. When you run from your local drive, you run at full trust. When you run from a network share, you don't run at full trust. This is a defense mechanism against Worm programs and other attacks.
In control panel, you can use the .NET Configuration Assistance to trust the assembly or publisher. If you are on a corporate network, you want to have a domain administrator update the group policy to allow the executable the necessary permissions. If you are using .NET 2.0, the SDK provides a program that can tell you the exact permissions your application requires.
The tool is named SecUtil, and it usually is in C:\Program Files\Microsoft.NET\SDK\v2.0\bin\secutil -- depending on your install order versus mine, it may be in a different location (I install the SDK, then install Visual Studio -- if you install the SDK as part of Visual Studio, then it ends up under Visual Studio somewhere). There is documentation on the tool on Microsoft's site.
Note that you'll have to adjust the machine configuration or user configuration to trust the assembly -- there is nothing you can do on the network share to trust it. This is a defense mechanism. The best bet, if you are the developer, is to sign the application, and trust that publisher -- that way your network people can push that trust to all your machines that want to run the app, and when you write additional apps, you can just sign them versus having to go through this whole process again.
|
|
|
|
|
Hi,
In vb6, there would be an Option Group control that could contain a set of buttons, or boxes etc.
Values would be assigned to control, and Select Case statements could be created based on the Option Group control.
The only thing I could find in VStudio/VB.net is the groupbox control.
Here is what I have:
<br />
Select Case GroupBox1.Controls<br />
<br />
Case RadioButton1<br />
<br />
MessageBox.Show("button1 selected")<br />
<br />
Case RadioButton2<br />
<br />
MessageBox.Show("button2 selected")<br />
<br />
End Select<br />
For the Case RadioButton1 and 2, I receive a message, "Operator '=' is not defined for types System.Windows.Forms.Control.ControlCollection and boolean...
Any suggestions is greatly apprciated.
Rashar
|
|
|
|