|
Hey Holmes,
Hmmmm, sometimes I hate using our logic when there could be more proper ways to perform casual tasks like this one but I think you're right, it's not that bad after all. But I'll go for the CSV file instead so I can make sure the user gets the language version without touching the database, besides, it is considered a part of the interface package not the database.
Thank you for sharing Holmes!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
It's Sunday - give it a few hours and see if the states come up with some more productive ideas, what you are doing is not new, I'm confident there are a number of solutions out there.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi everybody,
I'm developing a windows based app. We are still in developing phase, so there are a lot of changes which should be sent to users every day. I need a suitable publishing method and found ClickOnce a good solution for our regular updates. But, there are some problems:
1) The app is multilayer with couple of projects. each project has some config and some user defined meta data files which should be with exe file. How can I add them to ClickOnce? just the config file of the exe project is added!!!!
2) there are some projects which are loaded by reflection in app. So there is no direct dependency between them and exe project, how can I add them too?
Thanks,
|
|
|
|
|
Presumably you have the configs stored in a file somewhere, add the file(s) to the project. We store user configs in their app data folder but that is for stuff created by the app and is not downloaded.
As for 2, get rid of reflections - this is a design issue. OR add a dependency to the assembly, this probably has the same affect as referencing the project anyway so there is probably limited value in using reflections for late binding.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I'm a beginner to Microsoft Visual C# 2008 Express Edition. I get the following error...
The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF
When trying to use a solution posted here: http://forums.cpanel.net/showpost.php?p=468581&postcount=2
I've googled for this yet none of the solutions make any sense to me.
Any help is greatly appreciated since I'm fairly stumped on this one. If you need more info just ask!
|
|
|
|
|
I Googled for 'The server committed a protocol violation' and got a shed load of hits.
The consensus seemed to be that you need <httpWebRequest useUnsafeHeaderParsing="true" /> in your config file.
However I would suggest that you Google for yourself to see if any of the circumstances fit your situation exactly.
Good luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks! I was wondering through, in Visual C# Express, where do I need to put that? I've heard about app.config and web.config but I don't know where they're located.
|
|
|
|
|
Normally you don't have to 'put' app.config or web.config files anywhere, that is all taken care of for you by the IDE.
I can only suggest that you take a look at this[^] page from MSDN about web.config.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks for your help! I've got it working!
|
|
|
|
|
i get this error msg after compiling using QEMU.
,missing method expectation was unhandeled.
method not found...,system.object . system.windows.threading.dispatcher,invoke(system.delegate,system.object[])
trouble shooting tips: if a method in a class library has been removed, recompile any assemblers that referrence that library.
general help fo this exception.
why i get that msg ? thanks.
|
|
|
|
|
Have you tried this?[^] It seems to be a suggestion to the same question that you asked a few hours ago. Did you follow up that suggestion? If you did, what was the outcome? If not, why not?
|
|
|
|
|
I'm fairly new to C#, and have written a small app to test something I needed to do in a bigger app. The app is simple, has a single main form and the routine creates a task bar icon. The only event that is serviced is when the user doble-clicks on the icon in the tray. Double clicking will hide the main window, double clicking again will show the main window. All that I understand, but he mapping of the ShowWindow functions has me seriously confused. I kind of understand the mapping of the ShowWindow function, but the Handle argument with the call makes no sense. Handle isn't declared anywhere, isn't intialized and yet the thing works. I've included thye code below:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace Foo_Bar
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.ComponentModel.IContainer components;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
//
// notifyIcon1
//
this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
this.notifyIcon1.Text = "notifyIcon1";
this.notifyIcon1.Visible = true;
this.notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_DoubleClick);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(192, 110);
this.Name = "Form1";
this.Text = "Form1";
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private System.Windows.Forms.NotifyIcon notifyIcon1;
private const int SW_HIDE = 0;
private const int SW_RESTORE = 1;
private static bool VisibleBoolean = true;
[System.Runtime.InteropServices.DllImport(
"user32",
EntryPoint="ShowWindow",
ExactSpelling=true,
CharSet=System.Runtime.InteropServices.CharSet.Ansi,
SetLastError=true)]
public static extern int ShowWindow(IntPtr hWnd, int nCmdShow);
private void notifyIcon1_DoubleClick(object sender, System.EventArgs e)
{
if (VisibleBoolean)
{
ShowWindow(Handle, SW_HIDE);
VisibleBoolean = false;
}
else
{
ShowWindow(Handle, SW_RESTORE);
VisibleBoolean = true;
}
}
}
}
Help
|
|
|
|
|
Handle is declared (without your knowledge). It's a property of this (the Form ).
/ravi
|
|
|
|
|
Handle is inherited from the Form class (which inherits it from the Control class). It's initialized during the construction of the Form1 object.
Congrats on being new and understanding how to use DllImport to call native functions, but there's an easier way that doesn't involve any of that. The Form class also has Hide() and Show() methods that accomplish the same thing as calling ShowWindow(...) , and it has a Visible property that is the same thing as your VisibleBoolean .
I suggest that you either read the docs on the Form[^] class or use the Visual Studio intellisense to see what functionality already exists.
|
|
|
|
|
Yep, found them... Sorry, did an internet search for hiding main window and got a lot of "It's tough" Didn't think about a hide or show method for the form. One last question... why do you (not you personnaly) not have to (or can't) include the form name when using the hide or show methods? Like this.Form1.Hide (), or this.Form1.Visdible. Beyond the obvious it seems to me that would at least be optional. I know, beginner question...
|
|
|
|
|
Form1 is the type of the object, "Form1" is the value of the Name property of the object. The Name is just a place to store a user friendly and unique identifier for an object. The programmer friendly identifier is the variable name, in this case it's this .
I'm not sure what value there would be in being able to write this.Form1.Hide() , the compiler already knows the type of the this object, and programmer must be aware of it to be using it's members.
|
|
|
|
|
"Form1" is the class name. "this" refers to a specific instance of that class, an actual object.
You must use the class name when referring to static variables of that form, and you must (or can) use the instance reference when referring to instance variables.
Trying to precede the class name with the instance reference (this.Form1) is not really meaningful, and more than a bit confusing.
The "this" keyword is optional mainly because people get tired of typing it, I think. But there are cases where it must be used. When you have a class-scope variable and a method local variable with the same name, the "this" keyword specifies the class-scope variable. Otherwise, the local-scope variable is used.
Codemonkeys don't do it at all. Too busy coding.
|
|
|
|
|
hello
i have an object A which is containing an object B0 = People ( abstract class)
class B1, B2, B3 are derived class from B0
i show my object A in a propertygrid and i want to select ( create instance) for property People with instance B1, B2 or B3
how can i do that with TypeConverter or something else
i already know make it with collection ( using an derived collection editor)
but for objects in property grid i do not
can somebody help me
thanks
|
|
|
|
|
how do i create 9 buttons on the form create on the fly?
|
|
|
|
|
That's homework kind of question. Tell us what you have tried.
|
|
|
|
|
for i = 1 to 9
form1.addComponent(new Button)
pseudocode
|
|
|
|
|
Is this C#? I think not.
जय हिंद
|
|
|
|
|
Assuming you are using Visual Studio and know how to do it with the Designer, look at the code Designer creates (it probably is in file myForm.designer.cs) and do something similar either in the form's constructor or its Load handler.
|
|
|
|
|
I have VS 2008 and have 3 different versions of SQL server running in my network. I tried a sample from the MSDN documents for finding server instances running in the network.
http://msdn.microsoft.com/en-us/library/a6t1z9x2.aspx[^]
I added
using System.Data.Sql;
to a simple starter app and a datagridview to the form. In the load event I use this code..
// Retrieve the enumerator instance and then the data.
SqlDataSourceEnumerator instance =
SqlDataSourceEnumerator.Instance;
System.Data.DataTable table = instance.GetDataSources();
dataGridView1.DataSource = table;
dataGridView1.Refresh();
when the apps runs it eventually bring back the 3 db server's PC name but the rest of the data (according to the docs should be ServerName, InstanceName, IsClustered, and Version)is not returned.
Anybody know why??
tia
rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
I have just tried your code on my system and it works as per the documentation.
I cut and pasted your code, so provided that the posted code is accurate, I cannot help. Sorry!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|