|
The ThreadStart delegate returns void, so you can't return anything. Look for the BeginInvoke/EndInvoke methods, they allow you to return a value. Or you can use a shared variable to do the job.
Regards
Senthil
|
|
|
|
|
Hi everyone, i need to ask about reading true color image in C#. Thank you
|
|
|
|
|
Read the MSDN. Search on google. The bit depth is irrelevant, C# can read them all.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I’m successfully using SystemTimeToTzSpecificLocalTime to continuously update the local time in a specified time zone. Successfully, that is, until I open another form (using the showdialog method). Once the showdialog method is invoked, the SystemTimeToTzSpecificLocalTime fails continuously --- even after the second form is closed. Same results using the show method. Any ideas?
BTW, this is on Windows XP using Visual C# Express (Beta 1).
Thanks.
|
|
|
|
|
Continuing the thread started here
http://www.codeproject.com/script/comments/forums.asp?forumid=1649&fr=26&select=1039197#xx1039197xx
i would understand something more about windows shell integration.
I've serched on codeproject, on msdn and on google, but i haven't got no good information about.
Can someone show me some good tutorial or explaination?
|
|
|
|
|
What is the practicle way of assigning an array of const values, such as the followiing code does in Visual C++ (6.0):
const double RX_TEST_FREQ[] = {136.15, 155.15, 173.95};
TIA!!!
|
|
|
|
|
You can't declare a const array in C# in the same meaning as in C++. You can declare
readonly double[] RX_TEST_FREQ = new double[] {136.15, 155.15, 173.95};
That would make code like RX_TEST_FREQ = new double[10] invalid, but will still allow RX_TEST_FREQ[1] = 0. In other words, you can't change the array reference, but you can change the array contents.
Regards
Senthil
|
|
|
|
|
Much appreciated! Thanks again.
|
|
|
|
|
I have a Solution with two Projects. Each project has a Form with a Button. I want FormOne in ProjectOne can be opened by clicking the buttonToFormOne on FormTwo in ProjectTwo.
Solution
| |
ProjectOne ProjectTwo
| |
FormOne FormTwo
| |
buttonToFromTwo buttonToFormOne
My questions: How can I create an ProjectOne object in ProjectTwo, and then reference to FormOne?
Can I use " using ProjectOne.FormOne; " statement? Or how?
Thanks a lot.
|
|
|
|
|
You need to reference the project, then you should be able to make that using statement work.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
hi,
i made the event of Document_Opened(),
in the event im checking the file path and according to it i choose
to open or not the doc.
the problem is that if i choose not to open the doc,
i do Document.Close() - the doc is closed but not all of it, the
tab/window of the doc is still in the windows tab.
when i tried to close the doc manually with a button it worked just
fine.
the code is -
private void DocumentEvents_DocumentOpened(Document Document)
{
// check something
Document.Close(vsSaveChanges.vsSaveChangesPrompt);
return;
}
what seems to be the problem?!?!
|
|
|
|
|
Hi All,
Having some trouble selecting data out of a DataTable. Basically I have a column that contains names. Some names are prefixed with an asterisk (*) and some are not. I can't seem to come up with a query to be able to select either the prefixed names or the non-prefixed names. In SQL my queries look like this:
--without the prefix
select * from MyTable where Name not like '*%';
-- with the prefix
select * from MyTable where Name like '*%' ;
How can I achive this using the query syntax a DataTable accepts ? The asterisk (*) is a wildcard in the DataTable's query syntax language so MSDN suggests to escape it with a pair of brackets ([]) but I still can't get it to work. If someone could translate the above two SQL statements into the query syntax the DataTable's Select() method understands it would be much appreciated. Thanks in advance...
|
|
|
|
|
Select * from MyTable where substring(Name,0,1) = '[*]'
Select * from MyTable where substring(Name,0,1) <> '[*]'
Just an untested guess...might not need {} in this case, since not a LIKE statement
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
Thanks Robert this seemed to have done the trick for me
-Peter
P.S.: Love you sig...
|
|
|
|
|
I am using "CreateProcessWithLogonW" in my code. it works fine it runs the application as intended, up to the point that returns a process in code.
My problem is: Since I am impersonating another user, Access to the process is denied. I need to add the "Exited" event to this process, but I keep getting the "Access denied" message.
Thank you for any help I can get.
|
|
|
|
|
Keep in mind you have to turn on Process.EnableRaisingEvents before receiving any events. That said, I'm not sure if you'll actually receive an Exited event since the process never launched successfully.
*edit* whoops, forgot you were using P/Invoke. Can you put a try/catch statement around your call to logon with credentials? That would tell you if it wasn't launched successfully AFAIK. You won't be able to hook into any events since this isn't a .NET Process object; you could however check for the existence of the process on some interval, then raise your own event when discovered the process is not running.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
Thank you for your reply.
My process runs fine. I get and id back and I use the getprocess method to get the process. but when it hit the code Process.EnableRaisingEvents or any Process.(something) it gives me an Access denied message. But if i impersonate myself, it works fine.
this is the code:
bool ret = true;
ret = CreateProcessWithLogonW(m_username, m_domain, m_password, (int)LogonFlags.WithProfile,null,m_sb, (uint)PriorityFlags.NormalPriority | (uint)CreationFlags.UnicodeEnvironment, IntPtr.Zero,"c:\\", ref m_sui, out m_pi);
if(ret)
{
System.Diagnostics.Process p = System.Diagnostics.Process.GetProcessById(m_pi.dwProcessId);
p.EnableRaisingEvents = true; "FAILS IN THIS LINE"
}
|
|
|
|
|
I used http://www.codeproject.com/cs/media/perpxalpha_sharp.asp to create a non-rectangular window.
Then I tried to add a Label Form, but that didn't work (didn't show up). Therefore I thought that this maybe wouldn't be possible when you have a this type of window and tried directly to draw strings in my loaded bitmap:
<br />
Graphics g = Graphics.FromImage(newBitmap);<br />
newBitmap.Dispose();<br />
Font font = this.Font;<br />
Brush brush = new SolidBrush(Color.White);<br />
g.DrawString("Hallo wie geht es dir?",font,brush, 50,50);<br />
g.DrawImage(newBitmap,0,0);<br />
bitmap = newBitmap;<br />
newBitmap contains the loaded png (with alpha mask) image.
The assignment of bitmap seems to crash (System.ArgumentException) because I disposed newBitmap. But why? I however assigned newBitmap again with g.DrawImage...
|
|
|
|
|
Draw image does not assign a bitmap, I'm suprised it isn't crashing on you at g.DrawImage line.
Don't dispose the newBitmap until you're really done with it; or dispose it, then assign it again with
newBitmap = new Bitmap() .
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
|
Hi this is my code -
<br />
printDialog1.Document = new TextPrintDocument();<br />
printDialog1.ShowNetwork = true;<br />
printDialog1.ShowDialog();<br />
but it only show my default printer in the dropdown?? (all the printers installed on my machine are network printers including the default one). I need to display all available printers so that the user can make a selection of where to print. Any ideas or help will be greatly appreciated. Thanks
|
|
|
|
|
i need to create a new treenode object, with 2 or 3 images before the text; i'm not sure about the way to take:
1) create a control that inherits from treenode and draw it;
2) create a control that inherits from treeview and change its draw (this way is more complex and the time, as always, is poor)
3) any other idea ?
thanks for your suggestions
luke
|
|
|
|
|
Hello friends,
I would like use CurrentCellChanged event for navigating the next cell of a datagrid?Can anyone help?
Code like this:
private void dgRegion_CurrentCellChanged(object sender, System.EventArgs e)
{
dgRegion.Select(dgRegion.CurrentCell.RowNumber);
//how can I navigate the next cell...Suppose that I am at the last column
//then how can I pass the next line and first column.
}
|
|
|
|
|
first u have to change the selected row
u can do this by accessing the SelectedRowIndex.
Mr.Cooper
|
|
|
|
|
Please friend...I HAVE PASSED THREE HOURS HERE...I TRIED EVERYTHING...PLEASE HELP..HOW?
|
|
|
|