|
Seems to me like you might need to include both the index and the new property value in the array.
Burt Harris
|
|
|
|
|
I'm tring to create a program that can read and write cab files. Unfortunatly the CabCreator class was removed from .NET after the beta and the Setup SDK doesn't appear to have the functionality that I need. Does anyone have any ideas on how to accomplish this???
Thanks!!
|
|
|
|
|
You can use the SharpZipLib[^] to create zip files. It is free and open-source.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Thanks for the reply that looks like an interesting library unfortunalty the LZW compression alorgthium is patented, and unfortunatly it is impartive that I use the CAB format.
Thanks,
John
|
|
|
|
|
The cabinet reader/writer is a C dll (cabinet.dll) provided by MS along with their CAB SDK (cab-sdk.exe).
You can find the CAB SDK here[^] for instance.
To access these functions using C#, you only need to premarshal these structures and function signatures (less than 10).
In case premarshaling is too hard a job, consider using MC++ mix mode.
|
|
|
|
|
hello,
is there any way that we can use C language code in C#?
What are the alternates of header files in C#?
and
How to convert a header file to a namespace if namespaces are the alternatives to header files?
regards
|
|
|
|
|
You can declare C functions in C# using the extern keyword along with the DllImport attribute. Once the function is declared, you just call into it. For example:
using System.Runtime.InteropServices;
<P>
[DllImport("User32.dll")]
public static extern int MessageBox(int h, string m, string c, int type);
<P>
MessageBox (0,"API Message Box","API Demo",0);
See the following and other articles on the topic:
http://www.thecodeproject.com/csharp/c__and_api.asp
There is no need for headers in C#. You just put all your code in the .cs class. You generally wrap your code within a namespace as a way of organizing things and to avoid name conflicts with other code -- it doesn't really correspond to a header.
|
|
|
|
|
I am not using any C functions from any dll.
Actually i have a packet driver library (which is completely written in C). I want to use this library from a C# file.
I have the source code of the library, so, I have to supply header files definitions of 'structs' used in function calls and these function calls are linked statically.
Simply i want to use the library from a C# file as i use it from any other C file.
Tell me if i m unable to explain my question or some extra details are required.
regards.
|
|
|
|
|
If this library has only a few entry points, then it's worth using P/Invoke to use it from C#.
If the library has many entry points, or requires a significant amount of structure marshaling, then use MC++ instead. With MC++, you can mix managed code and native code without reexposing signatures.
|
|
|
|
|
thanks
as it came to me, i switched to visual C++ .net. I am now able to mix the unmanaged code of the library and the managed code of .net. It is working nice.
But can you give me some favour by telling that whether there is any "Network packet capture" support in .net library? Any namespace, classes etc.
|
|
|
|
|
hashimsaleem wrote:
But can you give me some favour by telling that whether there is any "Network packet capture" support in .net library?
Although the System.Net.Sockets.TcpClient wraps sockets to read/write packets, I believe this is not what you are looking for. I believe that what you need is at a lower-level, much like "Network adapter" and, at this point, there is no better substitute than the Windows DDK (plain WIN32 C code, as you may know).
|
|
|
|
|
I've tried to get an example of a simple (Drawing Background, Text, FocusRectangle) owner draw ListVIEW but couldn't get one. There are some example with the UtilityLibrary which do not work or are hopeless complicated because of overloading its possibilities.
Is there anybody who knows where I can get a working example of a C# Owner Draw ListView Control?
I would be extremly happy to have one!!! (Ein Königreich für ein Owner Draw ListView)
Any hints for WndProc would be help.
Thanks!
Stefan
|
|
|
|
|
In windows XP there is a feature "Group similar Taskbar buttons"
How I can set the icon and title for taskbar button for my application's grouped windows.
Sonork ID 100:25668
|
|
|
|
|
I have a program written in C#/VS.NET and I am trying to find out how much memory a specific instance of class is using during runtime. Does anyone know if there is a feature in the VS.NET debugger that would let me know this information? Or, do you have any ideas on how I could get an accurate estimate of it's size?
FYI: Monitoring the "Perfomance Tab" of the "Windows Task Manager" is not accurate enough for the information I am needing.
Mark Sanders
sanderssolutions.com
|
|
|
|
|
The .NET framework sdk comes with a full fledged memory/usage/load profiler. <framework SDK folder> \ tools developers guide \ samples \ profiler.
|
|
|
|
|
Hey All,
I was wondering if anyone out there is using and has suggestions for 3d party control packages. Ive seen a couple out there, like infragristics, has anyone used them?
Thanks for the suggestions,
Ryan
|
|
|
|
|
I've been using quite a lot of 3rd party controls. Here are some impressions:
- Infragistics: I've been using their ActiveX components in VB6 and they work pretty good. When we switched to C# we got their NetAdvantage Suite (ActiveX, .NET and ASP.NET) and I must say the .NET controls are pretty unconsistant in use (properties, collections, methods are not always the same between similar controls. There still are quite some bugs/weird things but I'm overall quite happy with them. They also have a great support. If you want to use these don't forget to buy the .NET-sources also, I regret not having done so.
- Janus Systems: I had all my VB6 apps based on their grid but it took them too long to move to .NET so I switched to Infragistics. Took a look at their .NET grid and it still looks pretty good.
- Xceed SmartUI.NET: just got them as a free upgrade from my Sax SmartUI.NET (which wasn't too good, I saw it as a waste of money). The new version seems more stable but I haven't had any use for them right now.
- Developer XPress XtraNavbar: Pretty nice and easy to use Outlookbar-like control with extra's.
In my applications I'm using currently MagicLibrary, Infragistics and XtraNavBar along with some specialized controls I developed my self based on the Infragistics controls.
Hopes this helps
Stefan
|
|
|
|
|
i am currently doing something like the following to a combobox:
(for int i = 0; i < 10; i++)
{
MyObject objData = MyData.GetAt(i);
this.cbMyComboBox.Items.Add(objData.strWord);
}
which adds the text to the combobox fine.. but what i really wanna do is set a data value for each item i add.. there are 'tag' values for tree controls, but i dont see anything like this for the combobox.. and if i just add the object then it displays the object type because it doesnt know what text to display..
im sure this is a common problem, just couldn't find the answer in the message boards..
thanks in advance!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
well one thing you could do is override the tostring method, and throw your own variable in there that would add some meaningful text, have you tried that?
Ryan
|
|
|
|
|
that would require me writing a class derived from combobox that was familiar with class i was adding to the combobox.. so it would work, but only for one type of class.. i dont understand why there is no tag property for the items..
c++ would be like:
for (int i = 0; i < MySet.GetSize(); i++)
{
MyObject* pObj = MySet.GetAt(i);
int nPos = MyComboBox.Add(pObj->m_strText);
MyComboBox.SetDataPtr(nPos, pObj);
} that way when i handled the selection changing i could have a pointer instantly to the item it was changed to.. ah well..
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
if i understand correctly, your trying to get text from objects that you add into the combo box. All objects in c# support the tostring method, it is a method of the base class, so you wouldnt have to do any extra inheritance.
|
|
|
|
|
AAAAAH.. i see what your saying..
sorry im a bit slow sometimes.. i guess that makes perfect sense, thanks!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
well, i thought this would work, but it doesnt..
this.cbCountyDefault.BeginUpdate();
for (int i = 0; i < m_saCountyRecords.Count; i++)
{
GASTCountyRecord objRecord = (GASTCountyRecord)m_saCountyRecords[i];
this.cbCountyDefault.Items.Add(objRecord);
}
this.cbCountyDefault.SelectedIndex = 0;
this.cbCountyDefault.EndUpdate();
MessageBox.Show(cbCountyDefault.SelectedItem.ToString());
MessageBox.Show(((GASTCountyRecord)this.cbCountyDefault.SelectedItem).ToString()); the first messagebox shows the objects name, and the one where i cast it shows the corect name..
the listing in the combobox lists the class name because it populates this by calling Object.ToString() not by casting it to my object type then calling ToString() .. any other suggestions?
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
hrm.. it was how i was doing it.. ill put this here for future reference
how not to do it:
public class GASTCountyRecord : object
{
public string m_strCode;
public string m_strName;
public GASTCountyRecord(string strCode, string strName)
{
m_strCode = strCode;
m_strName = strName;
}
public string ToString()
{ return m_strName; }
}
how to do it:
public class GASTCountyRecord : object
{
public string m_strCode;
public string m_strName;
public GASTCountyRecord(string strCode, string strName)
{
m_strCode = strCode;
m_strName = strName;
}
public override string ToString()
{ return m_strName; }
}
thanks for all your help.. i think the way they have you implement this is a bit wack tho
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Hi.
WYSIWYG HTML Editors for webbased content managment systems have been around quite some time now. Personaly i love the free ASP.NET web control named "FreeTextBox", witch can be found at: SourceForge[^].
These days when more and more developers keep focusing on the power of the rich client, a HTML Editor Control for windows forms would be greate.
I was wondering if there where such a control around, where you could set up your buttons (witch type of HTML you would allow the user to create) and simply extract the html content. Are there inbuilt functions doing this in the RitchTextBox control?
-Jonas
|
|
|
|