|
why not install it in a "virtual PC" win XP machine or even XP mode
it works fine there and no compatibility issues
it also makes it more portable if you upgrade PCs in future
|
|
|
|
|
Bonjour pour connecter à l'émulateur Googlemaps avec telnet ensuite geo fix latitude longitude ,j'ai programmer une interface VB6 pour le telnet OK mais geo fix ... ... non
URL:www.packupload.com/Y4OBL9VTMEC
|
|
|
|
|
En Anglais, s'il vous plait.
|
|
|
|
|
I'm messing around (experimenting) with some Flash Action Script Text file.
I want to read the file, and display it in html for a preview, sort of like a thumbnail view.
I tried File.ReadAllLines, but it stripped out all the tabs and linefeeds.
So I tried reading the stream, converting from bytes to chars. So now I have a string array of text lines in char form,
[Question]
I can detect &H9 for the tab in byte, but I'm not sure how to detect the char version of &H9 which shows up as ""c
[EDIT][Objective]
I want to do some formatting, in which I replace the tab with or something, and perhaps do some color coding for comments in green, and so forth for use on a web page.
Perhaps I should leave the text the way it is, and just use a richText object, which might accept the strings in the current form.
Dim asStream As FileStream = New FileStream(physicalPath, FileMode.Open, FileAccess.Read)
Dim asLen As Long = asStream.Length
Dim fileData As Byte() = New Byte(asLen) {}
asStream.Read(fileData, 0, asLen)
asStream.Close()
Dim byteLine() As Byte = New Byte() {}
Dim strArray() As String = New String() {}
For bdx As Integer = 0 To fileData.Length - 1
Dim byteVal As Byte = fileData(bdx)
If Not (byteVal = &HD) Then
Array.Resize(byteLine, byteLine.Length + 1)
byteLine(byteLine.Length - 1) = byteVal
Else
Array.Resize(byteLine, byteLine.Length + 1)
byteLine(byteLine.Length - 1) = byteVal
Dim charLine() As Char = New Char() {}
Array.Resize(charLine, byteLine.Length + 1)
For cdx As Integer = 0 To byteLine.Length - 1
charLine(cdx) = AsciiByteToChar(byteLine(cdx))
Next
Dim value As String = New String(charLine)
Array.Resize(strArray, strArray.Length + 1)
strArray(strArray.Length - 1) = value
Array.Resize(byteLine, 0)
bdx += 1
End If
Next
|
|
|
|
|
File.ReadAllText and ReadAllLines don't do anything to tabs. In fact the former does not change anything in the content, and the latter only treats carriage returns and line feeds in a special way. However the HTML language says consecutive spaces are reduced to one, and tabs tabulate to multiples of 8, so that is probably what you are seeing. The one exception would be inside PRE tags.
|
|
|
|
|
So Luc, I'll try a .replace("tab", " ") and see how it works out. Multiples of eight, so 8
|
|
|
|
|
[DONE]
Well, more like it works, and does exactly what I need for the moment.
I ended up using the StringReader to read each char 1 at a time, and used Chr(9) to detect the tab char.
Do While (True)
integerRead = charReader.Read()
If (integerRead = -1) Then
Exit Do
End If
characterRead = Convert.ToChar(integerRead)
If (characterRead = Chr(9)) Then
htmlBuilder.Append(" ")
Else
htmlBuilder.Append(characterRead)
End If
Loop
|
|
|
|
|
Hello all,
I've been tinkering with my own web browser. I've made a simple app with 1 form and a webbrowser component docked inside it, then created a .exe file from that.
Then separately Ive created a MDI app and added the webbrowser.exe file to it.
Is there anyway to send that .exe file commands. I.e to navigate to a URL, or refresh, back, forward etc.
Any help would be greatly appreciated.
|
|
|
|
|
Tim Reece wrote: Then separately Ive created a MDI app and added the webbrowser.exe file to it.
How exactly have you done this? As far as I'm aware you cannot add executable programs to each other.
|
|
|
|
|
I am converting a vb6 project to .net, slowly but surely. If the VB6 project I had a DLL we wrote, I add a reference in the VB6 program and wala I could use it.
I tried a similar thing in .net but I get a "Object reference not set to an instance of an object." when I try to call something in the dll.
I am not sure how to properly do this in VS2008, do I need to do some additional initialization? How would I do it if I wanted to debug the code of the DLL when I am running the secondary project? in VB6 I could point a reference to the VB project for the DLL, not sure how to do that either.
If it not a quick answer, can any one point me to a tutorial of some nature? Not quite what to google...
|
|
|
|
|
Without seeing the code that's throwing the exception, it's pretty difficult to tell you what went wrong.
But, you only get that message when you try to use a variable that contains null (Nothing in VB).
The whole process is really not very different than it was in VB6.
|
|
|
|
|
Assuming your DLL contains native code, you would need P/Invoke to call that from a managed language such as C# or VB.NET; here is an article that should get you on the right track: pinvoke1[^].
I suggest you start with the simplest call available in the DLL, and learn the techniques step by step.
|
|
|
|
|
I have been compiling applications for years in VB6 (i know, in process of converting to .net) but anyway.. I update the exe, zip it and email to to someone... been doing this for many many years.
I compiled a couple in the last few days and tried to send them through outlook. (I zip them first). Outlook seems fit to strip the file from my message claiming it has a virus.
my computer is . er uh, ahem.... managed by the company, which means regular scanning, constant virus updates every windows update ever created, all 1000+ of them and so-on, so I would really be surprised if I did indeed have a virus.
Their solution was to run "superAntiSpyware" scan, which seems to pick out a few other of my applications (I have hundreds) as being infected by Trojan.agent/GenBancos. Many of the ones it seems to think are infected are over 10 years old, so I am thinking false positive on them. It does not pick up any on the applications I have tried sending the last couple days.
Has anyone ever heard of or is it possible to compile a virus into an application unknowingly? (i.e. a virus lurking and attached itself to the file when I compile?) If so, given that my computer is scanned daily with virus definitions updated almost as regularly, how likely is this to be the issue?
or am I getting jerked around by outlook and the glorious support staff?
|
|
|
|
|
Sounds like false positives to me.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Either you have written a virus or your company email policy / spyware program seems to have been changed suddenly.
|
|
|
|
|
Those are false positive results by their virus scanner. That's nothing unusual. Talk to the manufacturer of their virus scanner.
|
|
|
|
|
thanks all for your comments, that is about what I was thinking
|
|
|
|
|
Is there a way that I can fire an event when the user scrolls to the end of the flowlayoutpanel? if so then can you please tell how to do it?
just a quick note: I am using the autoscroll/horizontal scrollbar.
Algorithm:
If scroll.value = endofthispage then
msgbox("You are at the end of this page")
else
'do nothing
end if
|
|
|
|
|
Hey,
there is a scroll event for controls. see this[^] for info and how to get/use it.
Nick
|
|
|
|
|
So I tried to do something like that today.
If e.NewValue = e.OldValue Then
MsgBox("hi")
End If
but it is not working the way I want it to work... The problem is that now if I click the arrows on the scroll bar, then only it works, if I use the (bar) *not the left/top right/bottom arrows, it shows the message box like 100x times. but even then I am having a problem. the problem is that, when I scroll back to the beginning, it shows that message box again.
|
|
|
|
|
Perhaps its not as MS once intended it. or perhaps it is...but the scrolling and value changed are two differed events.
if you press one of the scrolls arrows the program will make it scroll in that direction once. and then change the value. but when you drag the bar you scroll every time you move a little...but the value is only changed upon the key release.
a easy thing to do is to declare a private boolean (outside the event). and switch it true/false so the message box only displays once.
Private ScrollingMessage as Boolean = true
If e.NewValue = e.OldValue and ScrollingMessage Then
MsgBox("hi")
ScrollingMessage = false
elseif e.NewValue <> e.OldValue then
scrollingmessage = true
End If
|
|
|
|
|
yeah but this still causes the issue of 100x message boxes that are displayed when I use the bar instead of the arrows.
Edit:
And the issue of back scroll is still there..
|
|
|
|
|
Oke started a little project to test a bit around and i think you might find this interesting. i used a form called form1. and placed a listbox on it i called txtscroll.
I suggest you make a same sort of window and paste the following code in to see how it works:
Public Class Form1
Dim WithEvents scrollhandler As MyListener
Private scrolled As Boolean = False
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim index As Int32 = 0
Do While index < 100
txtscroll.Items.Add(index.ToString())
index += 1
Loop
scrollhandler = New MyListener(txtscroll)
End Sub
Private Sub scrollhandler_MyScroll(ByVal sender As Object, ByVal e As System.EventArgs) Handles scrollhandler.MyScroll
End Sub
Private Sub txtscroll_MouseWheelScroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtscroll.MouseWheel
scrollhandler_MyScroll(e, e)
End Sub
Private Class MyListener
Inherits NativeWindow
Public Event MyScroll(ByVal sender As Object, ByVal e As EventArgs)
Const WM_MOUSEACTIVATE = &H21
Const WM_MOUSEMOVE = &H200
Private control As Control
Public Sub New(ByVal control As Control)
AssignHandle(control.Handle)
End Sub
Protected Overrides Sub WndProc(ByRef Messageevent As Message)
Const WM_HSCROLL = &H114
Const WM_VSCROLL = &H115
If Messageevent.Msg = WM_HSCROLL Or Messageevent.Msg = WM_VSCROLL Then
RaiseEvent MyScroll(control, New EventArgs)
End If
MyBase.WndProc(Messageevent)
End Sub
Protected Overrides Sub Finalize()
ReleaseHandle()
MyBase.Finalize()
End Sub
End Class
End Class
|
|
|
|
|
Thanks for the example. but I still can't figure out how I can use this to know if the user has scrolled to the end.
|
|
|
|
|
hmm, oke im not really sure why you want to show that messagebox. but I thrown in some more trail and error and i came up with the code below. Note that I ran a little low on time so its a bit of a mess...i recommend throwing in a breakpoint to figure out exactly how the code works before putting it into your project. to test it again make a form (called form1) and add a listbox (txtscroll) in it. then copy paste the code into your form.
Imports System.Runtime.InteropServices
Public Class Form1
Dim WithEvents scrollhandler As MyListener
Private scrolled As Boolean = False
Private maxscroll As Int64
<DllImport("user32.dll", CharSet:=CharSet.Auto)> _
Public Shared Function GetScrollPos(ByVal hWnd As IntPtr, ByVal nBar As Integer) As Integer
End Function
<DllImport("user32.dll")> _
Private Shared Function SetScrollPos(ByVal hWnd As IntPtr, ByVal nBar As Integer, ByVal nPos As Integer, ByVal bRedraw As Boolean) As Integer
End Function
Private Const SB_HORZ As Integer = &H0
Private Const SB_VERT As Integer = &H1
Public Property HScrollPos() As Integer
Get
Return GetScrollPos(DirectCast(txtscroll.Handle, IntPtr), SB_HORZ)
End Get
Set(ByVal value As Integer)
SetScrollPos(DirectCast(txtscroll.Handle, IntPtr), SB_HORZ, value, True)
End Set
End Property
Public Property VScrollPos() As Integer
Get
Return GetScrollPos(DirectCast(txtscroll.Handle, IntPtr), SB_VERT)
End Get
Set(ByVal value As Integer)
SetScrollPos(DirectCast(txtscroll.Handle, IntPtr), SB_VERT, value, True)
End Set
End Property
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim index As Int32 = 0
Do While index < 1000
txtscroll.Items.Add(index.ToString())
index += 1
Loop
maxscroll = index - 18
scrollhandler = New MyListener(txtscroll)
End Sub
Private Sub scrollhandler_MyScroll(ByVal sender As Object, ByVal e As System.EventArgs) Handles scrollhandler.MyScroll
If VScrollPos = maxscroll And scrolled Then
MessageBox.Show("you reached the max on the verticle scrollbar!", "yay")
scrolled = False
ElseIf VScrollPos < maxscroll Then
scrolled = True
End If
End Sub
Private Sub txtscroll_MouseWheelScroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtscroll.MouseWheel
scrollhandler_MyScroll(e, e)
End Sub
Private Class MyListener
Inherits NativeWindow
Public Event MyScroll(ByVal sender As Object, ByVal e As EventArgs)
Const WM_MOUSEACTIVATE = &H21
Const WM_MOUSEMOVE = &H200
Private control As Control
Public Sub New(ByVal control As Control)
AssignHandle(control.Handle)
End Sub
Protected Overrides Sub WndProc(ByRef Messageevent As Message)
Const WM_HSCROLL = &H114
Const WM_VSCROLL = &H115
If Messageevent.Msg = WM_HSCROLL Or Messageevent.Msg = WM_VSCROLL Then
RaiseEvent MyScroll(control, New EventArgs)
End If
MyBase.WndProc(Messageevent)
End Sub
Protected Overrides Sub Finalize()
ReleaseHandle()
MyBase.Finalize()
End Sub
End Class
End Class
EDIT: oh before i forget it: the maximum of your scroll bar is calculated by the total amount of items - the amount of items that can be displayed without a scroll bar
modified 2-Jul-12 4:52am.
|
|
|
|