|
Have you ever read your previous question & answer ?????
You ask the same thing 10x.
|
|
|
|
|
ok, i have a project of 1mb. my clients download this project from web site. here my boss ask me why i give 22.4mb large thing for a small project. now sir what can i do.plz help me.
|
|
|
|
|
1. If you want to write your code in .NET, then you must have .NET Framework (22.4MB).
2. If you don't want to use .NET Framework, then you must write your code using Visual C++ 6.0.
It is impossible to run .NET Code without .NET Framework. Because it is the first requirement. If your boss has decide to use .NET, then you must told him to use .NET Framework. It is impossible to use .NET Code without .NET Framework. That is the concept.
You can whether install .NET Framework or install Windows XP Service Pack 2. It contains also .NET Framework.
|
|
|
|
|
Thanks. Sir, if any pc has windows xp service pack 2, than i can run my project without .Net Framework.
Sir , can u give any link for learn Visual C++ 6.0. And that to do learn Visual C++ 6.0.
Thanks.
|
|
|
|
|
|
Windows XP Service Pack 2 has .NET Framework in it.
I don't know any sites for learning C++. Try to search it in google.
There are many books for C++. For example this one : http://www.bookpool.com/sm/0672312409
|
|
|
|
|
|
I believe that is impossible.
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
<marquee behavior="alternate" scrollamount="5" scrolldelay="50">
-- modified at 4:33 Monday 3rd July, 2006
|
|
|
|
|
hi all,
i created one form and on click of a button in that form another form will pop up... now, is it possible that only after closing the second window the control should be passed to the first window... in other words only after closing the child window i should be able to work on the parnent window..
|
|
|
|
|
instead of using window.Show() use window.ShowDialog()
|
|
|
|
|
Hi
Find below the structure am using
struct Test
{
int i;
string s;
}
struct Check
{
int intI;
Test []structArray;
}
How to convert the Check structure to byte array ?
Thanks in advance
chandru
|
|
|
|
|
That depends on what you want the byte array to contain.
---
b { font-weight: normal; }
|
|
|
|
|
The following code converts the structure to bytearray.
Hope this helps...
<br />
using System.Runtime.InteropServices;<br />
<br />
[StructLayout(LayoutKind.Sequential, Pack=1)]<br />
public struct Test<br />
{<br />
public int i;<br />
public string s;<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential, Pack=1)]<br />
public struct Check<br />
{<br />
public int I;<br />
public Test [] structArray ;<br />
<br />
public int GetMySize()<br />
{<br />
int iSize = Marshal.SizeOf( I) + Marshal.SizeOf( typeof( Test)) * structArray.Length;<br />
return iSize;<br />
}<br />
<br />
public void MarshalStructToPtr(ref IntPtr ptr)<br />
{<br />
Marshal.StructureToPtr(I ,ptr, true);<br />
ptr = (IntPtr)((int)ptr + Marshal.SizeOf( I ));<br />
<br />
for( int count = 0; count < structArray.Length; count ++ )<br />
{<br />
Marshal.StructureToPtr(structArray[count],ptr, true);<br />
ptr = (IntPtr)((int)ptr + Marshal.SizeOf( structArray[count] ));<br />
}<br />
<br />
}<br />
<br />
<br />
}<br />
<br />
class ConvertStructToByteArray<br />
{<br />
<br />
public void Convert()<br />
{<br />
Test test1 = new Test();<br />
test1.i = 2;<br />
test1.s = "test";<br />
<br />
Check objCheck = new Check();<br />
objCheck.I =10;<br />
objCheck.structArray = new Test[1];<br />
objCheck.structArray[0] = test1;<br />
<br />
int Size = objCheck.GetMySize() ;<br />
IntPtr pCheck = Marshal.AllocHGlobal((int)Size );<br />
IntPtr Temp = pCheck;<br />
objCheck.MarshalStructToPtr( ref Temp);<br />
<br />
byte[] bytearrCheck = new byte[ Size];<br />
Marshal.Copy( pCheck , bytearrCheck , 0,(int)Size);<br />
Marshal.FreeHGlobal( pCheck );<br />
}<br />
}
|
|
|
|
|
Hi,
I found a code on net which allows multiline text in the datagrid cell.
The sample code wasin VB.net, I just converted it to C#.
Now the problem is the GetMethod is returning me null instead of an object. The code snippet is attached below
<br />
MethodInfo mi = dg.GetType().GetMethod("get_DataGridRows", <br />
BindingFlags.FlattenHierarchy | BindingFlags.IgnoreCase | <br />
BindingFlags.Instance | BindingFlags.NonPublic | <br />
BindingFlags.Public | BindingFlags.Static); <br />
<br />
<br />
Array dgRowArray = (Array) mi.Invoke(this.dg, null);<br />
the mi object is not getting created. It always says undefined.
Am executing the above code in the overrided paint event of the datagrid.
Can anyone help me out
Any help is highly appreciated.
Thanks in advance
Regards,
Kais
|
|
|
|
|
Hello Kais,
I also had problems with MethodInfo.
So I changed my code too InvokeRequired, by using a delegate.
private delegate void OnPaintDelegate(System.Windows.Forms.PaintEventArgs e);
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
if(InvokeRequired)
{
OnPaintDelegate(new OnPaintDelegate(_OnPaint), new object [] { e } );
return;
}
//Your code
}
Hope that helps you.
All the best,
Martin
|
|
|
|
|
Hi Martin,
Where do we need to define "InvokeRequired" variable?
Also i have override the paint method which has 7 parameters. Is that an issue?
Please guide me if am wrong. I want to make this work.
Regards,
Kais
|
|
|
|
|
Hi Kais,
InvokeRequired is a member of System.Windows.Forms.Control.
You can have as much parameters as you whant, as long as your delagates has the same.
private delegate void xxxDelegate(..., ..., ..., ...);
Hope that helps you!
All the best,
Martin
|
|
|
|
|
Hi Martin,
Thanks for your prompt reply.
I added the peice of your code in my customized datagrid class which inherits from DataGrid.
Now it throws me the following errors
The name '_OnPaint' does not exist in the class or namespace CustomControl.CustomGrid.CustomDataGrid'
CustomControl.CustomGrid.CustomDataGrid.OnPaintDelegate' denotes a 'class' which is not valid in the given context
This might be a stupid thing i am asking. The delegate needs to be wrapped with the method. Where do i need to assign the method for it?
Thanks in advance
Regards,
Kais
|
|
|
|
|
Sorry,
Was my mistake!
private delegate void get_DataGridRowsDelegate(..., ..., ..., ...);
protected override void get_DataGridRows(..., ..., ..., ...)
{
if(InvokeRequired)
{
get_DataGridRowsDelegate(new get_DataGridRowsDelegate(get_DataGridRows), new object [] { ..., ..., ..., ..., } );
return;
}
//Your code
}
The method has to be your get_DataGridRows Method you asked for. With all the parameters you had.
If its not working, please post the code here!
Martin
-- modified at 8:08 Monday 3rd July, 2006
|
|
|
|
|
Was a little confused before.
I mixed my code to yours and forgot your actual question.
|
|
|
|
|
Martin,
Thats ok. But get_DataGridRows method is not available for override. How will this work?
Regards,
Kais
|
|
|
|
|
In your case, you can create Method like you had before.
private void get_DataGridRows(...... ;
just insert code in your Method.
Martin
Please give me feedback, if it works.
|
|
|
|
|
Again, it was code from my project.
|
|
|
|
|
Ok let me try out.
I need to leave for the day now.
Catch you tomorrow..
Thank you very much for your suggestion and time.
Regards,
Kais
|
|
|
|
|
hi Martin,
In meanwhile is it possible for you to send me the complete sample code.
I would be very greatful for you if i can get the sample code.
Thanks for all your help
Regards
Kais
|
|
|
|