|
Ahh, remebered there was a catch, what you can use though is ILLinker available on GotDotNet Works like a charm.
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
|
How can I work in C# with Comm Port?
I need send some data to Comm Port and then read answer...
Please help me. Sorry my English.
|
|
|
|
|
Hint: search the MSDN Magazine site
VictorV
|
|
|
|
|
Hello everybody,
I have a concern, related to my superficial knowledge about Collections in C# (and of course .NET framework):
I had in my application two Queues:
System.Collections.Queue q1;
System.Collections.Queue q2;
First queue is filled by a working thread.
The main thread, process data from second queue.
What happen when I use q2 = q1 in my code?
Is q2 filled with elements from q1? Remain q1 and q2 two independet queues, or q2 will somehow point to q1 in fact, through some referrence mechanism?
Should I explicitely copy elements from q1 into q2, or assignment is sufficient?
Please help me with this situation, many thanks,
Miguel
|
|
|
|
|
In your example of using Queues, the operator "=" will do a reference assignment. Meaning, any changes to q2 will also show up in q1 and vice versa.
You will need to do explicit copying of the elements in order to duplicate the queues. Or you can do something like this:
q2 = new Queue( q1 );
This will do the duplicating for you.
Hope this helps,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Thanks, now is clear about reference assignment.
Also thanks for pointing me in using this kind of constructor, which will do for me exactly what I want.
But one more question: if the content of the queues is different, at the moment of assignment, one of it will be lost, right?
Regards,
Miguel
|
|
|
|
|
Don Miguel wrote:
But one more question: if the content of the queues is different, at the moment of assignment, one of it will be lost, right?
Correct, when the assignment to q2 happens with the constructor method the data in q2 is effectively lost (atleast if you don't have references to the elements in q2 somewhere else).
q2 = new Queue( q1 );
<br />
foreach( object o in q1 )<br />
q2.Enqueue( o );
Hope this helps,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Nathan Blomquist wrote:
the data in q2 is effectively lost
Thanks Nathan, is clear now.
|
|
|
|
|
Hi:
I would like to add DirectX reference to the C# project.I installed the DirectX9.0 SDK(for c#) already, but still not can find the DiretX reference. without that, i can not use namespace of DirectX, so can not continue work.
any boday have idea how to do?
thanks
henry
|
|
|
|
|
Project->Add Reference...
Select Microsoft.DirectX and any useful component parts (eg. Microsoft.DirectX.DirectDraw).
Paul
We all will feed the worms and trees So don't be shy - Queens of the Stone Age, Mosquito Song
|
|
|
|
|
Thanks. but the problem is I can not find Microsoft.DirectX and related component.
|
|
|
|
|
Hi:
I would like to add DirectX reference to the C# project.I installed the DirectX9.0 SDK(for c#) already, but still not can find the DiretX reference. without that, i can not use namespace of DirectX, so can not continue work.
any boday have idea how to do?
thanks
henry
|
|
|
|
|
Henry:
At the risk of sounding ignorant, have you searched the COM tab in the Add Reference dialog?
Craig
"If your ship doesn't come in, sometimes you have to swim out to it" - Audrey Quock
|
|
|
|
|
yes. I did search on the COM tab, only have directX for VB, not DirectX for c#. The more strange thing is after I downloaded and installed SDK9.0 for C#, all the api are c++.the label of downloaded component is C#,but why the code and API of that is c++?
do u have any idea?
thanks a lot
henry
|
|
|
|
|
henrykao wrote:
yes. I did search on the COM tab
If you want your project to be able to access "Managed DirectX", then you'll have to search for Microsoft.DirectX.< DirectX Component > under the .NET tab.
henrykao wrote:
only have directX for VB, not DirectX for c#.
Those libraries under the COM tab are for Visual Basic 6, but you can use them with VB.NET or C# ( both VB.NET and C# both would require an Interop dll which would be created by visual studio once you add the reference )
henrykao wrote:
the label of downloaded component is C#,but why the code and API of that is c++?
Unfortunatly, 95% of the documentation you download from Microsoft for DirectX will be in c++, but if you search hard enough you will find some VB documentation inside the C++ help files (especially for DirectShow). On the plus side, the directx objects for C++ and VB are similar and work basically the same way. The C# code is in the SDK directory in the samples folder.
Hope that's of some help to you.
Daniel E. Blanchard
|
|
|
|
|
My English is very poor,I hope you can help me.
How to make the window's(child) default status is maximize.
Thank You!
海纳百川,有容乃大
壁立千仞,无欲则刚
|
|
|
|
|
In you project you have created two forms.
Form1 -- this is your MDIParent form
Form2 -- your child base form.
In the properties for Form2, find the Layout / Window State property and change if from Normal to Maximize.
Rebuild your project and your children will now be maximized.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
In my program, I used a DataGrid to display the data from the database. I realized that the column headings are in alphabetical order from left to right, which is not what I want. How can I change the setting to display the columns in my own way? I've tried using the TableMappings property of DataAdapter, but I couldn't make it work. Please give me some instructions about it. Thank you!
|
|
|
|
|
You can use the DataGrid TableStyles.
First you add one GridColumnStyle and a collection of columns to it. Each column you set the 'mapping' value to match the column in ur dataset that u want to display .
No time to breathe
|
|
|
|
|
I got it! Thank you very much!![Laugh | :laugh:](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_laugh.gif)
|
|
|
|
|
I am teaching my self C# and the book I have doesn't show how to scroll to the next record. The standard thing I do is to move to the next/prev record check for eof/bof and if that is true, move to first/last then display the record. I can't find how to move to the next/last/prev/first record. I can think of a way using a global variable and tracking the recordcount and check the location, but the way I mention is easier. Can anyone point me to the MSDN page, or other page that gives a nice example of this? Thanks
|
|
|
|
|
Are you working with either a DataReader object or a DataSet object? If not, then check out these objects before you go any further.
Mark Sanders
sanderssolutions.com
|
|
|
|
|
I'm working with a dataset object.
|
|
|
|
|
Because a dataset is a fully disconnected container for data, datasets (unlike ADO recordsets) do not need or support the concept of a current record. Instead, all records in the dataset are available.
A dataset can be made up of multiple DataTable objects which in turn can have DataRow objects and DataColumn objects. You can use a variety of different means to access these objects such as foreach loops or direct minipulation.
You might checkout http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/getdatafromdb.aspx[^]
Mark Sanders
sanderssolutions.com
|
|
|
|