|
998 wouldn't have told you what the problem was either. It means "Invalid access to memory location." The only thing it would have told you is that your passing an invalid reference to a variable, or memory location.
The complete list of Win32 API errors can be found here[^].
RageInTheMachine9532
|
|
|
|
|
Hi
I'm new to VB.Net and when I try to load an existing VB6 project I get a "Security Error"
When I try to start a new project in VB.Net I get a "Required permissions cannot be acquired" error
Can anybody point me in the right direction as to what to do?
Thanks
Stephen
|
|
|
|
|
Because .NET can run applications across the net it is concerned that your objects can be hacked by other net users. That's the crude explanation. So there are things called attributes, which you need to read up on, that indicate how certain aspects of your objects are to be controlled, accessed, and things like that. Attributes are a hell of a good idea, as you'll discover, you can do all sorts with them. Anyway, I've digressed. As you are upgrading from 6 to .NET you should take a look at msdn.microsoft.com and read about this process of upgrading, especially to see what's out and what's in if you know what I mean.
There are a lot of issues about upgrading. I learned real quick, its not just plug and play, its plug and pray, pray, pray, then rewrite 8-)
Nursey
|
|
|
|
|
So you can't even start a new project? Do you have Administrator rights and are you in the Debugger Users group?
greetz
*Niels Penneman*
Software/Dev Site Personal Site
|
|
|
|
|
Hello,
I am just learning the tcp/ip functions etc under vb.net so please look over me if this is obviouse. I have been all over looking into any functions that I didn't totaly understand and can't see that I am doing anything wrong (i obviousely am though)
everything "works", client connects to server and when anything is sent to the server it starts the mp3 and passes all messages the way i ment for it to except that my server is supposed to display the data it recieves in a window (that worked untill i changed some things) and my server will hang after I pass a few strings to it from the client.
The hanging is what I can't figure out. I can debug the other no problem.
Anyway here is the code, please look over how sloppy it has gotten after hours of changeing things arround.
Server :
Imports System.Net
Imports System.Net.Sockets
Imports System.Text
Public Class Form1
Inherits System.Windows.Forms.Form
'Windows Form Designer Generated Code was here "removed for size of post"
Const port As Int32 = 8353
Dim localIp As IPAddress = IPAddress.Parse("127.0.0.1")
Dim server As New TcpListener(localIp, port)
Dim netStream As NetworkStream
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'start tcplistener on localhost: 8353
server.Start()
Try
'accept connections
Dim client As TcpClient = server.AcceptTcpClient()
'get stream
netStream = client.GetStream
While netStream.CanRead And netStream.CanWrite
'read stream into a byte array
Dim reciveBufferSize(client.ReceiveBufferSize) As Byte
netStream.Read(reciveBufferSize, 0, CInt(client.ReceiveBufferSize))
'convert data from the client into a usable string variable
Dim dataFromClient As String = Encoding.ASCII.GetString(reciveBufferSize)
'do something with the data
TextBox2.Text = dataFromClient
'send a response to the client
Dim serverResponse As String = "Transmision completed"
Dim sendBufferSize As [Byte]() = Encoding.ASCII.GetBytes(serverResponse)
netStream.Write(sendBufferSize, 0, sendBufferSize.Length)
'show what was sent
TextBox1.Text = serverResponse
If dataFromClient.ToString > "" Then
System.Diagnostics.Process.Start("C:\Documents and Settings\devan\My Documents\my music\christian\Did You Feel the Mountains Tremble_ (1).mp3")
End If
End While
Catch exc As Exception
MessageBox.Show(exc.ToString)
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
server.Stop()
End Sub
End Class
Client:
Imports System.net
Imports System.Net.Sockets
Imports System.Text
Public Class Form1
Inherits System.Windows.Forms.Form
'Windows Form Designer Generated Code was here "removed for size of post"
Dim client As New TcpClient
Dim netStream As NetworkStream
'If theres a problem check if this should be public for both client and server
Public Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'establish connection
client.Connect("127.0.0.1", 8353)
netStream = client.GetStream
'show connection status
If netStream.CanRead And netStream.CanWrite Then
StatusBar1.Text = "connected"
''do simple write
'Dim clientCommand As String
'clientCommand = TextBox1.Text.ToString
'Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(clientCommand)
'netStream.Write(sendBytes, 0, sendBytes.Length)
'' Read the NetworkStream into a byte buffer.
'Dim bytes(client.ReceiveBufferSize) As Byte
'netStream.Read(bytes, 0, CInt(client.ReceiveBufferSize))
''Do something with data from server
'Dim dataFromServer As String = Encoding.ASCII.GetString(bytes)
'Label2.Text = dataFromServer.ToString
Else
If netStream.CanRead = False Then
StatusBar1.Text = "cannot write to stream"
Else
If netStream.CanWrite = False Then
StatusBar1.Text = "cannot read stream"
End If
End If
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'do simple write
Dim clientCommand As String
clientCommand = TextBox1.Text.ToString
Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(clientCommand)
netStream.Write(sendBytes, 0, sendBytes.Length)
' Read the NetworkStream into a byte buffer.
Dim bytes(client.ReceiveBufferSize) As Byte
netStream.Read(bytes, 0, CInt(client.ReceiveBufferSize))
'Do something with data from server
Dim dataFromServer As String = Encoding.ASCII.GetString(bytes)
Label2.Text = dataFromServer.ToString
End Sub
End Class
Thanks in advance if anyone can help me figure this out.
|
|
|
|
|
I'm not an expert on the sockets stuff, but my gut feeling makes me wonder if the loops you are in need a DoEvents to keep the events running through the rest of your application.
You could also use the system.diagnostics namespace to get access to the Debug object and start writing some assert and trace statements, that will show where your code is stopping. It really might just be that it looks like its hung when in fact its in such a tight loop it can't do any of the event stuff it needs to do. So the doevents will yield for a time and let the system do its thing.
Nursey
|
|
|
|
|
Thanks,
I haven't gottin real deap into the diagnostics namespaces but the whole purpose is to learn so I'll look into it. Defenetly sounds like a good thing to learn to use for debugging.
Thanks again.
2 U.S. coins equal 30 cents and one is NOT a nickle. Hmm..
|
|
|
|
|
How to get all the controls in the form, like in VB we used to do
for each ctrl in me
if typeof ctrl is Textbox then
ctrl.text = ""
end if
next
How we do this in VB.Net.???
Thanks
Be Humble in Victory and Strong in Defeat. -Het
|
|
|
|
|
You need to use the Controls property, which all forms have, and it seems all controls have. So your panels can have a collection of controls. You can do this
dim lControl as Control
for each lControl in Me.Controls
...
Next
Me is a form or Panel or any control.
The typeof works the same.
Hope this helps.
Nursey
|
|
|
|
|
may i know if there is any sample codes on how to link vb.net GUI with c++ DLL functions? thanks
|
|
|
|
|
That is hellishly difficult. C++ compilers mangle the names of classes and functions so that they can be uniquely identified. The names exposed by the DLL will be the mangled versions such as "@MyClass@#SomeFunction@$%$@%@@". The mangled format is different for most compilers, and sometimes different between different versions of the same compiler.
--Colin Mackay--
|
|
|
|
|
Like Colin said, LINKing is hellishly difficult. Or are you trying to CALL functions in a C++ .DLL. If so, you can start reading up on it here[^]. This is an article showing how to call DLL functions using P/Invoke in VB.NET. VB6 is very similar to this.
RageInTheMachine9532
|
|
|
|
|
Hello All..
I guess you have see attachments embedded in Word Document like email having attachments.
I use MSWord automation with VB to get those attachments. I can only get the name of the attachments but can't find the way to save them.
If you have the word document which contains attachments like .jpg, .pdf, .xls, .ppt files, select one of the attachment files and either right click or go to Edit menu of Word application and you will see
File Object-> save as, open, print, convert.. etc.
I think there should be the function that allow me to save those attachments programmatically since you can save them mannually in MS Word.
I want to save as the attachment.. and cannot find the way to do it in Word reference.
does anybody know how??
|
|
|
|
|
I Don't wanna go to Add/Remove Program to Uninstall my application. How I create a shortcut to do that?
Johnny Lizardo
|
|
|
|
|
|
IS VB.NET..
Johnny Lizardo
|
|
|
|
|
It's works. Thank You men..
Johnny Lizardo
|
|
|
|
|
Anyone know's about bootstrapper plug-in.?
I have a problem with that. I already installed from "http://www.gotdotnet.com/Community/Workspaces/workspace.aspx?id=2f8f0a23-f529-4158-8e0a-d187d16f41f1"
but don't change anything about automatic install the dotnetfx.exe and MDAC.
Anyone help...
Johnny Lizardo
|
|
|
|
|
Maybe use the documentation link on the site ... you need .net passport but i guess almost everybody has one now ...
greetz
*Niels Penneman*
Software/Dev Site Personal Site
|
|
|
|
|
hi
happy new year to all
i am from india, i want to programm an application in VB 6.0 to implement a regional font. is this possible , if so how can i do it ? i mean if i set the font for a text box to that font will it take the same letters as expected ? and i want to generate the reports in the same font also...
pls. any one help me
Mohan G
|
|
|
|
|
This doesn't make any sense to me. Do you want to create a new font? Or do you want to use fonts that have the same character sets? Or are you talking about typing chracters in a text box in the local language?
In any case - I think what your getting at is "localization". For more information on localization and VB6, you might want to start here[^].
RageInTheMachine9532
|
|
|
|
|
hi rage
thanx for your reply. yes i am "talking about typing chracters in a text box (or in any editable intrinsic control) in the local language?. is this possible ? can you show me a way out here please ?
Mohan G
|
|
|
|
|
OK. Now your definately talking about localization, not to mention depending on the keyboard the user is using. If your going to be accepting input in German or Arabic, it's best to use a German or Arabic keyboard. You can change the font to something that supports the language your using, but no font supports every character of every language your using.
You can change the input language and font using the "Regional and Language Options" control panel in Windows 2000/XP. But your app is also going to have to be designed to handle such a situation. How to do this is covered in the topic of "International Issues" in the VB6 documentation, here[^]. It also includes an example application that demonstrates how to resolve the issues of localization and accepting input in different languages.
RageInTheMachine9532
|
|
|
|
|
Is there a way to get an up/down control to appear on a property grid such that I can use it to edit numeric values?
All the UITypeEditor stuff seems intent on popping up dialogs and showing dropdowns. I can't believe that the grid doesn't offer this as a default choice for numbers, it would be soooooo nice.
Perhaps there's a way using child controls, but then you have the nightmare of what to do when the property grid scrolls and aligning an up/down control with a row in the grid.
Any ideas would be appreciated.
Nursey
|
|
|
|
|
Hi,
I'm working on a VB.NET project and my objects should be reachable using COM. My problem is that these objects have overloaded methods, properties, which seems problematic.
For example I have a collection class with two item properties:
Default Public ReadOnly Property Item(ByVal Key As String) As Object
and
Default Public ReadOnly Property Item(ByVal Index As Integer) As Object
When I try to use an object of this class in a COM only environment - like MS Word - there only one Item can be seen, and allways the first. So using the order above I can query collection items only by Key, when I change the order I can query only by Index.
This problem does not occour under .NET.
My question is: how to do VB.NET overriding, polymorphism to satisfy COM requirements?
(K)
|
|
|
|