|
|
"The instruction at "0x77d043a6" referenced memory at "ox480a1f5a". The memory could not be "read". Click on OK to terminate the program Click on Cancel to debug the program"
I got this popup error when I try to open a new browser in vb.net application by using "window.open()".
I'm using windows server 2003 sp1 and vs .net 2003.
Any hints will be appreciate!!
|
|
|
|
|
If you're trying to display a website in a WEB browser, then try this...
Process.Start("http://www.codeproject.com")
|
|
|
|
|
Thank you for your help.
I found the reason. It's still because OWC10.
|
|
|
|
|
I have an EXE file that calls a DLL.
I would like the DLL to RaiseEvent on the EXE, I have pasted sample code for
the DLL and EXE
My problem is that the Class doesn't seem to be able to Raise the Event on
my executable... Any ideas, or errors you see?
Thanks in advance,
J.
-------- START OF CLASS ----------------------
' The class project is called ClassTest
Public Class Class1
Public Event TestRaiseEvent()
Public Sub Test()
RaiseEvent TestRaiseEvent()
End Sub
End Clas
-------- END OF CLASS --------------
--------- EXE CODE ---------------
Public clsTest as New ClassTest.Class1
Public WithEvents TestDLL As ClassTest.Class1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
clsTest.Test()
End Sub
Public Sub Test_DLL_Test() Handles TestDLL.TestRaiseEvent
MsgBox("This is a test of the Raise Event Function....")
End Sub
--------- OF OF EXE ---------------
|
|
|
|
|
The method Test_DLL_Test() will never be fired, because you have created two objects of type ClassTest.Class1 and calling the Test() method of the one that isn't actually hooked up to anything. Try the following:
Public WithEvents clsTest as New ClassTest.Class1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
clsTest.Test()
End Sub
Public Sub clsTest_Test() Handles clsTest.TestRaiseEvent
MsgBox("This is a test of the Raise Event Function....")
End Sub Hope that helps
Cheers,
Will H
|
|
|
|
|
Nope,
That works fine for just calling the Event.
The EXE references the DLL, and I would like to be able to raise the event in the DLL and capture it in the Executable...
J.
|
|
|
|
|
All you have to do is wrie up an event handler. This[^] example shows you everything you need to make this work.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello All,
I don't know if this has been done or not so again please tolerate my ignorance.
I'm retriving information from a database and placing the output into selected columns on a listview control. What I would like to do is adjust the columns to the width of the largest data piece in that field.
We can use the Length function to return the number of characters in a field, but I need to convert the string length into twips. For example if a 12 point font's character is 15 twips long then to adjust the listview's column I would multiply 15 by the length of the string and reset the columns width.
Any way of doing this?
Thank you,
Quecumber256
|
|
|
|
|
Quecumber256 wrote: What I would like to do is adjust the columns to the width of the largest data piece in that field.
The ListView control can actually do this for you, but VB6 doesn't provide an easy function to make this happen. You have to make a call to the win32 API.
The following code will resize a ListView column to just fit its text. You need to call this function for every column you want to resize.
Private Declare Function SendMessage Lib "USER32" Alias _
"SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
'
' Re-sizes ListView column so that all of its text is shown.
' If last column is specified, then it is stretched to right side of control.
Private Sub AutoSizeColumn(ctrl As ListView, iColumn As Integer)
SendMessage ctrl.hWnd, &H101E, iColumn, ByVal -2
End Sub
-- modified at 18:36 Monday 30th January, 2006
|
|
|
|
|
Thank you. This worked just as I wanted it too.
Quecumber256
|
|
|
|
|
Hi All,
I am binding a DataGrid to an ArrayList, but in the Grid, it does not show the append row, the one with the asterisk, like it does when binding to a Table or a DataView.
Is there any way to have the grid show the append row when using an ArrayList or Array?
The approach I am exploring right now, is using a class that inherits ArrayList, but cannot figure out which properties it should have, to enable the desired behavior.
Anyone have an idea about this?
Many thanks!
Hiske
|
|
|
|
|
Hello,
I created the class "document":
Public Class Document
Private Shared _title As String
Public Property Title() As String
Get
Return _title
End Get
Set(ByVal value As String)
If _title = value Then
Return
End If
_title = value
End Set
End Property
End Class
To set the property value I am using:
Dim MyDocument As New Document
MyDocument.Title = "My book title"
I need to be able to create "second level" properties. An example:
MyDocument.Author.Name = "Author Name"
Instead of having
MyDocument.AuthorName = "Author Name"
I inserted the class "Author", with property "Name" inside Class Document.
It is not working. Could someone explain me how to create it?
Thank You,
Miguel
|
|
|
|
|
shapper wrote: I inserted the class "Author", with property "Name" inside Class Document.
Don't do that. Put the author class in a file of its own. There are very few good reasons to create an inner class and I doubt this is one of them.
shapper wrote: It is not working. Could someone explain me how to create it?
Define "it is not working"! What doesn't it do?
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
shapper wrote: Private Shared _title As String
Are you sure _title has to be shared (and Title not)?
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick || Fold With Us! || Pensieve || VG.Net ||
|
|
|
|
|
It sounds to me like you inserted a class definition, instead of an instance of a class. If you have a class called Author, then you can create a property of type Author, also called Author ( or name it whatever you want ) and it will work as you are hoping.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello!
I think something is new in visual studio 2005. Here is the scenerio:
I have a tabcontrol with two tab pages. I have placed one label in 1st tab page and set its visibility to true. When I shift to 2nd tab page the label's visibility has treated as invisible by the compiler at run time.
Is that true? if it is not how could I reach the visible attribute's value while I perform a task in the second tab page rather than defining the following statement
if label1.visible = true then
because it is not working out even though the label1 in visible in 1st tab page.
If you enlight me about it, I would really appreciate it...
Bedri
|
|
|
|
|
B Journey wrote: I have placed one label in 1st tab page and set its visibility to true. When I shift to 2nd tab page the label's visibility has treated as invisible
Ummm...No, it isn't. It's Visible property is still True, the thign is you changed the page that the control is sitting on! It's just like pages in a book. If you change the selected tab, you turn the page. Stuff that's on the previous page is no longer visible.
You're explanation of what you want to do needs more clarification. I can't figure why you're trying to get the Visible property of your label.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I thought the same as you do Dave but it is not working that way. The label1 is placed on 1st tab page and itss state is visible. However, when i shift from next tab page at runtime (while the code is checking its visibility) it says now the label's state is invisible. I tested this with a message box and I got the state status (Invisible) while I was on the 2nd tab page. I am not sure if it is a bug in the Visual Studio 2005.
But thank you for your help. In the meanwhile, do you know where I can get a sample code for wrting WAB (Windows Address Book) in vb.net?
Bedri
|
|
|
|
|
Damn! Screw up on my part. No, the Visible property reflects the actual state of the control. If some other window obscures the entire control in question, it's Visible property returns False, well, because it's not visible anymore. It's functionality is by design, it's not a bug.
As for the Address Book, I don't know of any example code in VB.NET. But, the documentation for the WAB API is here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hey folks. I'm faily new to VB2005 and I was wondering if theres a way to have a second form display in the same window as the first (root) form appears
I know you can display a second form in a seperate window by using
my.forms.form2.showDialog()
Thats OK but I would like to have, if possible, the form show in the window that is already open.
any help would be appreciated
Thanks
Microsofts like the dentist you really dread going to them but eventually your forced to.
|
|
|
|
|
Well, if you'll notice, the Form class derives from Control. Since all the controls you see on the form derive from, obviously, Control, Form should be able to be used just like a control. You can't make it appear using ShowDialog, but you can treat it just like any other control.
See this[^] little article on MSDN for more information.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Does anybody know how to correctly use the GetUserObjectInformation in VB.Net. I seem to have many problems trying to get it to work. Here is what I am basically trying to do. I want to get the current desktop name. So in order to do so I have to call GetThreadDesktop(GetCurrentThreadId()). Which would go into the handle part of the GetUserObjectInformation call. But for some reason with everything filled in I get an error 0. I have seen this done many times in C++ and C# but have not found any reference in VB.Net.
Thanks,
Jason
|
|
|
|
|
|
Is your API declare like this?:
Private Declare Function GetSystemMenu Lib "user32" _<br />
(ByVal hWnd As Long, _<br />
ByVal bRevert As Long) As Long
Eric Dahlvang-Programmer
|
|
|
|