|
Ankit Aneja wrote: With dr
_GrossWeight = .GetDouble("GrossWeight")
where _GrossWeight has also datatype as double
it's not working fine
So what IS the result?? Are you getting a value?? What is the expected value and what is the actual value returned?? Is there an error message??
|
|
|
|
|
just closed my editor and opened again it wrks
something strange i din't get
Thanks a lot
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
Hi all
I want to create a RAS(PPTP) entry without "Require data encryption(disconnect if none)", below is my code. I have tried several times, but the option "RASEO_RequireDataEncryption" seems not work. But other option such as "RASEO_RemoteDefaultGateway" works fine. Can someone help? Thanks in advance!
------------------------------------------------------------
Enum RasEntryOptions
' 0-3
RASEO_UseCountryAndAreaCodes = &H1
RASEO_SpecificNameServers = &H4
RASEO_IpHeaderCompression = &H8
'4-7
RASEO_RemoteDefaultGateway = &H10
RASEO_DisableLcpExtensions = &H20
RASEO_TerminalBeforeDial = &H40
RASEO_TerminalAfterDial = &H80
'8-11
RASEO_ModemLights = &H100
RASEO_SwCompression = &H200
RASEO_RequireEncryptedPw = &H400
RASEO_RequireMsEncryptedPw = &H800
'12-15
RASEO_RequireDataEncryption = &H1000
RASEO_NetworkLogon = &H2000
RASEO_UseLogonCredentials = &H4000
RASEO_PromoteAlternates = &H8000
'16-19
RASEO_SecureLocalFiles = &H10000
RASEO_RequireEAP = &H20000
RASEO_RequirePAP = &H40000
RASEO_RequireSPAP = &H80000
'20,21,23
RASEO_Custom = &H100000
RASEO_PreviewPhoneNumber = &H200000
RASEO_SharedPhoneNumbers = &H800000
'24-27
RASEO_PreviewUserPw = &H1000000
RASEO_PreviewDomain = &H2000000
RASEO_ShowDialingProgress = &H4000000
RASEO_RequireCHAP = &H8000000
'28-31
RASEO_RequireMsCHAP = &H10000000
RASEO_RequireMsCHAP2 = &H20000000
RASEO_RequireW95MSCHAP = &H40000000
RASEO_CustomScript = &H80000000
End Enum
Function CreateNewEntry(ByVal sUsername As String, ByVal sPassword As String, ByVal sIP As String) As Boolean
CreateNewEntry = False
Dim re As RASENTRY
Dim sDeviceName As String ', sDeviceType As String
sDeviceName = "WAN Miniport(PPTP)"
With re
.dwSize = LenB(re)
.dwCountryCode = 86
.dwCountryID = 86
.dwDialExtraPercent = 75
.dwDialExtraSampleSeconds = 120
.dwDialMode = 1
.dwEncryptionType = 3
.dwfNetProtocols = 4
.dwfOptions = RASEO_RequireDataEncryption + RASEO_RemoteDefaultGateway
.dwFramingProtocol = 1
.dwHangUpExtraPercent = 10
.dwHangUpExtraSampleSeconds = 120
.dwRedialCount = 3
.dwRedialPause = 3
.dwVpnStrategy = VS_PptpOnly
.dwType = 5
CopyMemory .szLocalPhoneNumber(0), ByVal sIP, Len(sIP)
CopyMemory .szDeviceName(0), ByVal sDeviceName, Len(sDeviceName)
CopyMemory .szDeviceType(0), ByVal sDeviceType, Len(sDeviceType)
End With
Dim rc As RASCREDENTIALS
With rc
.dwSize = LenB(rc)
.dwMask = 11
CopyMemory .szUserName(0), ByVal sUsername, Len(sUsername)
CopyMemory .szPassword(0), ByVal sPassword, Len(sPassword)
End With
Dim rtn As Long
If RasSetEntryProperties(vbNullString, sEntryName, re, LenB(re), 0, 0) = 0 Then
If RasSetCredentials(vbNullString, sEntryName, rc, 0) = 0 Then
CreateNewEntry = True
End If
End If
End Function
|
|
|
|
|
The only obvious thing that jumps out is the re.dwfOptions need to be Or'd together, not added.
Other than that, you're treading in very rare territory. It's unlikely you're going to find anyone who has experience using the RAS library.
|
|
|
|
|
Thanks in advance.
modified 28-Nov-12 8:14am.
|
|
|
|
|
Soooooo, what in these headers is going to tell you the field length??
|
|
|
|
|
I knew this was going to be a problem.
Is there not some specification somewhere that tells you the layout of the files? Why are they different?
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
Here's a possible solution assuming you want to do it in AppendFiles(). Check the names in GetMaxColPos I'm not sure they're correct.
Private Sub AppendFiles(ByVal inputPath As String, ByVal outputFile As String)
Dim columnPositions(10) As Integer
Dim theDir As DirectoryInfo = New DirectoryInfo(inputPath)
Dim theFiles As FileInfo() = theDir.GetFiles("*.txt")
Dim doHeaders As Boolean = Not File.Exists(outputFile)
Dim maxColPos(10) As Integer
Call GetMaxColPos(maxColPos, theFiles)
Using sw As StreamWriter = New StreamWriter(outputFile, True, System.Text.Encoding.Default)
.......
'Now read and write the data lines
While sr.Peek() >= 0
inputLine = sr.ReadLine()
outputLine = GetOutputLine(inputLine, createdAt, maxColPos)
sw.WriteLine(outputLine)
End While
End Using
Next fileCount
End Using
End Sub
Private Sub GetMaxColPos(ByVal p As Integer(), ByVal files As FileInfo())
Dim inLine As String
Dim fieldLen As Integer
For Each fi As FileInfo In files
Using sr As StreamReader = New StreamReader(fi.FullName(), System.Text.Encoding.Default)
inLine = sr.ReadLine()
fieldLen = inLine.IndexOf("Nom du Modèle")
If (fieldLen > p(0)) Then p(0) = fieldLen
fieldLen = inLine.IndexOf("AEC_COMPATIBILITY")
If (fieldLen > p(1)) Then p(1) = fieldLen
fieldLen = inLine.IndexOf("AEC_STANDARD_DESCRIPTION_FRENCH")
If (fieldLen > p(2)) Then p(2) = fieldLen
fieldLen = inLine.IndexOf("AEC_FREE_DESCRIPTION_FRENCH")
If (fieldLen > p(3)) Then p(3) = fieldLen
fieldLen = inLine.IndexOf("AWW_STANDARD_DESCRIPTION")
If (fieldLen > p(4)) Then p(4) = fieldLen
fieldLen = inLine.IndexOf("AEC_FREE_DESCRIPTION_ENGLISH")
If (fieldLen > p(5)) Then p(5) = fieldLen
fieldLen = inLine.IndexOf("AEC_ECN")
If (fieldLen > p(6)) Then p(6) = fieldLen
fieldLen = inLine.IndexOf("DNF")
If (fieldLen > p(7)) Then p(7) = fieldLen
fieldLen = inLine.IndexOf("REP_DNF")
If (fieldLen > p(8)) Then p(8) = fieldLen
fieldLen = inLine.IndexOf("REP_ASM")
If (fieldLen > p(9)) Then p(9) = fieldLen
End Using
Next
End Sub
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
|
No. The only changes that should be made are the ones I highlighted.
Think about it - you need two arrays: one to hold the max widths for the output, one to hold the widths for the current input file. So you also need two subs to populate the two arrays. You have to get the max widths before reading through the input files.
There's a potential problem with the output - it probably does not line up. This is because when the input is split up it includes leading/trailing spaces. If so then GetOutputLine needs tweaking.
Where did colPos come from? It should be
columnPositions .
Is this one big application that concatenates a bunch of files, then outputs a file with parent-child lines? Or are these separate apps that just happen to have same/similar input files? The reason I ask is that the problems you are finding all seem to be related.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
|
This is same problem as before. You need to step through and check that all the values in the column position arrays are positive and increasing. And also that the input line is at least as long as the highest column position.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
As you said, i will checkout and let you know.
Thanks for your support
|
|
|
|
|
I have a checkbox column in a datagridview.
I only want the user to be able to select one item in the datagridview.
But i don't know where to begin to get a count upon the number of checkboxes that are checked
Any help is much appreciated.
ASP all the way
|
|
|
|
|
What is the DataGridView bound to?
I mean, is it a database, a generic list a non-generic list.......
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
It is bound to a datatable populated by a database stored proc
ASP all the way
|
|
|
|
|
The only thing I can think of that might work.
Have a int field to track the row index of the 'true' row call it trueRow for illustration.
In either the OnCellClick or OnCellLeave handler, compare the row (e.RowIndex) to trueRow, if the same, return. If not the same, test if the cell (e.CellIndex) is the CheckBoxCell and if so, set the checkboxCell value from trueRow to false, store new row in trueRow.
Sorry not to be of more help.
Good luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
i have that working now on the cell click event
thanks man
ASP all the way
|
|
|
|
|
hi
I am completely new to vb 6.0. I have sstab control in which i have 4 tabs
GSM,GPRS,CDMA,PSTN. Each tab contains should contain a set of controls. The problem starts there. I am not able to put controls in the tabs so that the controls are visible only when the corresponding tab is clicked.
Thanks in advance
|
|
|
|
|
Abandon vb6 and do it in .NET
Seriously why do people still program new programs in that language.
It never was any good, the language is dead and has been for several years and its no longer supported.
|
|
|
|
|
Tom's right, Get VB.Net, it is a free download.
It (VB6) is unsupported and opens you to ridicule and shame!
------------------------------------
"Children today are tyrants. They contradict their parents, gobble their food and tyrannize their teachers. I despair for the future."
Socrates 400BC
modified on Thursday, May 7, 2009 10:36 AM
|
|
|
|
|
Member 3057887 wrote: I am completely new to vb 6.0
Great! Stop while you still can and be completely new to VB.NET before VB6 teaches you a ton of bad habits you have to unlearn to move up to VB.NET!
|
|
|
|
|
But the current project is in vb6 and we have an urgent demo. So there is only one option(continue working on this till the demo is complete).So if any one knows the solution kindly let me know
Thanks in advance
|
|
|
|
|
I couldn't tell you - I haven't used VB6 in 8 years.
I'll warn you now - VB6 has been unsupported by Microsoft for quite a long time now, and its runtime will not be supported under Windows Seven. Your app will work under XP, may or may not work under Vista, and won't work at all under Windows Seven.
|
|
|
|
|
Hi,
I am not shure, but in VB 6 you have two Tab-controls (I do not remember witch is witch). There is one, that only shows you a tabbed layout on top, and not hide any controls, it you click a tab. Then it has one (in a external ocx, I think) that does what it is supposed to do. Hope this helps.
By the way, it is a good idea to change to VB.NET, you need to have some time to learn it properly, but it's worth it.
Regards: Didi
|
|
|
|