|
I am calling an in-house DLL, I just declare the API with DllImport and .NET takes care of the rest.
Good article on the basics of the P/Invoke subject here: http://msdn.microsoft.com/msdnmag/issues/03/07/NET
I did some testing and comfirmed that the DLL remains attached for the lifetime of the calling process. Makes sense in hindsight. Luckily I don't have any working set size problems yet that would require me to unload the DLL forcefully.
Know where I can get some info. on the low level machinations of P/Invoke, there are some things I would like to better understand about interop marshaling. I think I better post a separate question on the next subject.
Thanks for the response.
NIK
|
|
|
|
|
Hi all,
I have a program running without stop with a textfield to display data. I reset the textfield whenever its maxlength is reached.
The program ran well but one day I saw my computer was restarted and I looked at the application event and saw that it was caused by Running time in .Net .
I wonder if anyone knows this running time issue or a similar problem.
Thanks.
Kyah
|
|
|
|
|
I never had any issues regarding this. Could you post what exactly has been written to the events queue?
|
|
|
|
|
well, the code is not so complicated.
private void display(string data)
{
checklength(data.length);
txtdisplay.appendtext(data);
}
private void checklength(int num)
{
if((txtdisplay.text.length + num) > txtdisplay.maxlength)
txtdisplay.reset();
}
Anyone wants to test, creating a form with multiline textfield, just running a forever loop and passing a string to the display function.
Thanks.
Kyah
|
|
|
|
|
i have a login (username & password) textboxes on main form and if one succesfully logins to the form then i hide the main one and open another form (form2).
i want to show the first hided form if one clicks the (X) on the form2 ?
how can i do this ¿
|
|
|
|
|
Override OnClosed (or OnClosing if you want to do some checks first) in form2 and there you can do form1.Show().
Make sure that form2 has a way to reference form1 though.
|
|
|
|
|
Form1 f1 = new Form1();<br />
f1.Show();
|
|
|
|
|
I have a project where I need to serialize a class. The class contains a collection of objects. The collection is heterogenous but all the members derive from the same base class. To get it to serialize I have to explicitly define every possible class that could be a member of the array using XmlArrayItem. Like this:
[XmlArray]
[XmlArrayItem(typeof(MyBaseClass),ElementName="Base")]
[XmlArrayItem(typeof(MyDerivedClass1),ElementName="Derived1")]
[XmlArrayItem(typeof(MyDerivedClass2),ElementName="Derived2")]
[XmlArrayItem(typeof(MyDerivedClass3),ElementName="Derived3")]
public List<MyBaseClass> MyList;
My question is, is there an easier way to do this? It's really annoying when I add a new class and then have to wonder why the serialization has broken again and end up spending maybe 15 minutes trying to figure it out before I remember I forgot to add it as an XmlArrayItem.
|
|
|
|
|
Hi guyes,How Can I Fill A Combobox With SQl Server DataBases?
Thank You
Nour
|
|
|
|
|
Is there a way to get the currently displayed URL in the running instance of Firefox?
I could do that with Internet Explorer but have no clue on how to do it with Firefox.
Thanks.
|
|
|
|
|
hi all,
first i put a button on a form and click on the button to add some code in it (on click property).
then i decide to remove that button. but the source of that click property remains in form.cs file.
what should i do in order to clear everything related with a button or a label from that .cs file if i remove them ?
(do i have to remove them manually ???)
help please.
bye.
|
|
|
|
|
if you create a click event that means you create a new method, the method will stay there, but everything else (such as click event, the button himself) will be deleted, so all you got to do, is to erase the method.
|
|
|
|
|
If you add code to the designer-generated event handling method, then it will not be erased when you remove the control from the design surface. If you do not add code to the method, it will be removed. This behavior makes sense because suppose the event handling method contained 500 lines of code (not that it ever should!). If you were to accidentally delete the control associated with the event handling method in the design view and it deleted that method, you'd probably not be a happy camper...
Josh
|
|
|
|
|
Like the others mentioned, you need to remove these manually.
Another reason to not automatically remove the method is because you may be using the method for other controls. It is often better coding if similar buttons use the same event methods. For example, I use the same method for all radio buttons within the same group. The code is much cleaner and better organized.
|
|
|
|
|
All these days, I was under the assumption that calling the Close method on a modal form results in an immediate call to the Dispose method on the form. The MSDN[^] documentation also says it does (except for some special conditions, which I've ruled out). It also seemed to work when I first tried it, but now, it refuses to call Dispose until the parent form itself is shutdown.
Is this normal behavior? Any idea why it worked once but refuses to work now?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi,
I have read from the article that serialization means the process of maintaining state of the object.
can any one explain me clearly?
Keep Learning,
juju
|
|
|
|
|
A serailized object is a string basicly which you can store in a file for example and then later retrive it from there and construct that object back...
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
There is a slight difference.- Serialization strictly means pushing your object's data into a stream of some sort, while deserialization refers to the opposite process (recreating your object from the contents of a stream).
- Persistence has to do with persisting (permanently saving) a stream to a permanent store (file, database, content management system, source code repository, etc).
The two are often used together. You usually serialize an object (or a collection of objects) to a persistent store so that you can recreate the objects at a later date. But you could just as well serialize your object into a stream that's transmitted to a service.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I'm sorry I'm writing this twice, but it's realy importent to me, especially now, and I didn't get any answers before, so I'll ask the two questions in one message:
1. I have this next code, which works, but when I open the .xml file it doesn't show me the type I want, it shows me "System.Type" or "AnyType"...
DColSFirst.DataType = TypeCode.String.GetType();
also:
DColSID.DataType = Type.GetType("System.UInt32"); //works either...
How can I define the DataColumn to a type I want?
2. I'm trying to build my own ICryptoTransform-able (System.Security.Cryptography.ICryptoTransfom) class, so I could use it in CryptoStream.
I already built the algoritm, and I inherited from ICryptoTransform as they wanted to, and I'm using MSDN to know what methods and properties I need to do, but there are two properties, and two methods that I don't know what to do with them, and what I should return from them... the properties are InputBlockSize AND OuputBlockSize, and the methods are TransformBlock and TransformFinalBlock, I don't know what they need to get (what does every parameter stand for), and what to return, the MSDN doesn't help me very much in here.
If anyone can tell me what to do in them, and even give me an exemple I would appriciate it...
3. And one more thing, where can I save information on my application (i.e is registered, setupdate etc...), and how that it won't be able to be changed without my pass or something like that...?
Thanks in advance...
NaNg
(REALY ORGENT)
-- modified at 8:59 Wednesday 10th May, 2006
|
|
|
|
|
why can't I get answers? this is something like the 4th message that has no answer to it...
please, some-one... please help.
|
|
|
|
|
Hello everybody,
By using below codes I produced a pdf file.
static void Main(string[] args)
{
FileStream fstrm=new FileStream("b.pdf", FileMode.OpenOrCreate, FileAccess.ReadWrite);
StreamWriter wrtr = new StreamWriter(fstrm);
string str = "Hello Acrobat";
wrtr.WriteLine(str);
wrtr.Close();
fstrm.Close();
}
However as I open the b.pdf file with Adobe Acrobat 5.0 I see below message.
"Acrobat could not open b.pdf because it is either not a supported file type or because the file has been corrupted."
What should I do to open the file with Acrobat Reader after program?
Thanks a lot.
|
|
|
|
|
Write something in PDF format - it's a very complex file format, so you would be best using a third party PDF library like iText[^].
Ryan
"Michael Moore and Mel Gibson are the same person, except for a few sit-ups. Moore thought his cheesy political blooper reel was going to tell people how to vote. Mel thought that his little gay SM movie about his imaginary friend was going to help him get to heaven."
- Penn Jillette
|
|
|
|
|
Hiii,
I have done this but i m using a tried party API for the same...
except using thried party API i think it's possible coz u can not
read PDF format file...using streams...It's very deficult...
i m using this API
http://www.colorpilot.com
Thanx
Anuj Kamthan
Software Developer
Solversa Technologies,
Pune - 411007, India.
http://www.solversa.com
|
|
|
|
|
Hello
I want to write an image viewer application in C# 2.0 The app can view multiple images, each image is opened in a TabPage. How to control Tab Pages ? Ex: when user switch to other tab, the app must move to that tab. Do I have to use ArrayList to control these TabPage ?
Help me. Thank you very much
|
|
|
|
|
Im writing a windows service in C# and I want to trigger an event within that service using a MS SQl server(2005) Trigger. i.e. The Windows service sits there doing whatever, when a new row is created in a specific table it will somehow message/trigger an event within the service.
Hope this makes sense,. Am I asking in the right place?
Kind Regards,
Rhys
|
|
|
|