-
- Main() of C# should not be public?
by whale
- 5 Replies
- Last post
by Davin Mickelson
- On Main() and Command Line Arguments (C# Programming Guide) , there is a statement:
It (the Main method) is declared inside a class or struct. It must be static and it should not be public. (In the example above it receives the default access of private.)
In contrast, the main method of Java MUST be public. Could anybody explain why the Main method of C# should not be public
Thanks.
-
- Marquee style progress bar Works only in xp
by manjunath cv
- 1 Replies
- Last post
by Appel
- Hi i have to implement the marquee style progress bar but the progress bar
works only in windows xp... if i use it in win 2000 the same program is
not working my code looks something like below private void button1_Click(object sender, EventArgs e) { ProgressBarStart(); MyThread = new Thread(new ThreadStart(startProcess)); MyThread.Start(); } private void ProgressBarSt
-
- "this" keyword questions.
by Zlat
- 7 Replies
- Last post
by boban.s
- I have a basic question regarding "this" keyword.
I do understand that this.blah refers the current instance of an object. However, how is "this" different form
just using an object variable
SomeObject obj=new SomeObject();
obj.blah.....
this.blah....
-
- Pass a variable from C# environment to C++ under VS2005
by Kamwing
- 2 Replies
- Last post
by Kamwing
- Now, I am developing a project with C++ as library and C# as the main program under VS 2005. I am wondering how can I pass a chinese character with ascii code 0x4e00 to C++ environment I have tried to assigned an int variable to the chinese character under C#. I can sucessfully get back the int variable 0x4e00 under C++. Because the library function definition is const unsigned char *big5Bitmap
-
- PInvokeStackImbalance was detected
by tribal
- 14 Replies
- Last post
by sgowda
- Hi,
I keep getting this error when I try to run my project from the IDE.This does not happen when running the exe. The details specify that the Stack Imbalance was detected in a third party dll which I am using. How can I fix this.
Thanks,
tribal
A call to PInvoke function ThirdPartyDll!Namespace.ClassName.NativeMethods::ImageList_DrawEx' has unbalanced the stack. This is likely becaus
-
- extract resource file in c#
by Philly566196
- 6 Replies
- Last post
by Matthew Watson
- can anyone help me out with this one
im using vs c# 2005,
now i have added a file in the resource properties of my applicaion,
i want to me able to extract the file from the resource to a desternation.
has anyone got any ideas on this
thanks
-
- C library .lib
by Tammt
- 2 Replies
- Last post
by Friendly Dog
- Hello,
I got a C library .lib. How can I use it in my C# application
Do I have to create DLL wrapper for this library If so, how can I do that
Thanks,
Tammy
-
- convert double[] to byte??
by graced
- 13 Replies
- Last post
by Christian Liensberger - MSP
- is this possible i need to convert an array of double to byte so that i can put it in a database.. thank you!
-
- sign an application which uses unsigned activeX!!!
by ashk1860
- 7 Replies
- Last post
by ashk1860
- hi
I have an application which uses DsoFramer ActiveX. this activeX doesn't have a strong name. and I want to sign my application with strong name. and of course it's not possible because all the assemblies have to have strong name.
I have the source for this activeX developed by C++ and I have signed it with strong name but when I debug I am not able to find the dll file "AxInterop.DSO
-
- numbering rows!!
by Umesh_karthy_41cdd8
- 12 Replies
- Last post
by Figo Fei - MSFT
- hi my application uses a datagrid. i generate rows dynamically as per my requirment and add values to them. is there any means by that i can name or number the row sequentially i.e., rows 0,1,2... and so on. this is the code snippet where i generate the rows and add it to the tables. for(int i = 0; i < x; i++) { newRow1 = table.NewRow(); rowCount++; // Add the row to the
-
- C# tooltips work only when app launched from Visual Studio Debugger
by mark aoki
- 4 Replies
- Last post
by mark aoki
- Basically, thats it. I have tool tips set on various controls and the tips work as advertised as long as Im running under the debugger (F5).
Running under the IDE without the debugger (ctrl-F5) shows no tooltips.
Building release & debug: both show no tooltips. Executed on another machine no tooltips.
SPY shows WM_MOUSEHOVER being received by the controls.
Do I ship my app with
-
- Top Rated February 2007
by Charlie Calvert MSFT
- 0 Replies
- Last post
by Charlie Calvert MSFT
- C# Top Rated Contributors for February, 2007
Here are the top rated contributors for November, 2006. Microsoft employees are not counted in this summary.
It is important to remember that all the contributors to this forum who answer questions are valued and appreciated. Some who answer a smaller volume of messages may still make a big difference by answering difficult questions, or by being
-
- Passing structure of type _RemotableHandle to map HWND in unmanaged DLL
by VarunD
- 2 Replies
- Last post
by Akshya
- Hi All,
I have a function in my COM dll where in it expects paramter of type HWND.
I am interoping the COM dll in my windows C# application to make use of the method
The question how should I pass the My C# application window handle to C++ COM API
I am trying to do like this , but it is not working as expected, any ideas where I am wrong
MyLi
-
- Generic methods and overloads
by Chris Lively
- 6 Replies
- Last post
by Nimrand
- I want to have a generic method call a more specific one. See below:
public class HandleIt {
public String Process( AlternateClass obj)
{
return "In Alternate Class Processor";
}
public String Process( FirstClass obj)
{
return "In First Class Processor";
}
public String ProcessController<T>(T obj)
-
- Centralizing code problem
by paulsinnema
- 14 Replies
- Last post
by paulsinnema
- Hi,
I've got some code I would like to centralize into a separate Project but am running into a CS0115 ''function' : no suitable method found to override' Error.
This is what I've done.
I Have a Project called AutoEQ and one called Library.
In the AutoEQ Project a Class from the Library is inherited.
In the AutoEQ Class an 'override' is done for the Method 'Init' of the b
-
- Public variable value becomes 0 even after assignment
by RPKJBP
- 2 Replies
- Last post
by Tharmapalan
- I have a class file (Global.cs) containing following variable: Public Int32 TotalRecords=0 I have a Windows Form from where I am assigning a value to this value as below: private void SaveRecord() { Global objGlob = new Global(); objGlob.TotalRecords=10; //Open other Form LeaveRecordForm LeaveRec = new LeaveRecordForm(); LeaveRec.Show(); } Now, in LeaveRecordForm Load I want to show th
-
- How to exchange data between multiple Projects in the same Solution
by MamaDara234
- 1 Replies
- Last post
by Chunsheng Tang - MSFT
- I have 2 Projects created under the same Solution in Visual C# 2005. Could someone please show me how to pass data between these Projects. I have defined the project dependencies and still coule not make it work. Any suggestion is highly appreciated. I am just getting to learn C#. Thanks
-
- C# interoperability
by paCHA0S
- 3 Replies
- Last post
by Greg Beech
- Hello, I am an intern for a company with a robotics SDK as one of their products. This SDK is written in native C/C++ code and is platform independent. My current task is to research and possibly implement this SDK as a DLL that can link to C#. I've found lots of basic information on DLLs and interoperability techniques (i.e. PInvoke, COM, wrapper classes, dllexports/dllimports). And I've even bee
-
- Make end of statement ";" optional?
by Daticus
- 14 Replies
- Last post
by ShellShock
- I think microsoft should make the end of line statement, (i.e. the ";") optional. If you program VB.net like I do and is inevitably forced to write/read C# code, having to write the ; after each statement is annoying. I know C/C++/java etc all have it but in an enviroment like Visual studio where the IDE makes life so much easier the end of line statement is unnecessary. Who agrees with
-
- Safe way to remove objects in a list?
by Lostlogic
- 3 Replies
- Last post
by Lostlogic
- I have a game where you can shoot enemy ships with your own ship's weapons. During the update cycle I calculate the collisions and deduct health from the ships you hit. If a ship's health drops to zero it sets an internal flag Sunk to equal 1. After the collision routine is done for every ship I then iterate through the list again and look for any ships that are dead and should be removed from the
-
- System.NotSupportedException thrown when using BeginInvoke in event handler.
by NozFx
- 3 Replies
- Last post
by NozFx
- Hi All,
I don't know if anyone could help with this one Basically I am writing a .NETCF2.0 app that uses the PocketOutlook Interception class to intercept SMS messages. This application binds to the MessageRecieved event in order to process a message. I wanted this processing to happen acynchronously so I decided to use delegates to help me achieve this. Now, i've never done this before and have
-
- Converting from double to string in fraction format
by Michael A. Riley
- 3 Replies
- Last post
by Michael A. Riley
- I need to convert a double to a string that represents the double as a fraction, to the nearest 1/16th. Some examples are: 0.0625 --> "1/16" 1.875 --> "1 7/8" 1.5 --> "1 1/2" Is there a class that helps with this conversion Thanks, Mike
-
- how can I call a procedure stored in a form from a fifferent form?
by Jassim Rahma
- 6 Replies
- Last post
by mr_super_genius
- I have this procedure in patient_dashborad:
public void get_visits()
{
this .Cursor = Cursors .WaitCursor;
data_table = new DataTable ();
sql_connection = new SqlConnection ( "Data Source=.\\SQLEXPRESS;initial catalog=shefa;integrated security=true" );
sql_command = new SqlCommand ( "sp_get_patient_visits" , sql_connection);
sql_command.CommandType = CommandTyp
-
- not updating from DataSet to DB....
by MSP.Saami
- 1 Replies
- Last post
by Perumal.R
- hai, I was trying to add a record to a DataSet and then updating the DataSet thru DataAdapter, but I constantly get the error as
Additional information: Update requires a valid InsertCommand when passed DataRow collection with new rows.
I had attached the code here, anyone pls could you solve this...Is my program logic correct or else give me a sample code....
thanx.....
using System;
-
- Help with "Static member error in catch"
by Trubble
- 4 Replies
- Last post
by Trubble
- Could someone please explain the reason I am getting the following error please
Error 3 Static member 'System.Diagnostics.EventLog.WriteEntry(string, string)' cannot be accessed with an instance reference; qualify it with a type name instead G:\HelloWorldService\HelloWorldService\SimpleService.cs 81 17 HelloWorldService
using System;
using System.ServiceProcess;
using System.