|
System.IO.
VS2005 helps you, if you type in Path, then put the mouse near the h, there's an arrow, which offers to add te using statement or to scope the specific statement.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi All,
I am using SmartClient Factory Shell form with runtime Menu Editor...If i click once File menu editor's sub menu is New Contract Screen.and if i click a New contract screen..then open New Contract Screen in the Tab control... But only once..
But i want only once open in the Tab control..If click agin New contract Screen Sub menu..But sholud not come again...So please How to do..
Regards
Somasundaram G
I want to join in the website
|
|
|
|
|
hi everyone,
I get 'Microsoft.Jet.OLEDB.4.0' provider is not registered error when i try to connect to MsAccess database from C# app. How can i solve this error.
thanks in advance
|
|
|
|
|
Install Access, MDAC, or something else that gives you that provider.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Sorry i forgot to mention that i am using Vista x64 and i have Ms Office 2007 installed on my PC
|
|
|
|
|
Install It[^]
Best Regards
-----------------
Abhijit Jana
"Success is Journey it's not a destination"
|
|
|
|
|
Hi Friends,
I have worked in Asp.net with Vb.net for 2 yrs. I have actainted with c,c++,java.Now i have shifted to another company.They are using C# completely.I have to learn C# as soon as possible.I have to learn C# in 7 days.My project is going to be started with in week. Even language is not barrier for any programmer.But it is need to learn the language for good work.Can u please proved some good links for learn c# as soon as possible.
and more thing is i have to learn design patterns.So can u please provide some links which are good one to learn quickly.
Thank you very much
Your help is appreciable
Regards
Kishore
|
|
|
|
|
kishorekumar.malla@live.com wrote: I have to learn C# in 7 days
Well, if you know VB, there's not much to learn. C# is strongly typed, apart from that, you should find it's often the same. I answer VB.NET questions all the time based on my C# knowledge, I never use VB.
kishorekumar.malla@live.com wrote: and more thing is i have to learn design patterns.
Well, this could be scary. You should buy the GoF book ( Design Patterns is it's name ), but I would be scared of a workplace that told you to 'learn design patterns in a week'. That's not really possible, and they can be over used and over rated.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
kishorekumar.malla@live.com wrote: Can u please proved some good links for learn c# as soon as possible.
www.codeproject.com
|
|
|
|
|
kishorekumar.malla@live.com wrote: Can u please proved some good links for learn c# as soon as possible.
If you decide to go with a book, I would recommend "Accelerated C# 2008." If I only had a week to learn such a broad subject, I'd rather have a printed reference I can flip through and carry around with me 24/7 rather than trying to piece together enough half-way decent references online.
As for "Accelerated C#," the description from Amazon is spot on:
Who is this book for?
If you’re an experienced C# programmer, you need to understand how C# has changed with C# 2008. If youre an experienced object–oriented programmer moving to C#, you want to ramp up quickly in the language while learning the latest features and techniques.
ssclaire
|
|
|
|
|
Two things make this a huge headache to solve. One problem is that when I get the error, it doesn't tell me when it occurs all the time. The other, I can't debug without Visual Studio very well.
Now, the error I get is an Access_Violation. I only know what line of code this occurs at if I try to run in fullscreen.
Here is the relavent code:
private void CreateDevice(Control Target)<br />
{<br />
int iAdapter = Manager.Adapters.Default.Adapter;<br />
<br />
presentparameters = new PresentParameters();<br />
#if DEBUG<br />
presentparameters.Windowed = true;<br />
#else<br />
presentparameters.Windowed = false;<br />
presentparameters.BackBufferCount = 1;<br />
presentparameters.BackBufferWidth = 800;<br />
presentparameters.BackBufferHeight = 600;<br />
presentparameters.BackBufferFormat = Manager.Adapters.Default.CurrentDisplayMode.Format;<br />
Target.Cursor.Dispose();<br />
#endif<br />
presentparameters.SwapEffect = SwapEffect.Discard;<br />
presentparameters.PresentationInterval = PresentInterval.Immediate;<br />
<br />
CreateFlags flags;<br />
Caps caps = Manager.GetDeviceCaps(iAdapter, DeviceType.Hardware);<br />
if (caps.DeviceCaps.SupportsHardwareTransformAndLight)<br />
{<br />
flags = CreateFlags.HardwareVertexProcessing;<br />
}<br />
else<br />
{<br />
flags = CreateFlags.SoftwareVertexProcessing;<br />
}<br />
<br />
if (caps.DeviceCaps.SupportsPureDevice)<br />
{<br />
flags = flags | CreateFlags.PureDevice;<br />
}<br />
<br />
device = new Device(iAdapter, DeviceType.Hardware, Target, flags, presentparameters);<br />
<br />
device.DeviceResizing += new System.ComponentModel.CancelEventHandler(OnDeviceResizing);<br />
}
Thanks for any help, feel free to ask for more code if you need it.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Does it work it windowed mode?
Try changing the Target object type to a Form instead of a Control (not sure if this will make any difference).
Otherwise have a look at this article:
http://www.codeproject.com/KB/directx/InitialisingDirect3D.aspx
And see if that works. If it does then you can narrow down the problem.
|
|
|
|
|
Hello,
First of all, I do realise that the following description is incomplete and it is probably impossible to deduce the exact causes of the problem from it -- the code I'm working on is simply too long to post here in full. I would, however, be very grateful for any hints on how to debug it, or pointers to useful resources on the subject.
Here's what I'm struggling with:
I'm working on an RSS aggregator in C#. As the network functions are blocking, I use a separate thread for updating the feed subscriptions. The update function generates events which are then caught by each notification 'subsystem' (popup notifiers, tray icon and context menu for now). Realising that UI controls have to be updated from the thread they were created in, I added appropriate InvokeRequired clauses everywhere an event cause the UI to update -- as described in MSDN help. The manual suggests that this should solve the problem but despite that the program crashes frequently. I get the following exception:
<br />
Cross-thread operation not valid: Control '' accessed from a thread other than the thread it was created on.<br />
The error occurs when I click on the tray icon just after the feeds have been updated, presumably when the events are still propagating (new items are individually added to the context menu, in the tests I'm using there can be up to about 150 of them).
I also looked through a more extensive guide on the subject of threads in general 'Multi-threading in .NET: Introduction and suggestions' (http://www.yoda.arachsys.com/csharp/threads/) but nothing useful came up.
Here's an example of event handler (taken from the tray icon context menu class):
<br />
private delegate void subscriptions_FeedsUpdatedCallback(object sender, FeedsUpdatedArgs e);<br />
<br />
void subscriptions_FeedsUpdated(object sender, FeedsUpdatedArgs e)<br />
{<br />
if (this.InvokeRequired)<br />
{<br />
var d = new subscriptions_FeedsUpdatedCallback(subscriptions_FeedsUpdated);<br />
this.BeginInvoke(d, new object[] { sender, e });<br />
}<br />
else<br />
{<br />
HideInfoItem();
<br />
foreach (var menu in FeedMenus)
menu.Visible = true;<br />
<br />
foreach (Subscription feed in subscriptions.Channels)<br />
{<br />
ToolStripMenuItem menuItem = (ToolStripMenuItem)(this.Items.Find(feed.Name, false))[0];<br />
foreach (Rss.RssItem newitem in feed.NewItems)<br />
menuItem.DropDownItems.Add(newitem.Title);<br />
}<br />
}<br />
}<br />
I think that's the most relevant code snippet I can provide, I would be more than happy to provide others as needed.
I'm at my wits end as to how this issue should be fixed. One workaround that came to me was to introduce event buffering for each subsystem, with explicit yields to the GUI thread but as I don't fully understand why the errors occur, I can't be sure if that would help at all.
How should I proceed?
TIA,
Gre
|
|
|
|
|
Jergosh wrote: Cross-thread operation not valid: Control '' accessed from a thread other than the thread it was created on.
You can actually turn this error off if you want to, but it makes more sense to work around it. The way I do it is to do threading with the BackgroundWorker class, and to use the reportProgress method to fire a message back to the main thread, which then is where I update UI.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I've seen the exception thrown when you are calling BeginInvoke on a control that has been instantiated but has not yet become visible. .NET 2.0 apparently creates the backing Win32 handle lazily, when the control is about to become visible for the first time, and if you happen to call Invoke/BeginInvoke before it, it fails with that error.
Can you try accessing the
Handle in the constructor of that control? This forces creation of the underlying handle. <br />
<br />
<div class="ForumSig">Regards<br />
Senthil [MVP - Visual C#]<br />
_____________________________<br />
<font face="Verdana" size="1"><a href="http://msmvps.com/blogs/Senthil">My Blog</a> | <a href="http://www.codeproject.com/script/articles/list_articles.asp?userid=492196">My Articles</a> | <a href="http://www.flickr.com/photos/senthilkumar/">My Flickr</a> | <a href="http://geocities.com/win_macro">WinMacro</a></font></div>
|
|
|
|
|
S. Senthil Kumar wrote: I've seen the exception thrown when you are calling BeginInvoke on a control that has been instantiated but has not yet become visible. .NET 2.0 apparently creates the backing Win32 handle lazily, when the control is about to become visible for the first time, and if you happen to call Invoke/BeginInvoke before it, it fails with that error.
This sounds very promising as the controls are indeed hidden -- do you know if this bug applies to .NET 3.5?
Cheers,
Greg
|
|
|
|
|
Hi I have just started learning C#
I have installed Visual studio 2005
when I tried to run a C# program,got an error csc is not recognised
I dont know what to do
I tried to google it
got response To fix this problem, execute the batch file corvars.bat located
in the bin directory of the SDK. Change directories to the Framework
SDK root directory, normally installed in the directory \Program Files\
Microsoft.NET\FrameworkSDK\bin. Execute the batch file by typing
corvars on the command line. Now change directories back to where
your program is saved and compilation should be successful
i tried my best but no result
Plz help
Regards
Kuldeep
|
|
|
|
|
Use the visual studio command prompt and not the regular command prompt.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
From where you are executing Csc Command ?
Best Regards
-----------------
Abhijit Jana
"Success is Journey it's not a destination"
|
|
|
|
|
Hello
I've made tho following function in a form to avoid to open severall instance a child form dialog
It works fine but I do'nt know how to check if the user ave close the form from itself!
Because in such situation FrmZTour remain not null and I got an error !
private void ShowForm(DataTable dtDagChauff)<br />
{<br />
if (FrmZTour == null )<br />
{<br />
FrmZTour = new FrmDgvZoomTour();<br />
FrmZTour.SelectTour += new FrmDgvZoomTour.SelectTourHandler(DgvTourSelected);<br />
FrmZTour.Show(this);<br />
}<br />
<br />
FrmZTour.FillDgv(dtDagChauff);<br />
}
|
|
|
|
|
EDIT: Forget that, apparently you can't re-show a form after its closed. But i did find the solution, the form should have an IsDisposed property, so you need to check that as well:
if(FrmZTour == null || FrmZTour.IsDisposed)
That should sort it out.
My current favourite word is: Bacon!
-SK Genius
Game Programming articles start - here[ ^]-
modified on Monday, May 12, 2008 8:28 PM
|
|
|
|
|
Thank you
Finaly I did adapt your first sugestion
<br />
private void ShowForm(DataTable dtDagChauff)<br />
{<br />
if (FrmZTour == null )<br />
{<br />
FrmZTour = new FrmDgvZoomTour();<br />
FrmZTour.SelectTour += new FrmDgvZoomTour.SelectTourHandler(DgvTourSelected);<br />
FrmZTour.Closed += new EventHandler(this.formClosed);<br />
FrmZTour.Show(this);<br />
}<br />
<br />
FrmZTour.FillDgv(dtDagChauff);<br />
}<br />
private void formClosed(object sender, EventArgs e)<br />
{<br />
FrmZTour.Dispose();<br />
FrmZTour = null;<br />
}
|
|
|
|
|
It has a Visible property.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I'm trying to build a high performance windows application that does basic calculations on many different data sets. Can anyone explain to me why this always returns false???
int[] x = new int[10] { 10015, 10, 9, 8, 7, 6, 5, 4, 2, 2 };
int[] y = new int[10] { 10015, 10, 9, 8, 7, 6, 5, 4, 3, 2 };
if (x.Equals(y)) return true;
else return false;
I'm pretty sure that .Equals is comparing the ADDRESS of the two arrays, as opposed to the values. Can someone help me out on what the fastest way of comparing these arrays?? no looping is HIGHLY preferred.
|
|
|
|
|
shamidi wrote: no looping is HIGHLY preferred.
Depends on what level you want that to occur on. Using LINQ there's no "looping" on the surface but it'll translate into a loop.
You have to face facts, you've got an array of data, you have to loop to do anything useful with it.
In response to your first point, Equals is comparing the addresses but because you're initialising them independently they are in fact in two different blocks of memory, thus not the same.
It would return true (I think) if you did:
int[] x = new int[10] { ... };
int[] y = x;
return x.Equals(y);
See that last line? What you've just done there is a coding horror (check the forums), your comparing a bool to return a bool You can simplify the code (and the resulting assembler) by doing what I did.
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|