|
Ok it's because of the VirtualMode property that i can't set the cell.value so easily.
But how can i set the cell.value if the cell is not databound?
|
|
|
|
|
Ok i've given up on virtual mode.
now i search for an event that occurs at the same time like newrowneeded
|
|
|
|
|
hi
at first excuse me because of my poor english i have written a program for sending an image or for video conference via internet with sockets and i am using tcp protocols my problem is that when i test program on my computer it works fine but when i test it over internet with between two pcs the reciver cant recieve image correctly minwhile i am using dial up
connection i dont know where is the problem perhaps it is because of low speed of internet i changed the buffer size to 512 1024 4096 and it didnt change. or i maybe should compress or encode image i dont know .please please help me with this problem.
here is the code for sending an image :
private void button2_Click(object sender, EventArgs e)
{
byte[] bytes;
using (MemoryStream ms = new MemoryStream())
{
pictureBox1.Image.Save(ms,ImageFormat.Jpeg);
pictureBox2.Image = pictureBox1.Image;
bytes = ms.ToArray();
ms.Close();
}
startcapturing(bytes);
}
private void startcapturing(byte[] bytes)
{
int i = 0;
byte[] dataBuffer = new byte[128];
int index = 0;
byte[] loop = new byte[128];
loop = System.Text.Encoding.ASCII.GetBytes(((bytes.Length / 128) + 1).ToString());
label4.Text = ((bytes.Length / 128) + 1).ToString();
if (serverSocket != null)
{
try
{
rc = clientSocket.Send(loop, SocketFlags.None);
while(i<bytes.length)
{
="" for="" (index="0;" index="" <="" databuffer.length;="" index++)
="" if="" (i="">= bytes.Length)
{
dataBuffer[index] = 0;
}
else
{
dataBuffer[index] = bytes[i];
i++;
}
}
rc = lientSocket.Send(dataBuffer,SocketFlags.None);
}
}
catch (Exception err)
{
MessageBox.Show(err.Message.ToString()+"here");
}
}
}
here is the code for client to recieve image:
if (clientSocket != null)
{
while(true)
{
while (true)
{
int counter = 0;
msr = new MemoryStream();
byte[] recv = new byte[128];
try
{
rc = clientSocket.Receive(recv, SocketFlags.None);
try
{
counter = Convert.ToInt32(System.Text.Encoding.ASCII.GetString(recv, 0, recv.Length));
}
catch { }
while (counter > 0)
{
rc = clientSocket.Receive(recv, SocketFlags.None);
counter--;
msr.Write(recv, 0, recv.Length);
}
}
catch (Exception e)
{
}
try
{
pictureBox1.Image = Image.FromStream(msr);
msr.Close();
}
catch(Exception e)
{
}
break;
}
}
}
else
{
StatusLabel1.Text = "Unable to establish connection to server!";
BtnDC_Click(null, null);
}
}
i beg you help me
|
|
|
|
|
I don't understand the full code, but I must say the problem is probably with the send or the Receive.
I am not sure if the Send can send partial data, but receive surelly do.
For example: You send 128 bytes.
The connection is local, you get 128 bytes.
But, if the connection is remote, you can:
Receive 10 bytes.
Then, receive 20 bytes.
+ 10 bytes... until you finally receive all the buffer (the 128 you expected).
So, you must check this.
Also, I think a better approach is:
Instead of writing everything to a memorystream and them sending the memorystream buffer, get the socket stream (socket.GetStream()) and save the image directly to the socket stream.
Then, on the other side, call Image.FromStream(socket.GetStream())
|
|
|
|
|
thanks sockets doesnt have Getstream() methode only tcp client has it
please if you guide me write more cause i am new to c#
thanks in advance
|
|
|
|
|
Well... I usually use sockets by TcpClient in C#... but, the same way, I am not sure about send, but when reading, you must do something like this:
Instead of read(buffer, 0, 128)
you set:
int totalRead = 0
int count = 128;
while(count > 0)
{
int actualRead = socket.Read(buffer, totalRead, count);
if (actualRead <= 0)
throw new Exception("Connection lost");
totalRead += actualRead;
count -= actualRead;
}
|
|
|
|
|
ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
oh my god you solved my problem oh my god thank you thank you thanks
please please let me kiss your foot
i wont forget your name paulo zemek i wont forget you
thanks thanks a milion thanks a bunch
let me let me kiss your foot
i am really crying here
thanks thanks ..................................
................................................
.................................................
..................................................
...................................................
|
|
|
|
|
Hi,
I have coded few methods in C++ language. These methods are to be used in C#.NET . I guess I need to convert the .CPP file(C++ code) into DLL and then import the methods in C#.
I made a Win32 project and converted the exe(C++ code) into unmanaged C++ DLL.
Then I tried to call its method in C#.NET as :
using System.Runtime.InteropServices;
public partial class CDLL : System.Web.UI.Page
{
[DllImport("C:\\Project1\\TestProject\\Debug\\TestProject.dll", EntryPoint = "testMethod", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
public static extern void testMethod();
protected void Page_Load(object sender, EventArgs e)
{
testMethod();
}
}
After running the above code i am getting error like : Unable to find an entry point named 'testMethod' in DLL 'C:\Project1\TestProject\Debug\TestProject.dll'. Can any one suggest how to run the above code successfully.
Thanks.
|
|
|
|
|
Pranav Thakur wrote: After running the above code i am getting error like : Unable to find an entry point named 'testMethod' in DLL 'C:\Project1\TestProject\Debug\TestProject.dll'. Can any one suggest how to run the above code successfully.
Write a dll that exports testMethod, that's what the error is telling you.
I would also not use full paths, just let the dll be in the same dir as the exe.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
C++ mangles names. Declare your exported C++ functions like this:
extern "C"
{
__declspec(dllexport) int Function( ... );
}
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
I have a dll file. The dll file has functions like that
"typedef short apiStatus;
apiStatus __declspec(dllexport) __stdcall DrfCommOpen (HANDLE * hCom, char *com_port);"
how i can call and use this function in my c#.net application?
thanks in advance..
regards..
|
|
|
|
|
I got a bug in the application which is as follows
When i am doing login to my application, welcome window will come with the login name and at the same time the update page will also be shown minimized... at this time i can do the modification in name and i press the update button it will make the changes to the welcome window.. but when i close this update page and reopen the same.. and i perform the same task again. it is not getting updated in the welcome window..
Any idea for this bug to be cleared..
|
|
|
|
|
Fix your code. Hard to say more, based on your description. Post some code perhaps, explain how you've used the debugger to diagnose the issue, etc.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Im doing some operations in BackgroundWorker's DoWork event. So when I call the following line, it works good but when I call second one it shows "Cross-thread operation not valid" error.
backgroundWorker1.ReportProgress(((b + 1) * 100) / listView1.Groups[a].Items.Count, new object[] { 1, listView1.Groups[a].Items[b].SubItems[0].Text });
backgroundWorker1.ReportProgress(((b + 1) * 100) / listView1.Groups[a].Items.Count, new object[] { 1, listView1.Groups[a].Items[b].Index });
I know how to fix this error. But my question is why its not raising with first line ??
I tried with DGV and it works good.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
I am working on window application.
On a list view i am storing names of file.
when we double click a file in widows folder, the file gots open into its default application. (as suppose there is text file, and we click it, then it got opened in notepad).
Is there way to achieve the same with in application. So that user click on file name, and file got opened in its application.
any help/link much appreciated.
regards,
|
|
|
|
|
Hum Dum wrote: Is there way to achieve the same with in application. So that user click on file name, and file got opened in its application.
You mean associate a file with your app ? That's done in the registry, and your app needs to take a file path on the command line and open it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: You mean associate a file with your app ?
Not really......!!
when we double click a file say of any extension, it got opened in its application(which is associated with it).
i just want that. I am storing filename only (file remain in a folder), and wants when user click on the filename. It got opened.
Or say just making a list of file present in specific folder(wheteher its .txt, .rtf, .doc, .pdf etc).
Now just wants whenever user click on particular filename, it got opened(not go to that folder and fron there open that file).
regards
|
|
|
|
|
There is an article here at CP which shows how to do file association. Search for it.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Not really......!!
when we double click a file say of any extension, it got opened in its application(which is associated with it).
i just want that. I am storing filename only (file remain in a folder), and wants when user click on the filename. It got opened.
Or say just making a list of file present in specific folder(wheteher its .txt, .rtf, .doc, .pdf etc).
Now just wants whenever user click on particular filename, it got opened(not go to that folder and fron there open that file).
|
|
|
|
|
That is called "associating a file extension with your app"
really.
you got the right answer twice.
And if you are going to contradict the truth one more time, you're a moron.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
I don't think he wants to associate a file extension with his program, I think he wants to be able to open an external file in the appropriate program.
Hum Dum, if I'm correct you just need System.Diagnostics.Process.Start(). So if you have a file at C:\testfile.txt and you want to open it in Notepad you could just do something like this:
System.Diagnostics.Process p = new Process();
p.StartInfo = new System.Diagnostics.ProcessStartInfo("C:\testfile.txt");
p.Start();
|
|
|
|
|
Thanks for reply.
hollismarek wrote: I think he wants to be able to open an external file in the appropriate program.
Absolutly correct.
But one question related to this process,
Is it going to slow or create any overhead on my application ?
as user will click many times to open a file.
for that i have to run each time this.
|
|
|
|
|
If you dispose of the process object after calling Start I think you should be ok.
|
|
|
|
|
Luc Pattyn wrote: you're a moron
I suppose this forum is for help, not for shouting
I am just clearing my doubts,
If its related with file association, then i will do it.
But for just opening a file doing all this association ??
I am just looking for simple solution.
But with reply like that...
"I am understanding how mature you are...!!"
|
|
|
|
|
I am working on this application(asp.net 1.1,sql server 2000) that has a huge database , in the frontend there is a provision
to generate a csv file by running a stored procedure which can fetch 50000 records(approx), to acieve this I've used the
following:-
1) running forloop iterating through the dataset and creating a comma separated string, then creating the csv file, but this
process slows down the server immensely when data fetched is huge.
2) DTS packages is failing, because when I am creating a new package and click the defeine column button, the SQL Enterprise
manager just closes itself after a few seconds.
3) BCP command, sometimes works sometimes does not. The code used for running bcp in C# is :-
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = "bcp";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.Arguments = @"""exec ETH11.dbo.usp_DownloadInvoiceforDalkia "" queryout ""D:\NewLookLogs\Invoice.csv"" -c -t ,
-T -S";
proc.StartInfo.Arguments = proc.StartInfo.Arguments.Replace("usp_DownloadInvoiceforDalkia ","usp_DownloadInvoiceforDalkia
"+"'"+xSupplierID+"',"+"'"+xBuyerID+"',"+"'"+xFromDate+"',"+"'"+xToDate+"',"+"'"+xType+"',"+""+xCurrentOnly+","+""+xDateType+
","+""+xStatus+","+""+xAllStatus+","+""+xContentType+","+"'invoice.csv',"+"'"+Session.SessionID+"'");
proc.Start();
proc.WaitForExit();
|
|
|
|