|
HahnTech wrote: How do you compile to a library in C#
Create a class library project and just compile it
HahnTech wrote: or how can i bring a DLL into the final exe so I don't have to install the dll.
copy the code over from the DLL to your form.
This is ugly, the better way is:
HahnTech wrote: I'd like a library to link from but don't know how to make it.
Add a reference to your DLL from your form.
In the solution explorer there a folder called "References". You can there rightclick, "Add Reference" -> "Browse" -> select your DLL
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I can make a DLL by using the create a class library project. And i can add a made dll as a reference into a new project but then i have to push the dll with the exe all the time. In C++ i can compile to a *.lib and tell the linker where the lib file is and it will compile the code from the lib into the exe and i don't need to push the lib all over the place. Is that possible in C#?
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
|
Yes I am!
Thank you!
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
I want to hide my Windows Application in System Tray on minimizing. How can I do that? The user may be able to maximize the Application on clicking the icon in System tray. Please give me suggestion of how to do that?
Thanks,
Sandeep S. Sekhon
|
|
|
|
|
Some threads below you find a description how to capture the minimizing of your form. Then you only need to call Form.Hide , set Form.ShowInTaskBar false and call Show of a NotifyIcon component dropped on your form at design time. To show your app again register to the NotifyIcon.Click event and reverse the steps described above.
"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
|
|
|
|
|
Hello
Is there bidirectional iterator(it is desirable for generics) in C#? (May be third party implementation).
Andriy
|
|
|
|
|
There isn't one that I can recall, however, it is relatively easy to make one using the yield keyword in 2.0
only two letters away from being an asset
|
|
|
|
|
Mark, thank you for advice. I think you've meant smth like this:
public IEnumerator<t> GetEnumerator() {
if (left != null) foreach (T x in left) yield x;
yield value;
if (right != null) foreach (T x in right) yield x;
}
But I need calling "MoveNext" and "MovePrevious" in arbitrary order e.g.: "MoveNext", "MoveNext", "MoveNext", "MovePrevious", "MoveNext", "MoveNext".
If you know how to implement discribed behaviour using "yield" please write small code snippet. I haven't found how to do it after investigating C# Specification describing "yield".
I think possible solution can be wrapping LinkedList.
What do you think about this?
|
|
|
|
|
|
Mark, but this sample likes code snippet I've sent you in previous post. It doesn't fit for my task. Because I need calling several "MoveNext" in the side of "Top" not reaching the last element and then call "MovePrevious"(IEnumerator doesn't contain it at all). How can you do it using sample you've sent?
|
|
|
|
|
Sometimes you need to do more than cut & paste. You have all the tools necessary to create what you are asking for. Right, IEnumerator does not have a MovePrevious method, so create one.
only two letters away from being an asset
|
|
|
|
|
Hello
I don't know why you are making things compicated for yourself?? Random access collections work fine in most scenarios!! If you don't want to wrapp an iterator to implement what you need, well, here is a simple - poor pratice- way to simulate what you need.
1- Make a private random access collection. eg. ArrayList
2- Make a private integer to store the current index
3- Make a public object of the type you want to store in the ArayList.
4- Make to public methods MoveNext() , MoveBack() , to increase/decrease the CurrentIndex and store MyIterator[CurrentIndex] in ther public object you created.
Regards
|
|
|
|
|
Thank you, this is what I am about to implement. I've just hoped that there is already implemented bidirectional up-to-date for changes iterator.
|
|
|
|
|
Hello,
I am trying to implement drag within my shell namespace extension. I noticed that in MFC you are able to set up a message area to attach to the events such as OnBeginDrag.
My question is; How do I attach to those events using c#?
Thank you,
Rick
Rick
Rick
|
|
|
|
|
They hide that information in the Documentation[^]
"Alot of the people on this forum are incredibly stupid, thinking that the internet is real" Score: 1.0 in the Soap Box
led mike
|
|
|
|
|
Yes,
I get that part about the event, but How do i attach to an event that is sent by the windows shell.
Rick
|
|
|
|
|
Rick, with a little Googling i found this CodeProject Article[^] maybe it will help
"Alot of the people on this forum are incredibly stupid, thinking that the internet is real" Score: 1.0 in the Soap Box
led mike
|
|
|
|
|
hi,
i would like to make a serial communication with an antenna to send and recieve data from another antenna, the first one is connected on a com port of my pc. i program it in visual studio 2003
but i dont know how to start
does anybody know a site with samples that could help me?
thxx
|
|
|
|
|
serial communications are much easier using the provided System.Ports.Serial class in VS05. IF you're unable to use the (free) express edition of 05, there are several user written libraries available on this site if you use the search function.
|
|
|
|
|
Hello
To access any port -Serial, LPT, USB, etc...- or device -eg. modem- in C3 you follow these steps:
1- Call Windows API CreateFile() function with the device name as the filename. ie. CreateFile("COM1") for example.
2- Get The handle of the created file.
3- Supply that handle to the constructor of a FileStream object.
4- Use that FileStream object to read and write from/to the port/device.
And no, you can't construct a FileStream from the port directly. Sorry!
Regards
|
|
|
|
|
I'm trying to open a database connection via my app.config file however my connection string keeps coming back as NULL.
Here's my app.config file:
----------------------------------
<connectionStrings>
<add name="DBConn" connectionString="Data Source = myDataSource;Initial Catalog = catalogName;User Id =myUserId;Password = myPword;"
providerName="System.Data.SqlClient"/>
</connectionStrings>
-------------------------------------
Here's the code I'm using to open my connection. The "settings" variable keeps coming back as null:
---------------------------------------
string cnString = null;
// Look for the name in the connectionStrings section.
ConnectionStringSettings settings =
ConfigurationManager.ConnectionStrings["DBConn"];
// If found, return the connection string.
if (settings != null)
cnString = settings.ConnectionString;
connection = new SqlConnection(cnString);
connection.Open();
------------------------------------------------
Do I perhaps have my app.config in the wrong location? I placed it in the root directory of my project (located alongside my project and ".cs" file).
Thanks in advance.
-Goalie35
|
|
|
|
|
Looks ok to me!
Have you got the <connectionStrings> under <configuration> (where it should be) and not in the app settings or something like that?
Regards,
Rob Philpott.
|
|
|
|
|
Hi Rob. Thanks for replying.
My full app.config looks like the following:
-------------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="ReportDBConn"
connectionString="Data Source = myConnectionString;Initial Catalog = catalogName;User Id =myuserId;Password = myPword;"
providerName="System.Data.SqlClient"/>
</connectionStrings>
</configuration>
---------------------------------------------------
Thanks again.
-Goalie35
|
|
|
|
|
Are you able to see <yourexename>.app.config in the bin/Debug (or Release) directory? Did you add your app.config manually or through the Add Items menu in VS .NET? If it's the former, then VS .NET doesn't generate exename.app.config automatically.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|