|
Hi,
Does anyone know how to add all the namespaces in "System" to a dropdownlist
EG:
System.Data
System.IO
System.Text
- I want all these names to display in a dropdownlist.
|
|
|
|
|
Write them all out, Ctrl + C, Ctrl + V,
or modify you default C# template
|
|
|
|
|
leppie wrote: Write them all out, Ctrl + C, Ctrl + V,
OK, if you have enough time, why dont u do it for me?
I need to add it dynamically, as the application does not stop there.
|
|
|
|
|
playout wrote: why dont u do it for me?
He probably will, if you pay enough
playout wrote: I need to add it dynamically
This won't be easy. The only way I can think of is using reflection to iterate over all types declared in your and all referenced assembly, retrive their namespace and add it to the list if it isn't present yet. Of course this will lnly give you the namespaces of types declared or referenced by your app. So maybe the copy-and-paste thing isn't that bad.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi everybody !!!
My app have a module : Search Infos in Text File
+ Insert Text File to Database
+ Search strings in Text File
I need some code to build app, thanks !!!
-- modified at 9:05 Monday 2nd October, 2006
|
|
|
|
|
Hi guys
Where do I find a list of database error type exceptions for SQLServer 2005? I'll know when its a database error a and log it in the eventviewer and send an email. I just want to distinguish between database errors and any other error.
thanks
|
|
|
|
|
honeyman_can wrote: Where do I find a list of database error type exceptions for SQLServer 2005?
Ask the database itself: select * from sysmessages
|
|
|
|
|
Hi,
I can current move the cursor to the position by doing in a c# application:
Cursor.Position = new Point(Cursor.Position.X - 0, Cursor.Position.Y - 80);
However, if i run the above codes in a C application, it will give errors. I am developing a C application which is compile and run by using visual studio.net 2005, i cannot add the "using System.Windows.Forms;" to the C application too.
Is there any other method they can perform the above cursor.position function in a C application?
A short sample of the coding:
#include "cv.h"
#include "highgui.h"
#include <ctype.h>
#ifdef _EiC
#define WIN32
#endif
using namespace System::Windows::Forms; <--- when i try to add the namespace, the program have alot of error upon compilation
static CvMemStorage* storage = 0;
static CvHaarClassifierCascade* cascade = 0;
void detect_and_draw( IplImage* image );
Errors Encounter:
error C2061: syntax error : identifier 'namespace'
error C2143: syntax error : ';'
error C2143: syntax error : missing '{' before ':'
error C2059: syntax error: ':'
I can't figure out the problems behind. Can anyone help?
Thanks
Jas
|
|
|
|
|
You can't use C# code in a C program.
You can either wrap your C code into a dll and call it via DllImport from the C# project, or you might want to use C++/CLI.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi,
The C program is the main executable file, the codes in c# is the function i would like to call. Can i compile the C# into a dll and use it in the C program?
As i have not use the VC++.net before, do you have any idea whats the difference between the MFC, Win 32 or window Form. I wish to build a GUI, and some of my frds mention that i can use the MFC as it has the auto drag and drop toolbox, but i found out recently that VC++ window form also has this properties.
Sorry for the trouble
thanks alot
jas
|
|
|
|
|
Cassiopeiaxy wrote:
The C program is the main executable file, the codes in c# is the function i would like to call. Can i compile the C# into a dll and use it in the C program?
You can compile the C# classes into a DLL, but you won't be able to call the DLL from your C program.
It's a bit difficult, you might need to create a wrapper DLL written in C++/CLI that will convert your C# calls into C++/CLI ones. It'S a bit more involved, though, check out this article
Cassiopeiaxy wrote: As i have not use the VC++.net before, do you have any idea whats the difference between the MFC, Win 32 or window Form.
Win32 - the oldest C++ sindowing API for Windows, pretty complicated to create complex windows
MFC - Makes it easier to work with the Win32 API, you can drag-drop your windows with a designer in VC++
Windows.Forms - the new .NET approach, requires the .NET framework. Makes it very easy to create windows with the designer of VS .NET
You have two choices:
a) you still program in C++ and don't want the .NET framework: use MFC
b) you program in .NET: use Windows.Forms
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
if you want to set cursor position on C++ you can use SetCursorPos
|
|
|
|
|
Hi,
I find out that we can use the user32.dll to control the cursor. Do you
happen to know the difference between using the user32.dll and ::Cursor::Position?
Do you think it is easier if i convert my c coding to c++ using the ::Cursor::Position or should i try to use the user32.dll with the c coding?
I try to create a new C++ file with the following codes:
SAMPLE CODING:
#pragma once
namespace yg {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
///
/// Clean up any resources being used.
///
~Form1()
{
if (components)
{
delete components;
}
}
private:
///
/// Required designer variable.
///
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
void InitializeComponent(void)
{
this->components = gcnew System::ComponentModel::Container();
this->Size = System::Drawing::Size(300,300);
this->Text = L"Form1";
this->Padding = System::Windows::Forms::Padding(0);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
}
#pragma endregion
};
void MoveCursor()
{
::Cursor::Position = Point(::Cursor::Position.X - 50,::Cursor::Position.Y - 50);
}
}
Errors Encountered:
error C3083: 'Cursor': the symbol to the left of a '::' must be a type c:\projects\yp\yg\yg\Form1.h 70
error C2039: 'Position' : is not a member of '`global namespace'' c:\projects\yp\yg\yg\Form1.h 70
error C2065: 'Position' : undeclared identifier c:\projects\yp\yg\yg\Form1.h 70
error C3083: 'Cursor': the symbol to the left of a '::' must be a type c:\projects\yp\yg\yg\Form1.h 70
error C2228: left of '.X' must have class/struct/union c:\projects\yp\yg\yg\Form1.h 70
error C3083: 'Cursor': the symbol to the left of a '::' must be a type c:\projects\yp\yg\yg\Form1.h 70
error C2228: left of '.Y' must have class/struct/union c:\projects\yp\yg\yg\Form1.h 70
Sorry for the trouble
Thanks alot
Jas
|
|
|
|
|
What happens if you run this code
<br />
Cursor::Position = Point(Cursor::Position.X - 50,Cursor::Position.Y - 50);<br />
|
|
|
|
|
Good afternoon.
How to unload data in the called fields? (i.e. cells we set to it a symbolical name (Insert-> Name->Create in Excel) to not become attached to concrete numbers of lines and columns)
or
In what it is better to create reports? So that the user could change names in caps of tables and other static information.. In patterns it (is desirable)
Thanks.
|
|
|
|
|
Hi everyone. Iam currently building a application for a smart pc handheld unit and uses the following techniques.
x SQL Server 2005 Mobile Edtion
X Microsoft .Net Compaqt Framework
X Visual Studio 2005 Ent, C#
I have now reached a critical stage in my project were I want to read the data from the database to a excel document, this document should thereafter be easialy transported to another computer using ActiveSync. It should also be possible to edit the excel document and then get it to update the sql mobile database on the handheld device.
Or does anyone have another way to solve this problem, or have done anything like this before.
Thanks in advacne and have a wonderful day.
|
|
|
|
|
this is a tricky one: How do i read registry key values and how do i modify them or create a new one?
rzvme
|
|
|
|
|
Take a look at the Registry and related classes.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
|
Hi all,
I am creating xml and i have a stylesheet and i create a html document when these two are combined. Is it possible to print this HTML document through C#?
Thank you in advance...
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Hi,
In my C# Windows form, I have a datagridview where datagridview is bounded to a databinding source.
Now, when I have no rows in the gridview, there a single * marked row always there to allow user to ADD a new row. Now If I just click the DELETE button of the binding navigator, I get this error
Error : "current item cannot be removed from the list because there is no current item."
I have no way to handle this exception as the Delete button of binding navigator has no predelete event rather it has click event and this event occurs after the row is deleted.
Is there nay idea how can I handle this error ?
Thanks.
|
|
|
|
|
I believe you MIGHT be able to do it by taking three steps:
1) mark your form for KeyPreview=true;
2) Implement the KeyPress event handler on the form
3) If your grid has focus, and rows.Count.Equals(0), the set Handled=true;
|
|
|
|
|
How to play a sound from my program?
I need help.
Vasildb
|
|
|
|
|
|
Read the documentation for the System.Media namespace and search the CodeProject articles for "play audio". You will find everything you need.
____________________________________
There is no proof for this sentence.
|
|
|
|