|
Hi,
Thank you very much, I got it!
Regards
|
|
|
|
|
hello
well... i posted twice the same problem but it looks like
i wont get any answer
so i just want to know the answer
can i create a connection that enable me to chat with other computer user
(1 on 1) only
i just want to know can or cannot
please answer me cause if cannot i have to change or alter my whole program
but if can then can you please give me a link or help to where i can find such sample or codings
thank you
Gary
|
|
|
|
|
it's possible..
A friend of mine made a nice program to chat and share files on LAN.
do you use VB6 or VB.net ?
in both cases you'll need to know about Windows sockets.
using Winsock control in VB6 or .NET classes for VB.NET.
|
|
|
|
|
|
thank you very much for your help
currently in using VB.Net
so i'll study the winsock
so that i can try to connect or detect other computer
again here i thank you for your help
Gary
|
|
|
|
|
Hi, I want to import data from hundreds if not thousands of password protected excel spreadsheets.
Instead of manually opening them and unprotecting them by hand, how can I modify my program, which already imports the un-protected ones, so that it can read them even tough they are password protected.
|
|
|
|
|
The Open method of the Workbooks collection supports opening the file with a password. All you have to do is supply it. This is the description for the 2003 version of Office. Previous versions support most of the same options, but they all support opening a password protected file:
expression.Open(FileName, UpdateLinks, ReadOnly, Format, Password, WriteResPassword, IgnoreReadOnlyRecommended, Origin,
Delimiter, Editable, Notify, Converter, AddToMru, Local, CorruptLoad)
expression must return the Workbooks object.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hello
please help me
i have the code below that i got from a few books
Private Sub Connect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Connect.Click
If ipB.Text <> "" And portB.Text <> "" Then
chatB.AppendText("Requesting Connection" & vbCrLf)
On Error GoTo ErrorM
myclient = New TcpClient(ipB.Text, portB.Text)
myclient.GetStream.BeginRead(mydata, 0, 1024, AddressOf DoRead, Nothing)
Status.Panels.Text = "Requesting Connection..."
chatB.AppendText("Connected..." & vbCrLf)
chatB.AppendText("----------------" & vbCrLf)
Status1.Panels(0).Text = "Connected to " & ipB.Text & ":" & portB.Text
Timer1.Enabled = True
a = InputB("Enter Nickname:", "Chat 2003")
Send("nick:" & a)
portB.Enabled = False
SendB.Enabled = True
Connect.Visible = False
DC.Visible = True
ipB.Enabled = False
End If
ErrorM: If SendB.Enabled = False Then
chatB.AppendText("Please try again")
End If
End Sub
somehow the code wont work. i keep getting "Please try again"
im trying detect my college server with the coding
is it possible??
or do i need something else??
can u tell me what else i need
thank you in advance
Gary
|
|
|
|
|
Let's say that I have created 2 interface types that is implemented in 2 classes in a dll, 1 interface implemented by 1 class. Now I need to load those classes and then instantiate an object to invoke the interfaces. Question: How do I determine at runtime the interface implemented by a class so that I can cast to the object's type and then invoke it's interface? Is there a better way than trying to cast it to a specific object hoping it will not raise an exception in which case I'd have to cast it to another type?
I am building an application that is extensible by plugins and I need this functionality.
It hurts to ask, but it hurts more to be ignorant.
|
|
|
|
|
|
I got it!!! I forgot about the Typeof keyword. Thanks.
It really does not hurt to ask, especially when you knew the answer all along.
|
|
|
|
|
I'm trying to use the WM_GETTEXT to get the contents of a textbox in a child window in another app.
I can find out handles using winspector so I dont need to use findwindow but I arn't sure how to target the actuall text box.
Frankly I'm sick of searching for rubbish examples so If anyone can offer any help, please do.
Thanks
Danny
|
|
|
|
|
i am working on a visual basic program (GUI). in this program i am using the VB graphing capabilities to output different grpahs. they are pretty bad. i am trying to somehow create a .mat file so i can graph the data in MATLAB. any ideas on how to create a .mat file, or even better just call matlab to graph it. i do not have the matlab com builder, which looks pretty simple to integrate matlab and VB6.
i am pretty new to VB6, so this might sound like a dumb question, but any help would be GREATLY APPRECIATED!
THANK YOU
Paul
|
|
|
|
|
There is a C program example somewhere in the Program Files\Matlab folder. Good luck translating that into VB6 code...
You'll be much better off doing it with a MATLAB COM component. You can start the the documentation on MATLAB's COM/DDE support here[^]. Specifically, you're look for the External Interfaces/API Reference.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is there a general way to check if an if statement is semantically correct in vb.net?. For example:
Checking this:
input string:
Cost = 20 + Quantity - Discount and Cost = 49
or it could be:
Cost = 20 * Quantity / Discount and Cost = 49
Note that Cost, Quantity, and Discount is an integer variables.
Thanks in advance for your help.
John
|
|
|
|
|
This question doesn't have an answer until it's put into the context of how it's being used...
Are you saying that you want to check to see if this code is correct before being compiled? Or are you trying to parse this string and evalutate it?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Basically, the string is an if statement.
For example:
if Cost = 20 * Quantity / Discount and Cost = 49 then....
This is an input from user. And i'm trying to parse the string and check the "if" part only.
John
|
|
|
|
|
Let me get this straight... This is your VB.NET code and your trying to do something like this:
'Get some user input and put it in a variable. Then evaluate the expression...
Dim strInput As String = "Cost = 20 * Quantity / Discount and Cost = 49"
EvaluateUserExpression(strInput)
.
.
.
Public Function EvaluateUserExpression(ByVal strExpression As String) As Boolean
If strExpression Then
Return True
Else
Return False
End If
End Function
Now, if I understand you correctly, the Cost, Quantity, and Discount terms are actual variables inside your code. Correct?????
If this is true, then what you want to do can't be done using a simple if statement. You must parse up and validate the expression term-by-term and evaluate it along the way. You would ahve to check to see if the Cost/Quantity/Discount variables exist in your code, handle the equals signs and the operators yourself. You're looking for expression parsing techniques that, if covered in breif, are much too large to be taught over the forums.
Google for 'VB mathematical expression parser' and you'll come up with tons links on various articles, techniques, some source code...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm generating charts with dynamic data. My problem is, my default chart options do not save when they are loaded onto another computer.
Can anyone tell me how to dynamically set chart options so that they will generate correctly on other computers?
(Chart type/series type/etc.)
I need to modify the X and Y Axis Scale
I need to modify the Chart Type
And various other chart options as such.
|
|
|
|
|
First, I don't remember ever seeing default chart options anywhere. When you create the Chart sheet, you pick stuff like chart type, data range, axis labels, ... Those are saved with the Chart sheet. Including the X and Y axis scales, chart type, ...
Are you saying that you are generating the Chart sheet from code? Is the workbook being saved AFTER the Chart sheet is made and you make the modifications to it? And when that workbook is loaded on another machine is the code for generating the Chart sheet being re-run? Is the old Chart sheet being deleted first? ...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You can set the default Chart in chart type options.
I do not create the chart with the wizard, I create it strictly through code.
The workbook never gets deleted... Ever.
Charts are generated dynamically as data is entered. So it is ever changing
But besides that, I did figure it out. I found the options on the web after searching for quite a while.
If anyone is interested in the code, let me know and I will post it.
|
|
|
|
|
Yes, i am intrested, please paste the code.
thanks
|
|
|
|
|
Okay, here you go:
------------------------------------------------------
'***Create a new series for the chart object<br />
Function createSeries()<br />
<br />
Dim DataSource As Range<br />
Dim DataRows As Long<br />
Dim DataCols As Integer<br />
Dim MyNewSrs As series<br />
Dim valArray() As Double<br />
Dim currentChart As String<br />
Dim i As Integer<br />
Dim chartName As String<br />
Dim rowNumber As String<br />
Dim offsetval As Integer<br />
Dim modValue As Integer<br />
Dim tempRows As Integer<br />
<br />
If tempRow = 6 Then<br />
modValue = 6<br />
ElseIf tempRow = 5 Then<br />
modValue = 5<br />
Else<br />
Exit Function<br />
End If<br />
<br />
offsetval = 0<br />
i = 0<br />
<br />
Worksheets("Standards").Select<br />
<br />
'Get selection<br />
Set DataSource = Selection<br />
With DataSource<br />
DataRows = .rows.Count<br />
tempRows = DataRows<br />
DataCols = .Columns.Count<br />
End With<br />
<br />
ReDim valArray(0 To DataRows - 1)<br />
<br />
'save values in an array<br />
While DataRows <> 0<br />
If Len(DataSource(i + 1)) > 2 Then<br />
valArray(i - offsetval) = DataSource(i + 1) / standardValues((i - offsetval) Mod modValue)<br />
Else<br />
offsetval = offsetval + 1<br />
End If<br />
i = i + 1<br />
DataRows = DataRows - 1<br />
Wend<br />
<br />
i = 0<br />
DataRows = tempRows<br />
<br />
'check values to see if they are in range for the chart<br />
While DataRows <> 0<br />
If valArray(i) > 1.2 Then<br />
valArray(i) = 1.2<br />
ElseIf valArray(i) < 0.8 Then<br />
valArray(i) = 0.8<br />
End If<br />
<br />
i = i + 1<br />
DataRows = DataRows - 1<br />
Wend<br />
<br />
Worksheets("Charts").Select<br />
myChart.Select<br />
<br />
chartName = DataSource.Column<br />
chartName = ConvertColumnNumberToLetter(chartName)<br />
<br />
rowNumber = DataSource.Row<br />
<br />
'plot values on the graph<br />
With ActiveChart.SeriesCollection.NewSeries<br />
.Name = (Worksheets("Standards").Range(chartName & "2"))<br />
.Values = valArray<br />
.XValues = Array(0, 1, 2, 3, 4, 5)<br />
End With<br />
<br />
'Format chart to make it look nice<br />
myChart.Activate<br />
ActiveChart.ChartType = xlXYScatter<br />
<br />
<br />
ActiveChart.PlotArea.Select<br />
With Selection.Border<br />
.ColorIndex = 16<br />
.Weight = xlThin<br />
.LineStyle = xlContinuous<br />
End With<br />
With Selection.Interior<br />
.ColorIndex = 2<br />
.PatternColorIndex = 1<br />
.Pattern = xlSolid<br />
End With<br />
ActiveChart.ChartArea.Select<br />
With ActiveChart.Axes(xlCategory)<br />
.HasMajorGridlines = True<br />
.HasMinorGridlines = False<br />
End With<br />
With ActiveChart.Axes(xlValue)<br />
.HasMajorGridlines = True<br />
.HasMinorGridlines = False<br />
End With<br />
ActiveChart.HasLegend = False<br />
ActiveChart.Axes(xlValue).Select<br />
With ActiveChart.Axes(xlValue)<br />
.MinimumScale = 0.8<br />
.MaximumScale = 1.2<br />
.MinorUnitIsAuto = True<br />
.MajorUnitIsAuto = True<br />
.Crosses = xlAutomatic<br />
.ReversePlotOrder = False<br />
.ScaleType = xlLinear<br />
.DisplayUnit = xlNone<br />
End With<br />
Selection.TickLabels.NumberFormat = "0%"<br />
ActiveChart.Axes(xlValue).MajorGridlines.Select<br />
ActiveChart.PlotArea.Select<br />
ActiveChart.Axes(xlCategory).Select<br />
ActiveChart.Axes(xlValue).Select<br />
With ActiveChart.Axes(xlValue)<br />
.MinimumScale = 0.8<br />
.MaximumScale = 1.2<br />
.MinorUnitIsAuto = True<br />
.MajorUnitIsAuto = True<br />
.Crosses = xlCustom<br />
.CrossesAt = 1<br />
.ReversePlotOrder = False<br />
.ScaleType = xlLinear<br />
.DisplayUnit = xlNone<br />
End With<br />
ActiveChart.Axes(xlCategory).Select<br />
With ActiveChart.Axes(xlCategory)<br />
.MinorUnitIsAuto = True<br />
.MajorUnit = 1<br />
.MaximumScale = 5<br />
.MinimumScale = 0<br />
.Crosses = xlAutomatic<br />
.ReversePlotOrder = False<br />
.ScaleType = xlLinear<br />
.DisplayUnit = xlNone<br />
End With<br />
Selection.TickLabels.AutoScaleFont = True<br />
With Selection.TickLabels.Font<br />
.Name = "Arial"<br />
.FontStyle = "Regular"<br />
.Size = 1<br />
.Strikethrough = False<br />
.Superscript = False<br />
.Subscript = False<br />
.OutlineFont = False<br />
.Shadow = False<br />
.Underline = xlUnderlineStyleNone<br />
.ColorIndex = xlAutomatic<br />
.Background = xlAutomatic<br />
End With<br />
ActiveChart.SeriesCollection(1).Select<br />
With Selection.Border<br />
.Weight = xlHairline<br />
.LineStyle = xlNone<br />
End With<br />
With Selection<br />
.MarkerBackgroundColorIndex = 3<br />
.MarkerForegroundColorIndex = 9<br />
.MarkerStyle = xlSquare<br />
.Smooth = False<br />
.MarkerSize = 4<br />
.Shadow = False<br />
End With<br />
<br />
End Function
|
|
|
|
|
Hello to all..
I am doing a program that a time carried out some operations on the pc. ..creates a txt in which contains some info on the procedure...
And here all outcome ok. ...
The problem is that when the file is compiled, I should send it to a server....but to make this I should await that the file is concluded.
Now I wonder: I know that until the end of the procedure the file size is 0 KB and a time concluded, it is immediatly replenished in approximately 300 KB... it's possible to establish (maybe with a loop...), until the file size is equal to 0 KB ---> do ACTION 1; when the same file is DIFFERENT from 0 KB (does not matter myself how much is big. ..) then do ACTION 2......
It is possible in your opinion?
Thanks to all..
Night Soul!!!
|
|
|
|
|
Let me see if I understand you...
You want to monitor the size of a file, and based on its size, you want to determine if it's safe to copy the file to another server and then erase the file and let the other app recreate it.
Correct? It's possible... but a questionable technique.
A better method would be to try and rename the file constantly. If the file is open, the rename will fail. When the rename finally succeed's, you accomplish two things. One, the file is immediately taken out of the way of the other application, freeing it to create another one. Second, you now have exclusive rights to the renamed file because the other applications know nothing of the new name. You are free to do whatever you want with this renamed file, like copy it to a server, and if the server is not available at the time of the copy, store the file locally to be copied up later.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|