|
OK, I created a new service, compiled it, and it gave the same error. Added this code to the top (w/ the other "using" statements):
using System.Configuration.Install;
Then it compiled correctly.
This declare should be in the template file, but it's not. I shall mention this to the #D team.
HTH,
J Dunlap
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
That did it. Thanks. Just starting to use .NET and C# finally! I'll keep in mind that the IDE is a little rough when it comes to certain things and try to learn to type.
--
"The money power of the country will endeavor to prolong its rule by preying upon the prejudices of the people until all wealth is concentrated in a few hands and the Republic destroyed."
-- Abraham Lincoln
|
|
|
|
|
Okay the help file says it exists, and the Class Library Referance says it exists, but intellsense can't find it and it creates a compiler error . What am I doing wrong? did I miss a posting and fall off of the bus?
The Offending code --
<Bindable(False), _
Category("Appearance"), _
EditorAttribute(GetType(System.Web.UI.Design.UrlEditor), _
GetType(System.Drawing.Design.UITypeEditor)), _
DefaultValue(""), _
Description("This is the primary image we will display to the web surfer.")> _
Public Property MainImageUrl() As String
Get ...
Set() ...
End Property
The Compiler Error --
C:\Documents and Settings\jmcburney.WALNUTCREEK\My Documents\Visual Studio Projects\Garaibali\WebControlLibrary1\HoverButtons.vb(5): Namespace or type 'Design' for the Imports 'System.Web.UI.Design' cannot be found.
|
|
|
|
|
You need to reference the DLL...
In Solution Explorer, Right Click in references and click Add reference.
Add the System.Design.Dll
Pete
Insert Sig. Here!
|
|
|
|
|
Righto!
Why is all of the obvious stuff that eludes me?
It must be my VB heritage.
|
|
|
|
|
If I create a stored procedure that uses a temporary table, I cannot get a .NET data adapter to configure correctly for that stored procedure. A workaround is to create a stored procedure with the same data columns, generate a data adapter and dataset, then change the stored procedure called by the data adapter. Is there a better solution to this problem?
Thanx...
>>>-----> MikeO
|
|
|
|
|
|
I wrote a service that use VB6 MSCOMM32.OCX for serial communication.
I works perfectly on my development machine which has both .NET studio and VB6 installed. But when I bring it over to a computer w/o VB6 installed it doesn't work (i registered MSCOMM32.OCX).
I got the following error: System.InteropService.COMException from the service. The odd thing is that the service monitor tool which is a winform application, which also use MSCOMM32.OCX but has a wrapper class that generated by winform, works perfectly as well.
the Error when I debug it says: Class is not licensed to use
Please help.
Thanks
|
|
|
|
|
What was the COM exception?
|
|
|
|
|
The exception was thrown was System.InteropService.COMException, the error message was : class is not licensed for use.
Other than that, it doesn't have any other error. Please note that it works fine on the machine that has both .NET Studio and VB6 installed...but not others.
Jimmy
|
|
|
|
|
Is it the lciense file for the OCX. I think the corresponding OCA has something to do with this but what do I know...
|
|
|
|
|
I copied the OCA file with it as well...but nothing works. as I mention, this is odd since the winform version works fine, but the service one doesn't.
|
|
|
|
|
We are having the same problem and have talked with MS. It seems like MSCOMM32.OCX requires some kind of certificate before it can be used, and that certificate is installed when you install VB6.
Our way around it is this:
http://msdn.microsoft.com/msdnmag/issues/02/10/NETSerialComm/
Hope this helps,
Mads
|
|
|
|
|
I am using both exception handling and inheritance in my visual basic project. I am curious how .NET handles exception handling between a base class and its derived classes. For example, if the base class method throws an exception and this method is invoked by the derived class, is it necessary to catch and handle that exception in the derived class? Or is the call to the base class method considered to be "inline"?
Thanks!
|
|
|
|
|
If an unhandled exception occurs in your base class, that exception will "bubble" up to your derived class. For example, the following:
Public Class BaseClassThrowsExceptions<br />
<br />
Public Sub MethodOne()<br />
Try<br />
Throw New ApplicationException("This is an handled exception")<br />
Catch ex As Exception<br />
Console.WriteLine("Exception: " + ex.Message + " -- handled by Base Class")<br />
End Try<br />
End Sub<br />
<br />
Public Sub MethodTwo()<br />
Throw New ApplicationException("This is an unhandled exception")<br />
End Sub<br />
<br />
End Class
when called from the following derived class:
Public Class DerivedClassThrowsExceptions<br />
Inherits BaseClassThrowsExceptions<br />
<br />
Public Shadows Sub MethodOne()<br />
Console.WriteLine("Derived class MethodOne calls base class MethodOne...")<br />
MyBase.MethodOne()<br />
End Sub<br />
<br />
Public Shadows Sub MethodTwo()<br />
Console.WriteLine("Derived class MethodTwo...")<br />
MyBase.MethodTwo()<br />
End Sub<br />
<br />
End Class
causes MethodTwo in the derived class to stop on an error when it calls the underlying method in the base class. If I put a Try...Catch block around it:
Public Class DerivedClassThrowsExceptions<br />
Inherits BaseClassThrowsExceptions<br />
<br />
Public Shadows Sub MethodOne()<br />
Console.WriteLine("Derived class MethodOne calls base class MethodOne...")<br />
MyBase.MethodOne()<br />
End Sub<br />
<br />
Public Shadows Sub MethodTwo()<br />
Console.WriteLine("Derived class MethodTwo...")<br />
Try<br />
MyBase.MethodTwo()<br />
Catch ex As Exception<br />
Console.WriteLine(ex.Message)<br />
End Try<br />
<br />
End Sub<br />
<br />
End Class<br />
then the exception is caught and displayed in the Catch region.
Is that what you're asking?
|
|
|
|
|
I'm developing an application, and one of it functions is to read files.
i want to add a progress bar which indicates how many precents of the file have been read.
the problem is that with big files the program hangs until the operation is completed, and no info is shown in the progress bar.
i'm working with j#.net but it can happen in any language.
here's a bit of the code:
public void readFile(String fileName)
{
FileStream fs =new FileStream(fileName,FileMode.Open);
long fileSize = fs.get_Length();
fs.Close();
StreamReader reader = new StreamReader(fileName);
progressWindow.Show(); //the form where the progress bar is.
int bytesRead = 0; //number of bytes that have been read.
char buf = '\0'; //buffer
while (reader.Peek() != -1) //while not at the end of the file...
{
buf = (char)(reader.Read());
/*...*/
bytesRead++;
//update the progress bar:
progressWindow.progressBar.set_Value((int)((bytesRead/fileSize)*100));
}
reader.Close();
writer.Close();
progressWindow.Hide();
}
thanks for your help.
|
|
|
|
|
You are using a synchronous I/O method, so the app hangs until the operation is compete. In order for your program to respond during these tasks use asynchronous I/O. Asynchronous I/O creates a separate thread to perform the I/O operation. See VS.NET documentation for details.
|
|
|
|
|
Hi!
Can you solve this problem?:
Do not loose SessionVariables when switching webapplications?
(I have a "FRAME" webapplication, which makes the authentication, menu,
and so on.
I wish to have more modules. These modules are optionally and i wont install all of them.
(possible way 1?)
I have my own SessionHandler wrapper, which can convert Requests into SessionVariables if it is neccessary. But, it seems to be a strange way. (not recommented, i think)
Problem:
i have more frames on clientside.
When i choose from menu (msiewebcontrols.TreeCtrl), i loose Session variables.
I fill up my menu from xml.(possible way?) so it is hard to encode runtime the xml.
so:
what about the same SessionHandleing in different webapplications?
AgyklonN
|
|
|
|
|
Hi all,
Normally the application config file name is app.config, but in my application have many application config file so I want to change it to xxxx_en.config or xxxx_fr.config for each module(DLL file), for each language
thanks,
cuong
|
|
|
|
|
|
Hi!
I created a "thin client" for a web service -- basically a simple C# Windows Form that connects to the web service and let the user interact with it.
Now I'd like to deploy that, but to make it easy for the client, I would prefer if they could simply download and execute the exec from a web page instead of having to install it using a Windows Installer (I used to create one using VS7 before).
Basically I'd like to have an ActiveX-like or Java applet-like deployment style for my windows form.
Does anybody think that is possible at all?
R/
|
|
|
|
|
|
Thanks, exactly what I needed!
I love MSDN, there's a lot of material there, yet I fear it because there's too much interesting stuff to read
|
|
|
|
|
Once upon a time (VS 6) I used to be able to copy a dialog resource from another project into my current project. As I get my feet wet with VS.NET 2002 I'm lost trying to figure out how to do it.
From what I gather, I can "Add Existing Item" from the project menu, but this ends up incorporating the whole RC file from my other project including any other dialogs, bmps, icons etc.
What I now have is a xyzDlg.cpp a xyzDlg.h and the dialog resource itself located in a .rc file. How on earth can I make a COPY of this dialog item so I can use it for my .NET app?
Note, I need to copy this resource not incorporate anything from the other project. I can't risk damaging the other VS6 project and it's (the other VS6.0 project) going to be archived off-line as soon as I have a copy so I don't somehow currupt it.
I feel awfully stupid, this should be easy. Help?
PAC
|
|
|
|
|
Under VS6, I simply used to open both RC files (the current project and the one to import from), then simply Control-C the dialog template and Control-V it into the new RC. Then copyied the .cpp/.h manually and inserted in the project manually.
I believe that may work with VS7 too but I haven't tried in a while.
|
|
|
|