|
hi
why dont exist "DataGridComboBoxColumn" class in dotnet 1.1
how to add combobox to datagrid in dotnet 1.1 ?
thanks
|
|
|
|
|
hai there,
who told you mscorp forget this ?
view this link
http://www.codeproject.com/cs/miscctrl/DataGridZen.asp
if this is not sufficinet for you then get back to me.
hai, enjoy coding
Sreejith SS Nair
|
|
|
|
|
I have a form which takes a lot of initialisation time. The initialisation is done in the Form_load event. When the initialisation is finished the form becomes visible.
I want the form to be immediately visible and perform the initialisation while the form shows a wait message.
How can i achieve this?
|
|
|
|
|
You coudl use threading. And initialize in another thread.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
All your base are belong to us!
scored a 5 from me, for making me laugh
|
|
|
|
|
hai there,
let me come to the point. i have a application that containe a pannel with some no of label controls. dynamically i need to remove or dispose the existing control and i need to create new label controls.
imp is i need to run the disposal or removal in standalone thread. (asyncronous). So i wrote a class which will accept a list of control and will remove the content.
using System;
using System.Threading;
using System.Runtime.Remoting.Messaging;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
public delegate void DisposingDel(params object[] aList);
namespace PlanningBoardSystem.Classes
{
public class AssynClass
{
public void MyCallback(IAsyncResult iar)
{
AsyncResult Ars=iar as AsyncResult;
DisposingDel DAsr=(DisposingDel)Ars.AsyncDelegate;
}
public void DisposeLabel(params object[] aList)
{
PlanningBoardSystem.OrderLineLabel CtlIns ;
foreach(Label Ctl in aList)
{
CtlIns= Ctl as PlanningBoardSystem.OrderLineLabel;
CtlIns.Dispose();
}
}
}
public class IAsyncronousCls
{
private object[] obj;
public IAsyncronousCls(params object[] a )
{
AssynClass AssynCls=new AssynClass();
DisposingDel DisDel=new DisposingDel(AssynCls.DisposeLabel);
AsyncCallback AsynCback=new AsyncCallback(AssynCls.MyCallback);
}
}
}
See this code is incompleted . If you know please complete this code and get back to me.
thanks.
enjoy coding
Sreejith SS Nair
|
|
|
|
|
sreejith ss nair wrote:
See this code is incompleted . If you know please complete this code and get back to me.
Nope...You have to complete it. We can help with problems, not manpower requirements...
RageInTheMachine9532
|
|
|
|
|
Hello,
My application is required to monitor a database in MS SQL. Can I use C#/ADO.NET to develop the application that is to detect a new record entered or updated in MS SQL?
I appreciate your helps.
|
|
|
|
|
hi,
I guess you can do that efficiently by using triggers on the database. To do that from C# I recomend you to go thru the following article.
http://www.sys-con.com/dotnet/article.cfm?id=322
Hope this solves your problem.
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|
|
|
i want to invoke GetDIBits function ,this is my code:
-----------------------------------------
public struct BITMAPINFOHEADER
{
public uint biSize; // DWORD
public long biWidth; // LONG
public long biHeight; //LONG
public uint biPlanes; // WORD
public uint biBitCount; // WORD
public uint biCompression; // DWORD
public uint biSizeImage; // DWORD
public long biXPelsPerMeter; // LONG
public long biYPelsPerMeter; // LONG
public uint biClrUsed; // DWORD
public uint biClrImportant; // DWORD
}
public struct RGBQUAD
{
public byte rgbBlue;
public byte rgbGreen;
public byte rgbRed;
public byte rgbReserved;
}
public struct BITMAPINFO
{
public BITMAPINFOHEADER bmiHeader;
public RGBQUAD bmiColors; //
}
code above is the structure definition;
[DllImport("gdi32.dll")]
public static extern int GetDIBits(IntPtr hdc, IntPtr hbmp, uint uStartScan,uint cScanLines, out byte[] lpvBits, ref BITMAPINFO lpbmi, uint uUsage);
----------------------------------------------------
BITMAPINFO bmi = new BITMAPINFO();
bmi.bmiHeader.biSize = 60;
bmi.bmiHeader.biBitCount = 0;
IntPtr hScreenDC = CreateDC("DISPLAY",null,null,IntPtr.Zero);
IntPtr hMemDC = CreateCompatibleDC(hScreenDC);
IntPtr hBitmap = CreateCompatibleBitmap(hScreenDC,800,600);
byte[] lpvBits = null;
int mResult = GetDIBits(hMemDC,hBitmap,0,1,out lpvBits,ref bmi,0);
if( mResult != 0)
MessageBox.Show("Success");
else
MessageBox.Show("Failure");
--------------------------------
the code above is to invoke GetDIBits().The MSDN says if lpvBits is null, bmi should be filled with DC and bitmap Info and mResult should return Non-Zero.
However the mResult is always Zero. How to solve this problem?
|
|
|
|
|
I dunno, but I do recall having no success with this function. Create a DIBSection instead, or better yet, just create a Bitmap and forget all this DLLImport stuff. Why do you need it ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Try declaring your structs like below or even better use a managed equivalent of GetDIBits, which is Bitmap.LockBits
<code>
IntPtr hBitmap = CreateCompatibleBitmap(hScreen, 800, 600);
Bitmap bitmap = Bitmap.FromHbitmap(hBitmap);
BitmapData bData = bitmap.LockBits(new Rectangle(0,0,bitmap.Width,bitmap.Height), ImageLockMode.ReadWrite, bitmap.PixelFormat);
or as I said above try to declare your structs like this if you absolutely must stick to GetDIBits
[StructLayout(LayoutKind.Sequential)]
public class BITMAPINFOHEADER
{
public uint biSize;
public long biWidth;
public long biHeight;
public uint biPlanes;
public uint biBitCount;
public uint biCompression;
public uint biSizeImage;
public long biXPelsPerMeter;
public long biYPelsPerMeter;
public uint biClrUsed;
public uint biClrImportant;
public BITMAPINFOHEADER()
{
biSize = Marshal.SizeOf(this);
}
}
[StructLayout(LayoutKind.Sequential)]
public class RGBQUAD
{
public byte rgbBlue;
public byte rgbGreen;
public byte rgbRed;
public byte rgbReserved;
}
[StructLayout(LayoutKind.Sequential)]
public class BITMAPINFO
{
public BITMAPINFOHEADER bmiHeader;
public RGBQUAD [] bmiColors;
public BITMAPINFO()
{
bmiHeader = new BITMAPINFOHEADER();
bmiColors = new RGBQUAD[1];
}
}
|
|
|
|
|
thanks for your suggestions.
i choose GetDIBits function for i need to get bits info from hBitmap or hDC and to transfer them on the net.
i think transfer bits quicker than this way: get image first and convert into bits,then to send.
but i do have a subsequent problem : the size may be too large.
|
|
|
|
|
You realize there's much easier ways that don't require unmanaged functions? If you're using a TcpClient or some other connection, just get the NetworkStream and write your Bitmap to the stream. Simple. If you want to convert it first (a waste of time), then use either write to a memory stream and then send the bytes, or use the ImageConverter like so:
ImageConverter converter = TypeDescriptor.GetConverter(typeof(Image));
byte[] buffer = (byte[])converter.ConvertTo(image, typeof(byte[])); You really should read the class library documentation in the .NET Framework SDK. There are plenty of ways to do this using only managed code, and a heck of a lot easier as well.
Even if you wanted to get the DIB bits, just use Bitmap.LockBits as someone else mentioned. There is absolutely no reason to P/Invoke unmanaged functions.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
there is the reason to use GetDIBBits. Exactly for network.
Gdiplus doesn't invert bitmap content during BitBlt, fo example.
|
|
|
|
|
I am writing my first 'real' C# control. It's a taskbar that can be positioned to Top/Bottom/Left/Right. What I need to know is which event do I need to use to position it to the bottom when it's initially created.
I tried putting the code in the constructor but you cannot get the parent's properties until after creation.
Can someone please point me in the right direction?
Former VB programmer learning C#.
Thank you
No comment, Mr. Senator<pre>
|
|
|
|
|
You mean docked to a container, like a Form ? See the Dock property, which can be set in the constructor.
Also, you can support initialization after instantiation by implementing the ISupportInitialize interface. The VS.NET designer will automatically call the BeginInit method after instantiating your control, and will call EndInit when done in the InitializeComponent call (you can do this yourself, too - I'm just telling you how VS.NET handles controls that implement this interface).
This way, in your implementation of the EndInit interface, you should have a valid Parent reference (so long as your control was added to the parent's Controls collection property) and can do what you need to. Implementing this interface is a great way to suport initialization of your control in steps.
PS: You could do this using your own implementation without implementing the interface, but VS.NET won't care. Implementing the ISupportInitialize interface is a good way to add designer support for your control. There are other designer-oriented things you can do, which are handy for a lot of programmers. Read Enhancing Design-Time Support[^] in the .NET Framework SDK for more information.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thank you Heath this was extremely helpful.
No comment, Mr. Senator<pre>
|
|
|
|
|
Take a look at this:C# does Shell, Part 3[^]
That is really helpful.
abcdabcdabcdabcda
Don't forget, that's Persian Gulf not Arabian gulf!
Why do we close our eyes, when we dream?, When we cry?, When we imagine?, When we kiss?, Its because the most beautiful things in the world are unseen
Murphy: Click Here![^] I'm thirsty like sun, more landless than wind...
|
|
|
|
|
Hi all hope all are good
i make a project which i use a neural network iin it so i need to export a DLL file from the nero solution and link it to the C# need help i just found to link nero soultion with C++ 6
hope anyone can help me
thanks in advance
Gego
|
|
|
|
|
You mean you want to P/Invoke all the exported functions? Read Consuming Unmanaged DLL Functions[^] and Marshaling Data with Platform Invoke[^] in the .NET Framework SDK to familiarize yourself with P/Invoke.
Also, we can't help you if you don't provide specifics. If you have problems declaring a managed method to P/Invoke an unmanaged function, that's something we could help you with. You need to at least learn and try to P/Invoke the functions needed from this nero DLL you're talking about.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Thanks alot for ur replay
but the problem is the nero solution pacakge make a train and test and it can generate a DLL but this DLL is supported by c++ 6 or pervious only i wanna to know if there is a way to link this DLL with C# or if there is a way or an update which make the nero solution generate a DLL file which allow to be linked with an application by C#
thanks alot
byebye for now
Gego
|
|
|
|
|
There is no linking as you think of it in terms of C/C++. The DLL must export functions (either C-style or C++-style) and the DllImportAttribute is used to configure the metadata necessary for the CLR to P/Invoke those calls. Read that link I sent you for more information.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am working on a new project.
Basically, I want to implement a Window Form that mimics Internet Explorer.
So, it would consist of two parts.
A Window Shell with a browser capabilties, and the menu will be like a window explorer file-structure style (tree-like structure). And when clicked on the menu, it will call some aspx page (rendered inside the app).
Any hints welcomed.
I would like to know what class to use for those 2 components. Thanks.
Stanley
|
|
|
|