|
I am using this third party tool in my windows(C#) application.
PowerTools for .NET "SPREAD" from
Far Point Technologies.inc.
I am using grid in which cell type for one column is button.
Now problem with this button is ,button clicked event occures for both mouse buttons(i.e. with left as well as right button).
I want to ristrict the right button click event on this button.
Does any body has idea about this?
please let me know.
Sagar
|
|
|
|
|
I guess your best chance would be to ask the makers of the control what to do.
I strongly doubt that someone here even has the same control in use...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
i used it in my program. its langauge is my country's langauge but i need to change it to English.
need help.
thank
|
|
|
|
|
hi, i have a windows service and its has a config file app.config now what ever chages i have to do windows services is through this config file.now is there a way so that i can give a G.U.I to the config file. and chage the parameter of config file from the G.U.I.
if poosible can u provide me a small code if not u may just give me logic.
thanx.
|
|
|
|
|
1) Open file
2) Find XML Node
3) Update node and/or attribute
4) Save file
5) Close file.
only two letters away from being an asset
|
|
|
|
|
Hi,
I'm displaying my records in a datagrid.When I'm selecting a particular record,the I level(Parent Record is not been updated in the respective fields).Instead when I select the child table,I can be able to update the record.
Can anyone let me know the cause for this?
Thank you,
Sincerely,
Deepa!
|
|
|
|
|
could u be more specific about the problem?
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
|
Hi there,
I am new to the graphics section of C#.
I wanted to change the monochrome bitmap to byte array and send the pixel data to the serial thermal printer.
When i convert the bitmap to byte array, the first two byte i get is 13780 instead of 19778 (representation of BM as per bitmap specs). I used the following code as reference:
ImageData = ConvertImageToByteArray(bmp,System.Drawing.Imaging.ImageFormat.Png);
private static byte[] ConvertImageToByteArray(System.Drawing.Image imageToConvert,ImageFormat formatOfImage)
{
byte[] Ret;
using (MemoryStream ms = new MemoryStream())
{
imageToConvert.Save(ms,formatOfImage);
Ret = ms.ToArray();
}
return Ret;
}
if i call the above function as below
ImageData = ConvertImageToByteArray(bmp,System.Drawing.Imaging.ImageFormat.<b>Bmp</b>);
then all the byteArray is filled with 0;
What am i doing wrong? Or is there any other approach for doing this? Any solution and suggestion will be appreciated.
|
|
|
|
|
MacMohan wrote: the first two byte i get is 13780
How do you calculate that value?
---
b { font-weight: normal; }
|
|
|
|
|
I display the byteArray in the textbox.
|
|
|
|
|
Yes, but how do you turn the two first bytes into that value?
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
Try using this code to copy the bytes form a bitmap to a byte array:
<br />
public byte Copy(Bitmap img)<br />
{<br />
BitmapData imgData = img.LockBits(new Rectangle(0, 0, img.Width, img.Height), ImageLockMode.ReadWrite, img.PixelFormat);<br />
IntPtr scan = imgData.Scan0;<br />
byte[] buffer = null;<br />
if (img.PixelFormat == PixelFormat.Format24bppRgb)<br />
buffer = new byte[img.Width * (img.Height / 3) * 3];<br />
else<br />
buffer = new byte[img.Width * (img.Height / 3) * 4];<br />
Marshal.Copy(scan, buffer, 0, buffer.Length);<br />
img.UnlockBits(imgData);<br />
return buffer;<br />
}<br />
<br />
Hope it helps<br />
Do your best to be the best
|
|
|
|
|
I am looking for a solution for intercepting or redirecting the STDOUT to a stream or in the end to a TextControl. For redirecting STDOUT of another process or Console.Out I found a lot of solutions, but that wasn't working with my problem.
In my scenario the C# application calls some functionality from an unmanaged DLL. The unmanaged function produce normally a lot of console output. My idea was to hide the console and redirect the STDOUT and perhaps the STDERR to a StringWriter and further to a multi line TextControl.
Setting a StringWriter via Console.SetOut only works for Console calls, but not for the unmanaged stuff from the DLLs.
After some more investigation I found the Win32 console functions likes SetStdHandler. Currently it seems to be the solution for my problem. But now I do not know, how to get a "FileHandle" from a StringWriter Stream and I do not want to use a FileStream for it.
Does anybody has an idea or knows another way of redirecting the STDOUT to a StringWriter or a TextControl?
Thanks in advance,
Lars
|
|
|
|
|
Have you looked at the System.Diagnostic.Process class? It has some methods on it to redirect standard output.
|
|
|
|
|
I believe System.Diagnostic.Process only lets you redirect the STDOUT of a child process. His parent process (C#) is running unmanaged code that writes to the console but not via Console.Out.
|
|
|
|
|
You are right on this. With System.Diagnostic.Process you can only read StandardError and StandardOutput and write to StandardInput of the child process, which System.Diagnostic.Process has started.
|
|
|
|
|
If you use C++/CLI, you could write wrapper code. I did not write wrapper code below. However, it is just a demo on how you can integrate manage and unmanage code in C++/CLI
#pragma unmanaged
#include <iostream>
#include <sstream>
#include <string>
class Foo
{
public:
Foo()
{
std::wcout.rdbuf(ostr.rdbuf());
}
void UnmanagedOut()
{
std::wcout << L"George";
}
std::wstring Redirect()
{
return ostr.str().c_str();
}
private:
std::wostringstream ostr;
};
#pragma managed
using namespace System;
int main(array<System::String ^> ^args)
{
Foo foo;
foo.UnmanagedOut();
String ^out = gcnew String(foo.Redirect().c_str());
Console::WriteLine(out);
return 0;
}
|
|
|
|
|
This looks like a nice idea, but this approach will only redirect cout or wcout stream of C++ into a string. But probably anything written via printf to STDOUT and STDERR won't be intercepted.
Another point could be that the unmanged code resides within a DLL, so using this approach won't probably help anyway, because the cout stream is already linked to the underlying API calls. And changing the DLL is a no-go. That makes the problem so difficult.
|
|
|
|
|
Yes, I haven't verified that this will work and I know that it won't capture printf output. However, if you can get this to work then cerr STDERR and printf STDOUT/STDERR would be easy to redirect via a C++ wrapper.
The C++/CLI wrapper assembly will be compiled and linked using your 3rd party unmanage library. Thus, it should have direct access to unmanaged STDOUT/STDERR for redirection. So, instead of get the managed code to redirect, you let the unmnanaged code in the wrapper do the redirecting. Nevertheless, I don't have experience of this working. Also, I heard mention of redirecting STDOUT/STDERR to a pipe in my Google Searches.
Also, I found this code (I don't know how useful it is) doing a Google search:
http://www.123aspx.com/rotor/RotorSrc.aspx?rot=40353[^]
|
|
|
|
|
I just want to confirm that I did get the cout STDOUT to redirect to a string buffer. I created a DLL that outputs to the console via wcout. Then, I created a C++/CLI wrapper of that code in a managed assembly. I referenced the C++/CLI managed assembly in a C# application which received the redirected output into a System.String object.
|
|
|
|
|
I am populating a gridview table with an asp:SqlDataSource and get the data in my codebehind this way:
int ID = (int)ListEmps.SelectedDataKey.Values["EmpID"];
int UnitNum = (int)ListEmps.SelectedDataKey.Values["UnitNum"];
string Unit = ListEmps.SelectedDataKey.Values["UnitType"].ToString();
string FName = ListEmps.SelectedRow.Cells[3].Text;
string LName = ListEmps.SelectedRow.Cells[4].Text;
And I know it retrieves the data properly. I need that data to be used in another .aspx/.aspx.cs file to define some asp:labels. I understand how to do this with SQL using Request.QueryString[], but I'm not sure how to do it with the GridView.
Thanks!!
K. Garl
Intranet Web Coordinator
|
|
|
|
|
kgarl wrote: I understand how to do this with SQL using Request.QueryString[]
and how do you use a QueryString in SQL?
You need to use the same data on two or more forms? Get it from the same source, such as a business or data layer object.
only two letters away from being an asset
|
|
|
|
|
Nevermind. I figured out how to do it last night. Thanks.
K. Garl
|
|
|
|
|
I am wondering about MS Power Point. How does power point keep track of all its slides on the left side, where does it stores all the slides. Does it rewrite everything again on the left side slide when we open a power point file. Can some body tell me in details. Thanks
|
|
|
|