|
I have develop a Windows library ,i want to know how to make it into dll and how can i use this dll in other application in >net environment.
Plzz reply soon
|
|
|
|
|
See Here[^]
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Your project type is Class library, right? When you compile it, you should be getting a .DLL file. Add it as a reference in your new project and you can use the types in your DLL.
Please read Chris Maunder's How to get an answer to your question above.
Cheers,
Vıkram.
Déjà moo - The feeling that you've seen this bull before.
Join the CP group at NationStates. Password: byalmightybob
|
|
|
|
|
Hi
I have a XML file as like below with large bumber nodes, what is the best way to parse it in terms of time...
<SCRIPT>
<ROW name='I' D='110' L='3'/>
<ROW name='D' D='111001' L='6'/>
<ROW name='I' D='11' L='2'/>
<ROW name='D' D='1' L='1'/>
etc.............
..............
...............
</SCRIPT>
|
|
|
|
|
sivaprakashshanmugam wrote: terms of time...
Developer's time, or running time?
Fro the first, System.Xml.XmlDocument. For the latter, System.Xml.XmlReader should suffice. Google or MSDN have plenty of examples how to use those.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Hi
VS2005 pro, dotnet 2.0
I want to have the complete field highlighted when the fielld gets focus.In this case the field is a masked edit box.
I call selectall() and have tried the other deriviations when the controls enter event is fired but the text is not selected. The same mechanism works well with standard text boxes.
Am I missing something or is this the default behaviour for a masked edit box.
tcss
-- modified at 6:05 Thursday 10th May, 2007
|
|
|
|
|
To clarrify a little bit more of what I have found.
If I remove the mask from the field then it allows all text to be selected
using select all. I may need to call selectAll in a an event other the onClick or on enter. Any ideas here. This is a customer request so I can not just let it slide but it currently appears impossible. The mask is ##0 to force numeric input and have a value of at least zero.
Anyone else been bitten by this.
|
|
|
|
|
hi i am currently using c#.net to do remoting
i am basically trying to make a project whereby when the client changes the values of the remotable object a function in the main class would execute.
my remotable class is in a class library
i am currently trying to make one of the remotable class object call one of the main class's function
so far all my attempts fail:
i tryed using delegate <==cant as the classes not same file the remotable class dont regconize some of the classes
event handler <== cant as some error keep coming up asking me to serialize the class and when i serialise the class another error pop's up saying that the security is not there to deserialise.
PLEASE HELP ME I AM DESPO
codes i have so far:<br />
static void Main(string[] args)<br />
{<br />
HttpChannel channel = new HttpChannel(8080);<br />
ChannelServices.RegisterChannel(channel, false);<br />
<br />
RemotingConfiguration.RegisterWellKnownServiceType(<br />
typeof(MyRemoteType),<br />
"MyRemoteObject",<br />
WellKnownObjectMode.Singleton);<br />
<br />
MyRemoteType MyRemoteClass = (MyRemoteType)Activator.GetObject(<br />
typeof(MyRemoteType),<br />
"http://localhost:8080/MyRemoteObject");<br />
MyRemoteClass.setsvalue("hihi");<br />
Console.WriteLine(MyRemoteClass.returnstring());<br />
<br />
<br />
<br />
Console.WriteLine("Press enter to stop this process.");<br />
Console.ReadLine();
|
|
|
|
|
my project have some function,but after one function,i must close the program and debug it again then can run the other function.my teacher ask me to add a button, then user finished one function,click this button,the program like refresh then can use the other one.
my question is how to restart the program?hope u can understand what i mean.
thank you.
|
|
|
|
|
Hello,
I would assume that you have to build a second update project wich is started (Process.Start) by your main programm (button click).
After you started the update programm you can Exit the main programm.
Your update program does whatever it should do and restarts the main program again.
Be aware that you have to set the "WorkingDirectory" of your Updateprogramm process explicite, because default would be the mainprogram directory, and then you have problems if you have to delet, move, ... files from the main program.
All the best,
Martin
|
|
|
|
|
Martin ,thanks a lot for u r reply...but i still a little confused about this function...sorry
|
|
|
|
|
So tell us what confusses you!
|
|
|
|
|
System.Windows.Forms.Application.Restart();
|
|
|
|
|
Hey guys thanks for helping, I have the following:
* a main form, mainForm (the main application)
* i have a class, myClass
* i have an auxiliary form, auxForm which displays info about a certain process (method in myClass), say downloadData().
When I make a call to downloadData() the first time, auxForm is created and showed as follows:
<br />
class myClass{<br />
AuxForm myAuxForm;<br />
<br />
downloadData()<br />
{<br />
myAuxForm = new AuxForm (this);
myAuxForm .Show();<br />
doDataLoad();<br />
}<br />
<br />
.<br />
.<br />
.<br />
}<br />
This works fine.
However, once the form has been closed, and I make another call to the above method,
I get an error:
<br />
System.ObjectDisposedException was unhandled<br />
Message="Cannot access a disposed object.\r\nObject name: 'TextBox'."<br />
Source="System.Windows.Forms"<br />
ObjectName="TextBox"<br />
Given that its a textbox on the (closed) form causing the problem, it seems that the object myAuxForm, even though closed/disposed, is not reset to null.
(I have tried doing a if(myAuxForm == null) test before instantiating it again, but with no success).
If anyone has advice on how to get around this problem, it would be much appreciated!
For reference, here is the myAuxForm's code (actually called PriceUpdateForm):
<br />
partial class PriceUpdateForm : Form<br />
{<br />
delegate void OutputDisplayCallback(string s, TextBox txtbxOutputTmp);<br />
StockListManager m_slm;<br />
<br />
public PriceUpdateForm(StockListManager slm)<br />
{<br />
InitializeComponent();<br />
m_slm = slm;<br />
m_slm.m_DisplayOutputEvt += new StockListManager.m_DisplayOutEH(DisplayOutputFromThread);
}<br />
<br />
void DisplayOutputFromThread(string s)<br />
{<br />
DisplayOutput(s, txtbxOutput);<br />
}<br />
<br />
<br />
private void DisplayOutput(string s, TextBox txtbxOutputTmp)<br />
{<br />
<br />
if (txtbxOutputTmp.InvokeRequired)
{<br />
OutputDisplayCallback d = new OutputDisplayCallback(DisplayOutput);<br />
this.Invoke(d, new object[] { s, txtbxOutputTmp });<br />
}<br />
else<br />
{<br />
txtbxOutputTmp.AppendText(s + "\n");<br />
if ((s == "Price data update complete.") && (chbxCloseWhenDone.Checked))<br />
this.Hide();<br />
} <br />
}<br />
<br />
<br />
}<br />
In effect, it comes down to "How to make a call to the same form twice?" I think
Many thanks,
Gerry
C# newbie
|
|
|
|
|
Hi,
Actually Problem is occuring due to your custom event.The work around of this problem is
void DisplayOutputFromThread(string s)<br />
{<br />
if(!this.IsDisposed)<br />
{<br />
DisplayOutput(s, txtbxOutput);<br />
}<br />
}
|
|
|
|
|
Wow thanks sam!
Not sure why the object is still in existence (as its been closed) tho?
Thanks again,
Gerry
|
|
|
|
|
Hello,
The question is if you don't whant to hold the Form in memory and make and only hide it.
If jes, you should add a static "GetInstance" method in your auxForm, which creates an instance at first call and returns it, after that instance != null you return that instanc without creating it new.
The problem of your not accurate disposed class, should not be resolved with an workaround, as this will cause memory leeks and very soon Out of memory exceptions if you go on like this!
As Form is IDisposable and Dipsoe will be called at Close, you should override the Dispose method and unregister the eventhandler you added (-=.....).
Hope it helps!
All the best,
Martin
|
|
|
|
|
Thanks Martin thats some great advice!
|
|
|
|
|
|
i have a gif file with me,and want to place that in the from .
i tried with picture box but its doen't animating.
do we have any other controls or techniques to achieve this?
My small attempt...
|
|
|
|
|
Hello,
sujithkumarsl wrote: i tried with picture box but its doen't animating.
PictureBox, works for me.
Bitmap bmAnimated= new Bitmap(@"......\AnimatedPicture.gif"));
this.pbAnimated.Image = bmAnimated;
All the best,
Martin
|
|
|
|
|
Thanks a lot
My small attempt...
|
|
|
|
|
I have to develop this program(using C#):
Make a main program with a form in it, and a DLL to go along with it all.
In the DLL, add a text file and make, using the property box, the text file's property an embedded resource. Then, using reflection (i suppose), have the main program read the test file and post it to a form.
Plzz tell me how can i access that text file. and Is reflection necessary for it?
And how to achieve reflection?
Plzz reply soon
|
|
|
|
|
ya reflection is necessary for accessing any embedded resource. Get the reference of assembly and read your file in stream.
e.g.
System.Reflection.Assembly a=Assembly.GetExecutingAssembly();<br />
textStreame = a.GetManifestResourceStream("MyProject.MyTextFile.txt")));
|
|
|
|
|
I think that this article does exactly what you want:
Understanding Embedded Resources in Visual Studio .NET[^]
IrfanHaleem wrote: and Is reflection necessary for it?
Well, the Assembly class is in the Reflection namespace, so technically, yes. But you don't have to dig around in the data to get the resource, just use the GetManifestResourceStream method in the Application class.
Example:
Assembly me = Assembly.GetExecutingAssembly();
using (StreamReader reader = new StreamReader(me.GetManifestResourceStream("MyApplication.MyTextFile.txt"))) {
MessageBox.Show(reader.ReadToEnd());
}
-- modified at 5:02 Thursday 10th May, 2007
---
single minded; short sighted; long gone;
|
|
|
|