|
Create several classes (or a single one, with all the features you need) which implement IComparer. When you call Array.Sort, pass an instance of this class as the second parameter.
Yes, even I am blogging now!
|
|
|
|
|
I keep getting the error:
dllnotfoundexception: unable to load DLL "getString.dll"
please help me
I wrote a simple DLL in Borland C++ Builder 3 as following
getString.dll
char* tmp="Welcome";
extern "C" __declspec(dllexport) String getST();
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
{
return 1;
}
String getST() {
return tmp;
}
now i wanna use that dll file. I copy the file over to my C# project\Debug folder (because i run it with debug mode)
[DllImport("getString.dll", ExactSpelling = true, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
public static extern string getST();
public MainWin()
{
InitializeComponent();
try
{
this.Text = getST(); //<--- here
}
catch (DllNotFoundException e)
{
MessageBox.Show(e.ToString(), "error");
}
Elapid For The Win
|
|
|
|
|
Strange, I just did the same thing and it works for me.
[EDIT]
On second thought, I am not aware of how Borland handles their data type String. This is what my sample C++ code looked like:
#include "stdafx.h"
char* name = "Nick";
extern "C" __declspec(dllexport) char* getName();
BOOL APIENTRY DllMain(HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved)
{
return TRUE;
}
char* getName()
{
return name;
}
I realize your having a problem find the actual .dll itself, but I just wanted to note the difference.
[/EDIT]
- Nick Parker My Blog | My Articles
|
|
|
|
|
actually I found out what the problem was..
I didnt get the name right.. becaus when i compile it, it added a _ infront of the function's name.
Thanks Nick
|
|
|
|
|
Hi, I'd like to Start an application minimized, but it doesn't seem to work...
I override my Form's Load event and add in it:
Hide();<br />
WindowState = FormWindowState.Minimized;
What should I do instead of this?
Thanks!
|
|
|
|
|
Try to make initialization in the constructor. Mine works like that.
Why do you use hide?
|
|
|
|
|
Ok thanks...!
I used hide to remove the app from the taskbar so there would only be my NotifyIcon in the icon tray. However, I have to use the Hide() in the Load method.
|
|
|
|
|
This works for me
public Form1()
{
InitializeComponent();
this.WindowState = FormWindowState.Minimized;
}
|
|
|
|
|
Plz help me~ How do i write the code , when i click on a cmdButton it will create a pictureBox and the pictureBox will start moving. The more i click on the cmdButton the more pictureBox that move will be created.
|
|
|
|
|
Set the Visible property of your PictureBox to false. When you click your button you can check to see if the PictureBox is visible, if not, set it to true. You can move the PictureBox by settings it's Location property, which itself is just a Point .
- Nick Parker My Blog | My Articles
|
|
|
|
|
but how to create a pictureBox when i click the cmdButton, like if i click 20 times 20 pictureBox will be created and start moving.
|
|
|
|
|
DrownFish45 wrote:
but how to create a pictureBox when i click the cmdButton, like if i click 20 times 20 pictureBox will be created and start moving.
No, you aren't going to create the PictureBox within the click event handler of the button, just check to see if it's already visible. An example:
class test : System.Windows.Forms.Form
{
private PictureBox pb;
private Button b;
public test()
{
pb = new PictureBox();
pb.Visible = false;
b = new Button();
b.Text = "Click Me";
b.Click += new EventHandler(bClick);
this.Controls.Add(pb);
this.Controls.Add(b);
}
public static void Main()
{
Application.Run(new test());
}
private void bClick(object sender, EventArgs e)
{
if(!pb.Visible)
pb.Visible = true;
}
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
^^ it work thanks alot , but theres the limit on the number of picture can be display,
erm i got another question , is there away to put this method in a thread, so i don't need to put it in a timer which is making the program very lag.
public void WestCarOutOfScope()
{
if(picWest2NCar.Location.Y == 0)
{
picWest2NCar.Left = picWest2NCar.Left -260;
picWest2NCar.Top = picWest2NCar.Top +210;
picWest2NCar.Visible = false; picWest2NCar.Image.RotateFlip(System.Drawing.RotateFlipType.Rotate90FlipNone);
picWest2NCar.Refresh();
}
}
|
|
|
|
|
Hello!
I'm not really sure if this is the right place to post this, but i couldn't find any other suiting place eighter so..
Are there any RPG interested people still out there? I've been thinking for some time to start on a new project, a codebase for a new kind of muds (atleast from what i know it's not been done before.. if anybody knows of it, please tell).. the new part would be how it is displayed, it would look similar to ADOM (www.adom.de) or MAngband (www.mangband.org) but with a persistent world beneath.. it's a bit hard to explain in a short post. I'm not sure if it's posible to run it over telnet, it might need a client and it's own protocol.. preferably it would be coded in c#/.net (both server/client). I've been coding for quite some time before, but not much C#/.NET so if anyone feel like giving this a try i would be glad for all kind of help i could get. Just drop me an email or reply to this if you have any more questions!
|
|
|
|
|
so your telling us that you want to make a Online-RPG?, well lets see if you can make a console or a form rpg that connects to a main server through the internet and how well you can handle that problem, once you have done it, then you should get used to graphics programming with c#, dunno though since the only graphics api i used was dx with c++ which i like alot since there is unlimited flexibility
IM PROUD TO BE A GMAIL;
|
|
|
|
|
How can I get an internet page, set its textboxes (fields) programatically and simulate a click event on its submit button (or programatically submit it). I know I could achieve the same effect by posting data directly, but I need to present the page to the user first.
Any ideas?
Thanks!
Sammy
"A good friend, is like a good book: the inside is better than the cover..."
|
|
|
|
|
I believe there is an article here on CP that covers this, check here[^]. Also, this has been answered many times in the past here in the C# forum, I would suggest that you search here[^] through the C# forum as you might find you answer here. Obviously this all depends on how you wish to implement it, more information would be helpful if the two searches above do not provide what you are lookoing for. HTH.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Please I need help in follow problem.
I have in my database Table Customer with info like CustomerID Customer,Name,Tel...etc. I extract all this in one Dataset.
I have one User Control where in one DataGrid Keep the Customer Name and the rest of info it's showing in TextBox.
I'd like to binding the Name from GridTable with the rest info from TextBox.
If I "Click" on Customer Name in dataGrid Table the TextBoxs I like to fill automatic with the rest info about Customer.
In Visual Basic6.0 is very easy just bibding the column table and textBox to database table fields.
But I need help to do this in C# in .Net. My database is in Acces.
Mybe is easy..bu for the moment "I'm blind"
Thank you for any sugestions or advices
Regards
Victor
|
|
|
|
|
The default implementation of a tab page is to include the code for it in the form/class that contains the actual tab control. However I have subclassed the TabPage class and put my code into this class and then include this as a new tab page into the tab control. However, since tabpage does not inherit from ContainerControl I can not use the ErrorProvider control without making my controls public or exposed via a property and fire an event to the class containing the tab control. This class then calls SetError on the ErrorProvider with the information from the event.
Has anyone done anything like this and found a better way to implement the ErrorProvider?
|
|
|
|
|
I am building a windows application in which I add users to the active directory.
In the normal active directory users and computers mmc (with exchange features plug-in installed), there is a posibility to add custom extended attributes (extensionAttribute1-15) under the exchange tab in user properties. Is it possible to enumerate these values through my application?
|
|
|
|
|
AFAIK it should work the same way as setting all the other attributes ie if you are using .NET use DirectoryEntry.Properties to read write them.
|
|
|
|
|
can someone suggest some good book(s) on C# and .NET?
Thanks!
|
|
|
|
|
It depends greatly on your level of experience and what kind of programming you wish to do, but here are a few of the better ones I've found:
Applied Microsoft .NET Framework Programming[^] by Jeffrey Richter
Programming .NET Components[^] by Juval Lowy
Programming C#[^], by Jesse Liberty
Programming Windows with C#[^] by Charles Petzold
There are others, such as Debugging Applications for Microsoft .NET and Microsoft Windows[^] by John Robbins, that have a lot of valuable information, but also include a good deal of non-.NET focused material, so not all of it will apply.
Like I said, though, it depends on what you're after, so if you want to write Donkey Kong.NET, you may want to look elsewhere.
Charlie
if(!curlies){ return; }
|
|
|
|
|
|
These books gave me a great start:
Applied .NET framework programming - Jeffrey Richter
Inside C# - Tom Archer
Professional C# - Wrox
Also frequents CP visits help honing your skills further. Especially posting your code and letting people dissect it ruthlessly...
Salil Khedkar [^]
|
|
|
|