Click here to Skip to main content
16,010,673 members
Home / Discussions / C#
   

C#

 
GeneralRe: Visual Studio AddIn problem - adding a sub-menu to the Edit menu Pin
Nick Parker7-Dec-03 10:51
protectorNick Parker7-Dec-03 10:51 
GeneralRe: Visual Studio AddIn problem - adding a sub-menu to the Edit menu Pin
Heath Stewart7-Dec-03 10:55
protectorHeath Stewart7-Dec-03 10:55 
GeneralAbout Journal--hook Pin
lajiyo6-Dec-03 16:21
lajiyo6-Dec-03 16:21 
GeneralRe: About Journal--hook Pin
leppie6-Dec-03 22:13
leppie6-Dec-03 22:13 
GeneralInfinite Recursion and other odd errors with Network API wrapper Pin
bri189a6-Dec-03 15:14
bri189a6-Dec-03 15:14 
GeneralRe: Infinite Recursion and other odd errors with Network API wrapper Pin
leppie6-Dec-03 22:11
leppie6-Dec-03 22:11 
GeneralRe: Infinite Recursion and other odd errors with Network API wrapper Pin
Heath Stewart7-Dec-03 4:24
protectorHeath Stewart7-Dec-03 4:24 
GeneralRe: Infinite Recursion and other odd errors with Network API wrapper Pin
bri189a7-Dec-03 10:33
bri189a7-Dec-03 10:33 
I'll try to clarify...

I made a set of classes that make interface with the WOpenEnum, WCloseEnum, and WEnumResources API functions simpiler. In that set of classes I also have a public class called Network that has static methods for retrieving the domains, servers, or shared folders in a network using the three API above (GetDomains(), GetServers(string domain), GetSharedFolders(string server). This set of classes also has three public structs (Domain, Server, SharedFolder) that I use for returning the information gathered in the three functions above. If you've worked with those three API before you know there are 8 items of information that come back, but only two that are important to the user, the 'Remote Name' and the 'Comment', this is what I put in those structs.

Now in a seperate project I make a reference to those set of class (which I just call EnumNetwork.dll)... With just a simple console project I can put it in a loop (normally wouldn't do this, nor use goto) as the following:

Start:
Server [] myServers = Network.GetServers("myDomain");
foreach(Server s in myServers)
{
Console.WriteLine(s.Name); //write the name of the server
}
goto Start:

And with this the servers will scroll out the console window forever without a glitch.

Now in a Windows Form I have a ListView object to make things look what users are use too... assume I already have a computer icon set for the second parameter of Item.Add below (the 0):

Server [] myServers = Network.GetServers("myDomain");
this.lstView.BeginUpdate();
this.lstView.Items.Clear();
foreach(Server s in myServers)
{
this.lstView.Items.Add(s.Name, 0);
}
this.lstView.EndUpdate();

What happens with this is that occasionally when closing the window itself you get 'Null Reference in mscrolib', or 'object not set to a reference of an object in unknown module'... and if running this code more that once in a 10 second period, or if there are many servers you get 'Infinite Recursion' and and 'Unhandled exception in sscrolib'...

Now I don't know what you mean by paragraphs unless you were saying I need to type better... in which case sorry for that... otherwise I'm ignorant to the meaning... but what I'm getting at is calling that method in the console window constantly results in no errors... over hours (yes I tested it for that long)... yet calling it in a method on a form results in unpredicatable errors... and try...catch statements don't do anything because the errors are caused in the Application.Run line... like I said, if you need the source code... not a problem... I'll email... thanks for any help, and thanks for the good info on the GC...

Brian

If you ever meet somebody who says they know it all, they are obviously ignorant and probably write terrible code.
GeneralRe: Infinite Recursion and other odd errors with Network API wrapper Pin
Heath Stewart7-Dec-03 10:41
protectorHeath Stewart7-Dec-03 10:41 
GeneralRe: Infinite Recursion and other odd errors with Network API wrapper Pin
bri189a7-Dec-03 11:08
bri189a7-Dec-03 11:08 
GeneralRe: Infinite Recursion and other odd errors with Network API wrapper Pin
Heath Stewart7-Dec-03 11:12
protectorHeath Stewart7-Dec-03 11:12 
GeneralRe: Infinite Recursion and other odd errors with Network API wrapper Pin
bri189a7-Dec-03 11:46
bri189a7-Dec-03 11:46 
GeneralRe: Infinite Recursion and other odd errors with Network API wrapper Pin
bri189a7-Dec-03 13:10
bri189a7-Dec-03 13:10 
GeneralRe: Infinite Recursion and other odd errors with Network API wrapper Pin
bri189a7-Dec-03 18:30
bri189a7-Dec-03 18:30 
GeneralRe: Infinite Recursion and other odd errors with Network API wrapper Pin
Heath Stewart8-Dec-03 2:13
protectorHeath Stewart8-Dec-03 2:13 
GeneralRe: Infinite Recursion and other odd errors with Network API wrapper Pin
bri189a8-Dec-03 10:58
bri189a8-Dec-03 10:58 
GeneralDeployment problem with the MS Web Browser Control Pin
Furty6-Dec-03 14:42
Furty6-Dec-03 14:42 
GeneralRe: Deployment problem with the MS Web Browser Control Pin
Heath Stewart7-Dec-03 4:18
protectorHeath Stewart7-Dec-03 4:18 
GeneralRe: Deployment problem with the MS Web Browser Control Pin
Furty8-Dec-03 19:49
Furty8-Dec-03 19:49 
GeneralRe: Deployment problem with the MS Web Browser Control Pin
Heath Stewart9-Dec-03 2:37
protectorHeath Stewart9-Dec-03 2:37 
GeneralRe: Deployment problem with the MS Web Browser Control Pin
Furty9-Dec-03 11:43
Furty9-Dec-03 11:43 
GeneralException in File explore Pin
naxos6-Dec-03 13:24
naxos6-Dec-03 13:24 
GeneralRe: Exception in File explore Pin
leppie6-Dec-03 22:15
leppie6-Dec-03 22:15 
GeneralApplication in Batch Mode with user interface Pin
Patrick Luijpers6-Dec-03 12:26
Patrick Luijpers6-Dec-03 12:26 
GeneralRe: Application in Batch Mode with user interface Pin
leppie6-Dec-03 22:16
leppie6-Dec-03 22:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.