|
OK, it worked, but the resizing of the CRV is limited to the size of the panel. so it's ineffective really. thanks for your help!
|
|
|
|
|
Well, another thought. You could create a form with the CRV on it.
Create a form with the CRV on it. Set the CRV's Dock proeprty to Fill. Set the form's BorderStyle to SizableToolWindow and it's ControlBox property to False (important!)
In you're code, create an instance of this form, set it's TopLevel property to False, then add it to another Form's Controls collection.
Dim crvHost As New MyCrvHostForm()
crvHost.TopLevel = False
Me.Panel1.Controls.Add(crvHost)
crvHost.Show()
Or you could just show the CRV host form as it's own window.
|
|
|
|
|
I'm trying to use IExtenderProvider to add a property to all the components on a form.
The RFEnabled property shows up in the property window but now where else (code - design time and run time). Is there anyway that I can expose the property to the code?
Imports System.ComponentModel
Imports System.Runtime.InteropServices
<ProvideProperty("RFEnabled", GetType(Control))> _
Public Class EnableChangeComponent
Implements System.ComponentModel.IExtenderProvider
Public Function CanExtend(ByVal extendee As Object) As Boolean Implements System.ComponentModel.IExtenderProvider.CanExtend
If TypeOf (extendee) Is Form Then
Return False
ElseIf TypeOf (extendee) Is Control Then
Return True
End If
End Function
#Region "MonitorForChanges"
<Category("Change Monitoring")> _
<Description("Whether or not to monitor this control for changes")> _
Public Function GetRFEnabled(ByVal ctl As Control) As Boolean
'insert real code here
Return True
End Function
<Category("Change Monitoring")> _
<Description("Whether or not to monitor this control for changes")> _
Public Sub SetRFEnabled(ByVal ctl As Control, ByVal value As Boolean)
'insert real code here
End Sub
#End Region
End Class
Thanks...
Nathan
-- modified at 14:06 Tuesday 27th November, 2007
|
|
|
|
|
nlarson11 wrote: The RFEnabled property shows up in the property window but now where else (code - design time and run time). Is there anyway that I can expose the property to the code?
No, because it's not part of the Control class. The extended properties only work in the designer. The properties are not "attached" to the controls they extend. The extension class is instantiated seperately from the controls and it keeps track of which controls it's been attached to. The controls don't have any idea that they've been "extended".
|
|
|
|
|
Thank you for the explanation...
|
|
|
|
|
I am running VS2005 & .NET 2.0. Trying to create a web service in VB using the ASP.NET Service Application template. If I select "File System" in the Location box, everything works fine. If I select "HTTP" the OK button is greyed out so I can't create the app. Obviously, I am failing to do something I should, or doing something I shouldn't.
Can somebody give me a clue?
|
|
|
|
|
I believe it's because you don't have IIS installed on your dev machine. It won't let you develop your service on a remote server.
|
|
|
|
|
I have IIS installed, but that doesn't mean it's installed correctly. I uninstalled it and then reinstalled it, but it didn't seem to make any difference. Are there tweaks I need to apply?
|
|
|
|
|
Was IIS installed AFTER Visual Studio?? IIS has to be installed first.
You might want to look at this post[^].
-- modified at 15:13 Tuesday 27th November, 2007
|
|
|
|
|
Ah, so!
I will try the fix in your reference.
Thanx!
|
|
|
|
|
I performed the suggested ritual. VS still won't activate the OK button for anything but a File System location.
Any other suggestions?
|
|
|
|
|
Reinstall Visual Studio (do NOT repair the installation!). Uninstall VS and reinstall it with IIS already installed.
|
|
|
|
|
I was afraid it was coming to that. Sigh.
|
|
|
|
|
I've done it more times than I care to count, so I feel your pain.
VS2008 takes even longer...
|
|
|
|
|
VS2008 takes even longer...
Now that's something to look forward to!
|
|
|
|
|
Firstly sorry, I am new to vb.net.
I am writing a vb.net application to manage reports on a reporting services server. The application allows users to create datasources, upload reports from rdl files etc.
The app uploads reports ok and creates datasources but when I try to run one of the reports I get "The report server cannot process the report. The data source connection information has been deleted. (rsInvalidDataSourceReference)"
If I manually set the datasource to the shared datasource on the report server the report works fine.
From searching around I think I need to re-point the datasource in the report but I cannot figure out how to do this. I have tried using SetItemDatasource but when I try to enter the name of the datasource I get a "Type String cannot be converted to a 1 dimensional array of type datasource."
I am sure I should be doing something like:
SetItemDataSources("/ReportsFolder/ReportName", SharedDataSource)
but I cannot figure out what the SharedDataSource reference should be, I have tried "myDataSourceFolder/MyDataSourcename" but I get the above error. Please somebody put me out of my misery.
Thanks.
Richard
Its better to burn out than to fade away!
|
|
|
|
|
Realsirocco wrote: but I cannot figure out what the SharedDataSource reference should be
Did you try reading the documentation[^]?
It states that the 2nd argument is an array of DataSource[^] objects.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
This is one of my first real tasks in VB 2005 (I'm returning to VB programming after years away).In some dialogs in an app, I want to let the user display an appropriate topic in an "HTML Help" help file. (I'll add a help button to the form so that users can tell which dialogs have context-senstitive help.
I can do this with something like:
Help.ShowHelp(Me, "C:\junk\foo.chm", HelpNavigator.Topic, "Making_a_widget.htm")
where C:\junk\foo.chm is the compiled help file and Making_a_widget.htm is the name of the topic file in the source.
This is all straightforward enough but it's a one-way street - I have to be confident that my topic is there. As far as I can tell, there is no way I can check whether the topic I want is still in the help file - if I garble the topic filename like this:
Help.ShowHelp(Me, "C:\junk\foo.chm", HelpNavigator.Topic, "Waking_a_midget.htm")
the help window just shows a "404" page where the topic would have appeared. Is there any way of checking from VB whether a help topic is present (or getting a help file error status), so that I can put something in my app's error logging file?
|
|
|
|
|
The Help class doesn't expose any method to do this. I'm not aware of any Win32 API call that can do this either.
|
|
|
|
|
We have a macro that creates VB.Net classes and setup pages from system specifications.
We are moving to VB.Net 2008 and are having a problem - the macro is now crashing at random times with InvalidCastException - Unable to cast a ComObject to EnvDTE._DTE on the line
DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer).Activate().
Placing a breakpoint on this line and watching the DTE shows its entries as {System._ComObject}. Sooner or later, those entries change to {System.Runtime.Interop.COMException} and the macro crashes.
If data entry is delayed by a coffee break, the crash will happen on the next entry.
Any ideas of what's going on? Is the garbage collector removing the DTE definition? How can I prevent this?
-- modified at 15:12 Wednesday 28th November, 2007
|
|
|
|
|
I copied this code exactly from the msdn site:
http://msdn2.microsoft.com/en-us/library/system.marshalbyrefobject.aspx[^]
However, it does not run for me. What am I missing? Thanks
Imports System
Imports System.Reflection
Public Class Worker
Inherits MarshalByRefObject
Public Sub PrintDomain()
Console.WriteLine("Object is executing in AppDomain ""{0}""", _
AppDomain.CurrentDomain.FriendlyName)
End Sub
End Class
Class Example
Public Shared Sub Main()
' Create an ordinary instance in the current AppDomain
Dim localWorker As New Worker()
localWorker.PrintDomain()
' Create a new application domain, create an instance
' of Worker in the application domain, and execute code
' there.
Dim ad As AppDomain = AppDomain.CreateDomain("New domain")
Dim remoteWorker As Worker = CType( _
ad.CreateInstanceAndUnwrap( _
[Assembly].GetExecutingAssembly().FullName, _
"Worker"), _
Worker)
remoteWorker.PrintDomain()
End Sub
End Class
|
|
|
|
|
sorry, to be clear it's the createinstanceandunwrap line that produce the error:
cstrader232 wrote: ad.CreateInstanceAndUnwrap( _
[Assembly].GetExecutingAssembly().FullName, _
"Worker"), _
Worker)
Could not load type 'Worker' from assembly 'WindowsApplication4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
|
|
|
|
|
Are you using VB.2008?? The page you linked to in the .NET 3.0 version.
YOu may be looking for this[^] page instead. Keep an eye on the version of the page you're looking at in the upper right corner of the content page. It'll say which version of the .NET Framework that page applies to, and give you links to other versions of the same page.
|
|
|
|
|
OK, thanks. Not yet for vb2008 for me; is it available already?
Anything that will help me get through this MarshalbyRefObject headache will be useful. I simply can't crack it.
|
|
|
|
|
VS2008 is availabe for download to MSDN subscribers. It's not out on CD/DVD yet, though it's been sent out to manufacturing.
You're using code from the .NET 3.0 version of that page. Like I said, use the code from the .NET 2.0 version of the page and you should have no problem.
|
|
|
|