|
|
Could you please be more detailed?
Where should i search?
Thanks
|
|
|
|
|
Hi,
I am developing a C# application, that has display the list of classes, methods and properties from a .jar file and .class file (created in java). How to accomplish this?
Thanks and Regards.
|
|
|
|
|
AFAIR, Jars are compressed archives in a standard format (ZIP, I think), which contain a manifest.
You should be able to use most open archiving libraries (but check on the format first).
Cheers
Sid
|
|
|
|
|
This is the actual exception/stack trace:
An unhandled exception occured in the program
The type initializer for "RDC.Global" threw an exception.
The root element is missing.
The exception was thrown by System.String get_DataLocation()
at RDC.Global.get_DataLocation()
at RDC.FileManager.get_Location()
at RDC.Album.ReadXml(String albumName)
at RDC.DetailsAlbum.set_AlbumName(String value)
at RDC.DetailsPane.InitializeComponent()
at RDC.DetailsPane..ctor()
at RDC.MainForm.InitializeComponent()
at RDC.MainForm..ctor()
at RDC.MainForm.Run()
at RDC.MainForm.Main()
the property looks like this:
return Environment.GetFolderPath( Environment.SpecialFolder.Desktop );
and it's only happening on one notebook, but I really want to figure out why. Putting that code into a new program, and running it so it comes up in a messagebox, gives a messagebox with the path to the desktop ( on that particular notebook ).
Furhter, this is the calling code in FileManager.get_Location
Logging.Log("Getting Location");
string link = Path.Combine( Global.DataLocation, Consts.LocalPhotoFolder );
Then the property looks like this:
public static string DataLocation
{
get
{
Logging.Log("Getting Data Location");
try
{
string retval = Environment.GetFolderPath( Environment.SpecialFolder.Desktop );
Logging.Log("Returning " + retval);
return retval;
}
catch (Exception e)
{
Logging.ForceLog("Environment.GetFolderPath failed");
Logging.ForceLog(e.Message);
Logging.ForceLog(@"returning c:\ as default");
return @"c:\";
}
}
}
Here's the kicker - my error log contains "Getting location" - it does NOT contain "Getting Data Location". So the error seems to be trying to find the property to access it.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Try using "DesktopDirectory" instead of "Desktop", i.e., try using the following code and see if it solves your problem:
return Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
|
|
|
|
|
I've got a question: Is you Log file being opened, written, flushed, and closed every time you write to it? If not, you're could be losing at least one line at the bottom of the log.
Environment.SpecialFolder.Desktop returns the virtual folder, which might not exist on that notebook. This could be because of some rights issue or a COM screw up for the Desktop.
I hate to say to it , but the first thing I'd do is garantee that your getting the physical path to the current desktop folder with
SpecialFolder.DesktopDirectory. <br />
<br />
It looks like <code>Global.DataLocation and/or Consts.LocalPhotoFolder didn't return what you thought they should. You might want to add a little code to debug those return values.
Logging.Log("Getting Location");
Logging.Log(" GDL=" + Global.DataLocation);
Logging.Log(" LPF=" + Consts.LocalPhotoFolder);
string link = Path.Combine( Global.DataLocation, Consts.LocalPhotoFolder );
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
I've got a question: Is you Log file being opened, written, flushed, and closed every time you write to it? If not, you're could be losing at least one line at the bottom of the log.
I have a helper function to make sure that a flush occurs every time, but a close does not occur every time, no. Surely flush is all I need ?
Dave Kreskowiak wrote:
Environment.SpecialFolder.Desktop returns the virtual folder, which might not exist on that notebook. This could be because of some rights issue or a COM screw up for the Desktop.
Thanks, I got that and tried DesktopLocation, it still crashes.
Dave Kreskowiak wrote:
but the first thing I'd do is garantee that your getting the physical path to the current desktop folder with SpecialFolder.DesktopDirectory.
Wrote a little app that does exactly that, it works fine on the notebook, brings up the path in a message box.
Dave Kreskowiak wrote:
It looks like Global.DataLocation and/or Consts.LocalPhotoFolder didn't return what you thought they should.
I logged Consts.LocalPhotoFolder, it's a const string anyhow, it was what I expected. Global.DataLocation does not appear to ever be entered. I think it's a problem with initialisation of a static object.
Dave Kreskowiak wrote:
Logging.Log(" GDL=" + Global.DataLocation);Logging.Log(" LPF=" + Consts.LocalPhotoFolder);
LOL - did exactly that yesterday, but the other way around ( as I expected the DataLocation to be the problem ). Got the localphotofolder, and then the usual crash. The thing is, all of the Global.DataLocation property is now in it's own try/catch, which doesn't rethrow, and logs something completely different. The try/catch is never entered, the exception is thrown by attempting to access the property, not within it.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Can anyone point me to a good way to draw a usercontrol inside a listbox over and over again? What I mean is to insert something like a panel (with stuff on it obviously) inside a listBox and have that be displayed instead of some random strings (I've tried inserting it and I get random strings...I honestly don't remember what though). I REALLY don't wanna have to draw everything with GDI+ so if anyone knows a way to do that, I would appreciate it greatly. Note: It can also be a listview - either will do fine. I haven't found anything on CP that shows how to do that, so if there is something, please point me there. and forgive my stupidity.
|
|
|
|
|
Mmm cool idea, a ListBox for controls.
Off the top of my head, you'd create the controls say, Panel s, as children of the ListBox , and depending on the scrolling, move the controls that should be visible to somewhere inside the visible area of the ListBox .
You'd have to write some code for the scrolling, and managing of the controls, but you can let them paint themselves.
And don't forget to write an article for CP once you're done.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I've got a program with a function that contains this line of code:
return Environment.GetFolderPath( Environment.SpecialFolder.Desktop );
that's the whole function. It's fine on my machine, but blowing up on the client, with an error about a root node being missing. Does anyone have any ideas ? He reckons it crashes on multiple machines. I have a try catch around the main function, that writes the call stack and error message to a log file.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Try using "DesktopDirectory" instead of "Desktop", i.e., try using the following code and see if it solves your problem:
return Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
|
|
|
|
|
Thanks, but I've discovered the error occurs in the boundary between one class and another ( see above) .How does the change you suggest differ from what I've done ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
"Desktop" is the logical Desktop rather than the physical file system location.
On the other hand, "DesktopDirectory" is the the directory used to physically store file objects on the desktop.
Therefore, one should not confuse this directory with the desktop folder itself, which is a virtual folder.
|
|
|
|
|
Thanks - that's a worthwhile change, although it stands no chance of fixing the problem at hand ( as far as I can see ). Live and learn...
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi folks,
I need to write a piece of code to list all the virtual directories in IIS.
Could you guys give me a hint?
Thanks
|
|
|
|
|
|
Please excuse if this not the place to post this.
I update from VS2002 to VS2003, I my computer all is fine with all. But in the user machines I have this exception:
<br />
System.TypeInitializationException: The type initializer for "SIFEX_Administracion.modDeclaraFormas" threw an exception. ---> System.IO.FileNotFoundException: File or assembly name CrystalDecisions.CrystalReports.Engine, or one of its dependencies, was not found.<br />
<br />
File name: "CrystalDecisions.CrystalReports.Engine"<br />
at SIFEX_Administracion.modDeclaraFormas..cctor()<br />
<br />
=== Pre-bind state information ===<br />
LOG: DisplayName = CrystalDecisions.CrystalReports.Engine, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304<br />
(Fully-specified)<br />
LOG: Appbase = C:\Archivos de programa\Grupo Acón\SIFEX\Bin\<br />
LOG: Initial PrivatePath = NULL<br />
Calling assembly : SIFEX_Administracion, Version=1.0.3.8, Culture=neutral, PublicKeyToken=null.<br />
===<br />
I hvae instaled net framewokk 1.1 in users machines and copy Microsoft Visual Studio .NET 2003/Crystal Desitions folder of my cumputer to the user computers and the problems still apear?
How can I solve this problem?
Thank you!
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
How does one use the Data Access Object pattern using serialization or if your objects are in a hierarchy?
|
|
|
|
|
Is there a way to get the exact size of a process ? I've been looking at the Process class' members that deal with memory (PrivateMemorySize, PagedMemorySize, etc...) but none of them give me the same number as Task Manager does. Anyone know how to get the exact size of a running process ? Thanks in advance...
-Pete
|
|
|
|
|
Nevermind I've found it. It's (Process.WorkingSet / 1024).
-Pete
|
|
|
|
|
I am using Visual C# 2005 to develop a program. When the program calls line 3 of the following code I get a COMException with every path I try. I am trying to place a shortcut in the start menu.
The problem code is underlined. Even when that method is called by itself it creates the exception. I have included the proper reference in the project. Any ideas? Thanks for any help.
WshShell shell = new WshShell();
string path = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) + "\\programs";
IWshShortcut link = (IWshShortcut)shell.CreateShortcut(path);
link.TargetPath = destinationPath + "\\filemover.exe";
link.IconLocation = destinationPath + "\\" + "FileMover.ico";
link.Save();
|
|
|
|
|
Question #1: Event Handler External to the Main Form
An application that I am working on requires an eventhandler class stored in another folder separate from the main application form. The problem that this creates is that I have been forced to have two event handler approaches for the controls: one for the event processing and another to manipulate the form controls. I would much rather prefer to combine the two event handlers into one event handler to remove the confusion rather than have to manage two of them.
The reason why I cannot put all of the code thus far into the external event handler is because none of the form objects are available in the external event handler class. In other words, I would need to manipulate elements that are on the form from the external event handler. However, the external event handler does not even permit the keyword "this" to be used, especially when the methods in the external event handler is set to static. If the keyword static is removed, then the keyword "this" works, but only for the elements that are on the external event handler class. I cannot manipulate any of the form elements from the external event handler class.
The first question is: How to I address the main form of the application from the external event handler class. I tried to use:
<br />
frmMainForm frm = new frmMainForm();<br />
but that only created another form. When I tried to manipulate the controls on the form, and the event handler interacted with this "new" form, it caused the form controls to disappear. I suspect that the control disappeared from the original form because it did not know what to do with it, considering that now there was a "new" frmMainForm form. Either that or it actually attempted to move the control from the "original" frmMainForm to the "new" frmMainForm, but I doubt it because that would require some other technologies.
I also used the "using" keyword referencing the namespace of the frmMainForm form. Then where the code required the frmMainForm I tried to reference it with
<br />
System.Windows.Forms.Form frm = NameSpaceOfFrmMainForm.frmMainForm.ActiveForm;<br />
but when the program reached this line of code, it only caused the form to become "active" thereby ignoring any of the code following it which attempted to use the form controls from the application's main form. I know that I am missing something. Could somebody kindly explain to me how to address the application's main form from an external event handler class?
Question #2: ctrl.Update()
When drawing a control to the screen in a looping construction of an array, I would like to clean the screen from the previous iteration through the loop. For example:
<br />
System.Drawing.Point pt1 = new ctrl.Location(50, 10);<br />
System.Drawing.Point pt2 = new ctrl.Location(50, 20);<br />
System.Drawing.Point pt3 = new ctrl.Location(50, 30);<br />
System.Drawing.Point pt4 = new ctrl.Location(50, 40);<br />
<br />
Point[] ptArray = {pt1, pt2, pt3, pt4};<br />
foreach (Point pt in ptArray)<br />
{<br />
ctrl.Location = pt;<br />
ctrl.Update();<br />
}<br />
The problem is that each time through the array loop, the control displays, but the previous time through the loop is not removed. Is there some kind of Form1.Paint() delegate that could be used to clear the previous control image ghost? I would like the control to appear as if it is moving with an animation effect, but the fact that the previous ctrl.Update() remains on each next time through the loop detracts from the desired result. Would really appreciate some assistance!!!
|
|
|
|
|
how to make the area of desktop behind this area accesble by user from within this area ?
|
|
|
|
|
I am facing a problem where the configuationfile from the bin directory gets deleted every time i run my windows application. I want to know where to place the windows configuration file. And why does it get deleted.
shelly
|
|
|
|
|