|
Thank you Dave, thats the answer I was looking for. I was confused about it, now I am clear.
|
|
|
|
|
I agree, however that also tells me the compiler should reject the code as it cannot possibly make sense.
|
|
|
|
|
Another one for MS to consider.
|
|
|
|
|
It can't figure it out because if license is declared before the using but not necessarily instantiated, it can still be used to instantiate another object after the using block.
|
|
|
|
|
Emran Hussain wrote: will get null object
No, not null, but it should be unusable -- however that depends on what the Dispose method actually does.
I write Dispose methods for a lot of things, not all of them leave the instance unusable.
|
|
|
|
|
Hi,
Thanks for your reply. I just started learning to use Dispose method and I am highly confused about one thing. WHY Microsoft created this new pattern when the Class Designer can put all memory cleaning logic in the Destructor of the class ? Because it is very easy to miss calling Dispose method for a new programmer and I have seen hundreds to source code where programmers are not calling dispose method or using 'using contruct' for Stream operations. Even in the popular open source library 'HtmlAgilityPack', I dont see the programmers are Calling Dispose method in Stream operations.
==> Also, I am wondering, even the Windows Form generated Code in Main method in Prgram.cs file in any Windows Application, the Entry Point Form is invoked without using 'using construct'. So, can you please give me any light about it please !
Regards.
|
|
|
|
|
To clean things up before the destructor gets called?
|
|
|
|
|
Dear Sirs,
I have a program that takes command-line arguments. The ordinary method of ingestion is drag-n-drop. So, you drag a (DICOM|*.dcm) file (or more) onto my program, it reads them and processes them without showing a form. No problem. A coworker pointed out today that the program doesn't work with "twelve or so" files. I tried it and can get 23 items to work, but adding the 24th screws it up. The error message is a simple msgbox saying:
"Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item." With the full path to the application in the title-bar.
My guess is that he was using rather deeply-nested or long-named files. I'm thinking what's happenning is that the shell is somehow not getting the program path correct with lots of parameters?? the parameters somehow obstructing the filename?? I checked it out and when I get the twenty-three items to work, the command-line length (with full program path) is 2,075 characters. Raymond[^] has lots to say about it, but my length isn't close to what he talks about: Nowhere near 32767, over 2048, and not near 8192, and well over the dos limit of 127.
I could do something creative if my program would just run, but it never gets to sub Main().
If anyone has had this problem before, please give me sympathy. Even better, if someone knows how to work around or fix this problem, please let me know!! I've searched the web for a while and nothing came up. I was sure to check this forum to avoid double-posting. Thanks!
Aaron
In Christ,
Aaron Laws
http://ProCure.com
|
|
|
|
|
Raymond wrote: If you are using the ShellExecute/Ex function, then you become subject to the INTERNET_MAX_URL_LENGTH (around 2048) command line length limit imposed by the ShellExecute/Ex functions.
Think about it, dragging files from Explorer and dropping them onto your application requires something to start the application. I would venture to suggest that Explorer uses ShellExecute/Ex to do just that, hence the 2048 character limit.
It's time for a new signature.
|
|
|
|
|
Dear Mr. MacCutchan,
Good catch. This doesn't exactly explain the fact that I was able to get 2,075 characters into the command line. Well, either way, I still have a limit, even if it's not the 2048 limit, that I'm hitting. Thanks for your comment.
In Christ,
Aaron Laws
http://ProCure.com
|
|
|
|
|
you should not take 20 or more RX'es for a single patient, medical costs are skyrocketing as it is, nor mix pictures from different patients in a single run of some app, to avoid mix-ups.
|
|
|
|
|
Dear Mr. Pattyn,
Thanks! I'm anonymizing.
In Christ,
Aaron Laws
http://ProCure.com
|
|
|
|
|
Not sure if there is a way around that limitation. That is, I'm not sure there is a way to drag-drop a virtually unlimited number of files and have them processed via command line. Instead, however, you could modify the context menu that pops up when you select mutliple files and right click them. You could add an extra item that say something like "Process With MyApp". That command would then add all those paths to a text file and then you'd pass that text file (as a command-line argument) to MyApp.exe (it would then read all the paths from that text file). Never tried that myself though, so I'm not sure if there would be any problems with doing it that way.
|
|
|
|
|
Dear Mr. aspdotnetdev,
Thanks for your suggestion. I'd hate to have to modify that menu.... I was hoping for a stand-alone app that didn't require a setup of any sort. Maybe I can make an alternate version... oh well.
In Christ,
Aaron Laws
http://ProCure.com
|
|
|
|
|
Hi everybody!
Need a little help here...
http://yfrog.com/jx63488581j[^]
At the image u see a dialog window from ms access before and after u click "Objects" button.
I want to make something similar to this in a C# application, but dunno if there is actual control for that purpose, or I have to make it myself.
The idea is to have a number of buttons and when you click ONE of them you reveal a group of other "things".. buttons or other controls.. dunno, hope u got the idea
Thank you for the attention,
best regards Peter.
modified on Thursday, April 1, 2010 3:18 PM
|
|
|
|
|
First, no one is going to follow this link to look at your image.
Myzrael wrote: The idea is to have a number of buttons and when you click ONE of them you reveal a group of other "things".
Very easily accomplished, handle the button click event and show/hide the controls necessary.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: First, no one is going to follow this link to look at your image.
Because it doesn't work in the first place?
|
|
|
|
|
Now it works i hope.. sry
|
|
|
|
|
Mark Nischalke wrote: no one is going to follow this link to look at your image.
you're absolutely correct, the link does not work. 404
|
|
|
|
|
Mark Nischalke wrote: handle the button lick event
But I don't know where that button's been!!
|
|
|
|
|
Mark Nischalke wrote: First, no one is going to follow this link to look at your image.
Why not? I appreciate when people post links to images to help convey their question more clearly. Now, when they post links to zip files and such that contain code, that's an entirely different matter.
|
|
|
|
|
It's called a slide menu. It isn't used that much any more, mostly replaced by the ribbon control.
|
|
|
|
|
I have a Windows application in Visual Studio 2008. This application has data which I want to store in a database. I went into SQL Server Management Studio 2008 and created data tables which I want to access from Visual Studio.
I have clicked on Project, Add new item, Linq to SQL. I have a window open that's labelled DataClasses1.dbml. I clicked on Data and add new data source. In that tab I clicked on Add New Data Source. I clicked on Database and next. I clicked on New Connection and have a window open "Add Connection". I don't know what to do here. Can anybody help me?
Thanks.
Darrall
|
|
|
|
|
Choose the ConnectionType (OleDb, SQL, SQLCompact....)
Then choose the server or type it (if express edition then defult it is
something like .\SQLEXPRESS), then choose the DB, Test the Connection clikc
OK or Add foollowed by some Next(s).
Then in order to use LINQ to SQL you need to "add new file" to your project,
choose LINQ to SQL DBML follow and follow the setps.
NOTE: IN Visual Studio Express(C# lets say) you can't do it.
At least not in the 2008 version. You add the DBML. You need to manually
create the DataContext/Mapping.
But a much better source will be Gingle.
Search for videos of LINQ to SQL.
|
|
|
|
|
Thanks for your answer. What I still need to know is what to put under Database:
I created a database called ConstructionSurveyLayout in Management Studio but when I Browse my computer I can't find it. What am I supposed to put in that textbox?
|
|
|
|