|
Have you instatiated it
i.e
Form frmLogin = new FormLogin(); //whatever you have called the new form
frmLogin.Show();
|
|
|
|
|
I am looking for some documents/whitepapers/whatever that would point to good coding conventions for ASP.NET/C# forms development. If anyone has some tips or pointers, that would be much appreciated as well.
Thanks in Advance
The Yellow Dart
|
|
|
|
|
The book 'Code Complete' has some good general suggestions. Beyond that, perhaps have a look through some online samples and see what conventions are used, and familiarise yourself with the general .NET conventions ( for example, if you want to write CLR compliant code, don't rely on case for variable names, as the CLR can't do that, because of VB.NET ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I know this is not the first time this question has been asked, but I need help playing MP3 audio in my C# application. I know the obvious route would be to use the Windows Media control, but I can't figure out how to add it to my program because Microsoft's instructions assume that I'm using Visual Studio, which I am not. Anyone know how I can add it to my program using SharpDevelop, or another possible route? Keep in mind that I'm a beginner with C#.
|
|
|
|
|
Basically, to play MP3's, you'll need COM interop, be it WMP or something else. Sharp Develop doesn't allow you to import COM objects ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
It probably does. I dunno how though.
|
|
|
|
|
I am trying to compare the user names of people using my webform to a group of users that the networking guy has already created in ADS so that I do not have to hard code in names. I am not sure how to go about doing this, if it can even be done, or what type of items to search for. Any help would be greatly appreciated
Scott Moore
|
|
|
|
|
Hi
I have write a web proxy server using c# but the follwing senario occure.
when we try to send a request to the internet the network performance is very low even though ,there are many requests pended to the internet.
Now .
if this problem in the C# socket strcture ,or in the options of the socket .
plz any help.
thanx in advance.
On Earth nothing impossible,
while your mind running.
Faroqtam
|
|
|
|
|
It's nearly impossible to say without seeing some code. Sockets can perform virtually as well in C# & managed code as they do in the unmanaged world, so I can say with certainty that it's not the DotNet framework that's slow here.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: The Secular Left, the Religious Right, and Prejudice
Judah Himango
|
|
|
|
|
hello,
how can I compare two HTML files and know if there text contents has changed and highlight the changes.
|
|
|
|
|
That's a multi-part question that I won't answer in a single post. You can compare text using string.Compare, string.CompareOrdinal, or use some of the regular expression methods found in System.Text.RegularExpressions.RegEx class. That will tell you what's different. From there, you'd have to provide more information as to what you're trying to highlight, what control you're using to highlight, whether you're using Windows Forms or Web Forms, what problems you're having, etc.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: The Secular Left, the Religious Right, and Prejudice
Judah Himango
|
|
|
|
|
Hi, how can I get the datatype size of DataColumn
I get the Datatable from Sql server database table. I this table I have an varchar(20) datatype column, but how can I get 20 size value of this varchar datatype in the System.Data.Datatable
I can get only the dataype (Varchar) without size (20)?
Thank you!
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
hi
You can get size of the text columns using executing this SQL
"SELECT Column_name,character_maximum_length
FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME = 'tblemployee'
"
sometimes may have better way to get column sise..
|
|
|
|
|
There´s no way to know it by the ADO.NET DataColumn or DataTable or Dataset information?
How can I prevent to write more chars than sql column let in a ADO .NET DataColumn of DataTable.
Thank for your suggestion.
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
I am slowly going nuts trying to make this work.
I can compile the CADIO.dll in Visual Studio 2003, and have the exported functions list (from http://www.codeproject.com/library/cadlib.asp).
I am trying to call the DLL using the sample code as below
___________________________________________________________________________
namespace BC_Imager
{
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Runtime.InteropServices;
public class FormDXF : System.Windows.Forms.Form
{
[DllImport("CadIO.dll")]
static extern bool drvCreate(string filename,bool overwrite);
}
}
____________________________________________________________________________
but having problems getting my head around how to use this DLL in C# to carry out the functions demonstrated in the test.cpp code.
Can anyone please give me some pointers, especially in the use in C# of window items generated in MFC (i.e the progress and output "drawing" window in this DLL)
Many Thanks for your help
Regards
|
|
|
|
|
Specifically I am trying to open a file using a call
________________________________________________________________________
string filetoget="H:\test.dxf";
[DllImport("CadIO.dll")]
static extern bool drvLoadDataFromFile(IntPtr boxhandle,IntPtr NULL, IntPtr NULL ,string filetoget);
________________________________________________________________________
But C# complains "The parameter name 'NULL' is a duplicate"
the C++ DLL Exported Interface is
BOOL drwLoadDataFromFile(
HDRAWING hDrawing, // handle to the current DRAWING structure
OBJHANDLE BlockObjhandle, // handle of block that entities must be put in it. (NULL = Entity Section)
DWORD Reserved, // reserved, must be 0
LPCTSTR strFileName // input file name (Can not be NULL)
);
Thanks in advance
|
|
|
|
|
Think I have cracked it - I needed to pass variable not constants
The code
[DllImport("CadIO.dll")]
static extern bool drvLoadDataFromFile(IntPtr boxhandle,IntPtr NULL, int nonum ,string filetoget);
compiled OK, whether it will work at runtime is another matter
|
|
|
|
|
Well for the calls
_______________________________________
[DllImport("CadIO.dll")]
static extern bool drwCreate();
[DllImport("CadIO.dll")]
static extern bool drwLoadDataFromFile(IntPtr boxhandle,int npoint,int nonum ,string filetoget);
[DllImport("CadIO.dll")]
static extern bool drwInitView(int top1,int left1, int bottom1, int right1);
[DllImport("CadIO.dll")]
static extern int drwPaint(IntPtr boxhandle);
___________________________________________________
And calling it with
____________________________________________________
private void button1_Click(object sender, System.EventArgs e)
{
bool step1=drwCreate();
bool step2=drwLoadDataFromFile(dxfBox.Handle, 0 ,0,"H:\test.dxf");
bool step3=drwInitView(1,1,200,300);
}
__________________________________________________________
worked OK for step 1 -drwCreate() but returned false (no exceptions though)
but returned faklse for steps 2 & 3
|
|
|
|
|
This is an old code, but did you get the CadIO.dll to work with C#. I am trying now and any help would be appreciated.
|
|
|
|
|
No - sorry - was not able to easily do this.
As this was for a work initiative I bought Cadlib from Woutware- the cost of my time was worth more that the purchase price.
Regards
|
|
|
|
|
Hi
In the following code, I am trying to compare the type of object in obj variable with type of typeInt.
int typeInt=0;
int a = 1;
object obj;
obj = (object) a;
if (typeInt.GetType() == obj.GetType())
{
MessageBox.Show("Int returned");
}
I want to make sure if this is the correct way to do it. If not, how else I compare types of two objects?
Please advice. Thanks
Pankaj
|
|
|
|
|
What exactly do you want?
1. Compare the types of two variables? If yes your solution seems good.
2. If you just want to check whether obj is of type int use the following:
if (obj.GetType() == typeof(int))
3. If you want to check if obj can be casted to some special type:
if (obj is int)
|
|
|
|
|
Hi all,
This may be a very easy or a basic doubt, but I am really struggling with this over some time. I am new to the Microsoft Visual Editor, C Sharp and stuff like this. Comming to my problem, I have a weird problem of the program running neatly when I run from the Editor, but show some errors while I run from the command line.
I have a project which accesses the methods of another project. I added the reference, the .dll file, also did the 'using' 'Namespace' of the other project. It excecutes properly and the application starts in the editor, but when I do it from the command line, it says
Form1.cs(13,7): error CS0246: The type or namespace name 'StaticServer' could not be found (are you missing a using directive or an assembly reference?)
where 'StaticServer' is the namespace.
which is not there when I run it from the editor. Do I ahve to do something inaddition when I run frm the command line like build the other project first and things like that?
Kindly help.
Sowmya Mulukutla,
UAB
|
|
|
|
|
How are you compiling it from the command line? Are you using the makefile generated by Visual Studio or are you directly using the C# compiler?
If you are using the C# compiler, you need to use the /r switch to refer to the dll(s) which you added as a reference in Visual Studio.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi Senthil,
Thank You very much. I am using the C# Compiler.
As you said "If you are using the C# compiler, you need to use the /r switch to refer to the dll(s) which you added as a reference in Visual Studio."
What does the /r mean? And how and where can I refer to the dll of the added reference in the Visual Studio? Do you mean, I have to add the reference at the command line also, using this /r switch? If so, can you please tell me where I can get more tutorial on this, or if you could be generous enough to take some time off to elucidate this concept.
Thank You,
Sowmya Mulukutla,
UAB
|
|
|
|