Search Results

Search found 4689 results on 188 pages for 'weak references'.

Page 19/188 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Clarification needed: How does .NET runtime resolve assembly references from parent folder?

    - by aoven
    I have the following output structure of executables in my solution: %ProgramFiles% | +-[MyAppName] | +-[Client] | | | +-(EXE & several DLL assemblies) | +-[Common] | | | +-[Schema Assemblies] | | | | | +-(several DLL assemblies) | | | +-(several DLL assemblies) | +-[Server] | +-(EXE & several DLL assemblies) Each project in solution references different DLL assemblies, some of which are outputs from other projects in solution, and others are plain 3rd-party assemblies. For example, [Client] EXE might reference an assembly in [Common], which is in a different directory branch. All references have "Copy Local" set to false, to mirror the layout of the files in the final installed application. Now, if I take a look at reference properties in the Visual Studio IDE, I see that "Path" of every reference is absolute and that it corresponds to the actual output location of the assembly. That's understandable and correct. As expected, solution compiles and runs just fine. What I don't understand is, why everything seems to work even when I close the IDE, rename the [MyAppName] directory and run the [Client] EXE manually? How does the runtime find the assemblies if the reference paths aren't the same as they were at the time of linking? To be clear - this is actually exactly what I'm after: a semi-dispersed set of application files that run fine regardless of where the [MyAppName] directory is located or even what it's named. I'd just like to know, how and why this works without any specific path resolution on my part. I've read the answers to this similar question, but I still don't get it. Help much appreciated!

    Read the article

  • Do COM Dll References Require Manual Disposal? If so, How?

    - by Drew
    I have written some code in VB that verifies that a particular port in the Windows Firewall is open, and opens one otherwise. The code uses references to three COM DLLs. I wrote a WindowsFirewall class, which Imports the primary namespace defined by the DLLs. Within members of the WindowsFirewall class I construct some of the types defined by the DLLs referenced. The following code isn't the entire class, but demonstrates what I am doing. Imports NetFwTypeLib Public Class WindowsFirewall Public Shared Function IsFirewallEnabled as Boolean Dim icfMgr As INetFwMgr icfMgr = CType(System.Activator.CreateInstance(Type.GetTypeFromProgID("HNetCfg.FwMgr")), INetFwMgr) Dim profile As INetFwProfile profile = icfMgr.LocalPolicy.CurrentProfile Dim fIsFirewallEnabled as Boolean fIsFirewallEnabled = profile.FirewallEnabled return fIsFirewallEnabled End Function End Class I do not reference COM DLLs very often. I have read that unmanaged code may not be cleaned up by the garbage collector and I would like to know how to make sure that I have not introduced any memory leaks. Please tell me (a) if I have introduced a memory leak, and (b) how I may clean it up. (My theory is that the icfMgr and profile objects do allocate memory that remains unreleased until after the application closes. I am hopeful that setting their references equal to nothing will mark them for garbage collection, since I can find no other way to dispose of them. Neither one implements IDisposable, and neither contains a Finalize method. I suspect they may not even be relevant here, and that both of those methods of releasing memory only apply to .Net types.)

    Read the article

  • FluentNHibernate Many-To-One References where Foreign Key is not to Primary Key and column names are

    - by Todd Langdon
    I've been sitting here for an hour trying to figure this out... I've got 2 tables (abbreviated): CREATE TABLE TRUST ( TRUSTID NUMBER NOT NULL, ACCTNBR VARCHAR(25) NOT NULL ) CONSTRAINT TRUST_PK PRIMARY KEY (TRUSTID) CREATE TABLE ACCOUNTHISTORY ( ID NUMBER NOT NULL, ACCOUNTNUMBER VARCHAR(25) NOT NULL, TRANSAMT NUMBER(38,2) NOT NULL POSTINGDATE DATE NOT NULL ) CONSTRAINT ACCOUNTHISTORY_PK PRIMARY KEY (ID) I have 2 classes that essentially mirror these: public class Trust { public virtual int Id {get; set;} public virtual string AccountNumber { get; set; } } public class AccountHistory { public virtual int Id { get; set; } public virtual Trust Trust {get; set;} public virtual DateTime PostingDate { get; set; } public virtual decimal IncomeAmount { get; set; } } How do I do the many-to-one mapping in FluentNHibernate to get the AccountHistory to have a Trust? Specifically, since it is related on a different column than the Trust primary key of TRUSTID and the column it is referencing is also named differently (ACCTNBR vs. ACCOUNTNUMBER)???? Here's what I have so far - how do I do the References on the AccountHistoryMap to Trust??? public class TrustMap : ClassMap<Trust> { public TrustMap() { Table("TRUST"); Id(x => x.Id).Column("TRUSTID"); Map(x => x.AccountNumber).Column("ACCTNBR"); } } public class AccountHistoryMap : ClassMap<AccountHistory> { public AccountHistoryMap() { Table("TRUSTACCTGHISTORY"); Id (x=>x.Id).Column("ID"); References<Trust>(x => x.Trust).Column("ACCOUNTNUMBER").ForeignKey("ACCTNBR").Fetch.Join(); Map(x => x.PostingDate).Column("POSTINGDATE"); ); I've tried a few different variations of the above line but can't get anything to work - it pulls back AccountHistory data and a proxy for the Trust; however it says no Trust row with given identifier. This has to be something simple. Anyone? Thanks in advance.

    Read the article

  • How to truly remove all references from VS 2008 project?

    - by Clint
    I have a Visual Studio 2008 project that has a reference to a dll. I removed the reference to version 1 and added a new reference to version 2. The project builds successfully, however when I analyze the project dll after it has been built in Reflector I am seeing that it is holding onto two references to the same dll - version 1 and version 2 are both referenced.

    Read the article

  • Java IDE - find all INDIRECT usages/references of a function or class?

    - by GreenieMeanie
    In Netbeans or in Eclipse, you can use "Find Usages" or "References" from the right click context menu. If a() calls b(), using the functionality from b() will show you a(). However, what I want is to be able to see some kind of tree or have an option to see all usages of a given/class or method, such that if z() calls a() that using the functionality will show both z() and a(). Any IDE plugins or external tools that can do this?

    Read the article

  • Are there any languages that are dynamically typed but do not allow weak typing?

    - by Maulrus
    For example, adding a (previously undeclared) int and a string in pseudocode: x = 1; y = "2"; x + y = z; I've seen strongly typed languages that would not allow adding the two types, but those are also statically typed, so it's impossible to have a situation like above. On the other hand, I've seen weakly typed languages that allow the above and are statically typed. Are there any languages that are dynamically typed but are also strongly typed as well, so that the piece of code above would not be valid?

    Read the article

  • Java: how to avoid circual references when dumping object information with reflection?

    - by Tom
    I've modified an object dumping method to avoid circual references causing a StackOverflow error. This is what I ended up with: //returns all fields of the given object in a string public static String dumpFields(Object o, int callCount, ArrayList excludeList) { //add this object to the exclude list to avoid circual references in the future if (excludeList == null) excludeList = new ArrayList(); excludeList.add(o); callCount++; StringBuffer tabs = new StringBuffer(); for (int k = 0; k < callCount; k++) { tabs.append("\t"); } StringBuffer buffer = new StringBuffer(); Class oClass = o.getClass(); if (oClass.isArray()) { buffer.append("\n"); buffer.append(tabs.toString()); buffer.append("["); for (int i = 0; i < Array.getLength(o); i++) { if (i < 0) buffer.append(","); Object value = Array.get(o, i); if (value != null) { if (excludeList.contains(value)) { buffer.append("circular reference"); } else if (value.getClass().isPrimitive() || value.getClass() == java.lang.Long.class || value.getClass() == java.lang.String.class || value.getClass() == java.lang.Integer.class || value.getClass() == java.lang.Boolean.class) { buffer.append(value); } else { buffer.append(dumpFields(value, callCount, excludeList)); } } } buffer.append(tabs.toString()); buffer.append("]\n"); } else { buffer.append("\n"); buffer.append(tabs.toString()); buffer.append("{\n"); while (oClass != null) { Field[] fields = oClass.getDeclaredFields(); for (int i = 0; i < fields.length; i++) { if (fields[i] == null) continue; buffer.append(tabs.toString()); fields[i].setAccessible(true); buffer.append(fields[i].getName()); buffer.append("="); try { Object value = fields[i].get(o); if (value != null) { if (excludeList.contains(value)) { buffer.append("circular reference"); } else if ((value.getClass().isPrimitive()) || (value.getClass() == java.lang.Long.class) || (value.getClass() == java.lang.String.class) || (value.getClass() == java.lang.Integer.class) || (value.getClass() == java.lang.Boolean.class)) { buffer.append(value); } else { buffer.append(dumpFields(value, callCount, excludeList)); } } } catch (IllegalAccessException e) { System.out.println("IllegalAccessException: " + e.getMessage()); } buffer.append("\n"); } oClass = oClass.getSuperclass(); } buffer.append(tabs.toString()); buffer.append("}\n"); } return buffer.toString(); } The method is initially called like this: System.out.println(dumpFields(obj, 0, null); So, basically I added an excludeList which contains all the previousely checked objects. Now, if an object contains another object and that object links back to the original object, it should not follow that object further down the chain. However, my logic seems to have a flaw as I still get stuck in an infinite loop. Does anyone know why this is happening?

    Read the article

  • How can I add forward class references used in the -Swift.h header?

    - by Bill
    I'm integrating Swift code into a large Objective-C project, but I'm running into problems when my Swift code refers to Objective-C classes. For example, suppose I have: An Objective-C class called MyTableViewController An Objective-C class called DeletionWorkflow I declared a Swift class as follows: class DeletionVC: MyTableViewController { let deleteWorkflow: DeletionWorkflow ... } If I now try to use this class by importing ProjectName-Swift.h into Objective-C code, I get undefined symbol errors for both MyTableViewController and DeletionWorkflow. I can fix the problem in that individual source file by importing DeletionWorkflow.h and MyTableViewController.h before I import ProjectName-Swift.h but this doesn't scale up to a large project where I want my Swift and Objective-C to interact often. Is there a way to add forward class references to ProjectName-Swift.h so that these errors don't occur when I try to use Swift classes from Objective-C code in my app?

    Read the article

  • How do these user/userParam references relate to the Customer and Account lookups?

    - by plath
    In the following code example how do the user/userParam references relate to the Customer and Account lookups and what is the relationship between Customer and Account? // PersistenceManager pm = ...; Transaction tx = pm.currentTransaction(); User user = userService.currentUser(); List<Account> accounts = new ArrayList<Account>(); try { tx.begin(); Query query = pm.newQuery("select from Customer " + "where user == userParam " + "parameters User userParam"); List<Customer> customers = (List<Customer>) query.execute(user); query = pm.newQuery("select from Account " + "where parent-pk == keyParam " + "parameters Key keyParam"); for (Customer customer : customers) { accounts.addAll((List<Account>) query.execute(customer.key)); } } finally { if (tx.isActive()) { tx.rollback(); } }

    Read the article

  • How do these user/userParam references relate to the Customer and Account lookups?

    - by marmalade
    In the following code example how do the user/userParam references relate to the Customer and Account lookups and what is the relationship between Customer and Account? // PersistenceManager pm = ...; Transaction tx = pm.currentTransaction(); User user = userService.currentUser(); List<Account> accounts = new ArrayList<Account>(); try { tx.begin(); Query query = pm.newQuery("select from Customer " + "where user == userParam " + "parameters User userParam"); List<Customer> customers = (List<Customer>) query.execute(user); query = pm.newQuery("select from Account " + "where parent-pk == keyParam " + "parameters Key keyParam"); for (Customer customer : customers) { accounts.addAll((List<Account>) query.execute(customer.key)); } } finally { if (tx.isActive()) { tx.rollback(); } }

    Read the article

  • Can I destroy a class instance even if there are still references?

    - by DR
    For debugging reasons I want to destroy a class instance which still as references. Is that possible? It doesn't have to be elegant or stable, because this'll never end up in production code. To clarify: Public Sub Main Dim o as MyClass Set o = New MyClass //o is created, one reference DestroyObject o //Class_Terminate is called and the object destroyed //Further code, not using o End Sub //Possible runtime error here (don't care) Is that possible? One way would be to call IUnknown::Release to manually decrease the reference count, but how do I now how often I must call it?

    Read the article

  • What Visual C++ references are worth a look for a Java programmer looking to get up to speed?

    - by Terry V.
    I have a lot of experience with Java/OO. There are tons of C++ tutorials/references out there, but I was wondering if there are a few key ones that a Java programmer might find useful when making the transition. I will be moving from server-side J2EE to Windows Visual C++ desktop programming. I have googled and found tons of resources, but am overwhelmed and don't know where to best spend my time. I have only a few days to get a good start. Is Visual Studio Express / Microsoft Visual C++ the best IDE for me to start with? Also, any words of wisdom from others who know and work with both languages?

    Read the article

  • C# - Copy dlls to the exe output directory when using dependency injection with no references?

    - by NotDan
    I have a C# solution that I am using dependency injection to resolve references between dlls. I have an exe project and some other dll projects that are not referenced by the exe (It uses the dlls through the IoC container). The project settings are the default, visual studio settings where it builds each dll in it's own folder. Since the exe doesn't reference the dlls, they never get copied to the output directory of the exe and don't get found by the IoC framework. How do you handle this? Do you build them all in the same directory? Use post build copy commands? Or something else?

    Read the article

  • Can't create a MySQL query that generates 4 rows for each row in the table it references.

    - by UkraineTrain
    I need to create a MySQL query that generates 4 rows for each row in the table it references. I need some of the information in those rows to repeat and some to be different. In the table each row stands for one day. I need to break the day up in 6 hour increments, hence the four rows for each entry. I need to create one column which for each day will have '12AM', '6AM', '12PM', and '6PM' values and another column will have the corresponding numeric values calculated for those entries. Thanks a lot in advance and I will really appreciate any help on this.

    Read the article

  • Does SQL Server Compact not support keywords 'Foreign Key References' in Create Table or am I making a mistake?

    - by johnmortal
    I keep getting errors using Sql Compact. I have seen that it is possible to create table constraints in compact edition as shown here. And according to the documents found here it provides "Full referential integrity with cascading deletes and updates". So am I really not allowed to do the following or am I making a mistake? I keep getting complaints from sql server compact edition that the constaint is not valid, though it works fine on express edition. CREATE TABLE [A] (AKey int NOT NULL PRIMARY KEY); CREATE TABLE [B] (AKey int NOT NULL FOREIGN KEY REFERENCES A(AKey));

    Read the article

  • What happens to an instance of ServerSocket blocked inside accept(), when I drop all references to i

    - by Hanno Fietz
    In a multithreaded Java application, I just tracked down a strange-looking bug, realizing that what seemed to be happening was this: one of my objects was storing a reference to an instance of ServerSocket on startup, one thread would, in its main loop in run(), call accept() on the socket while the socket was still waiting for a connection, another thread would try to restart the component under some conditions, the restart process missed the cleanup sequence before it reached the initialization sequence as a result, the reference to the socket was overwritten with a new instance, which then wasn't able to bind() anymore the socket which was blocking inside the accept() wasn't accessible anymore, leaving a complete shutdown and restart of the application as the only way to get rid of it. Which leaves me wondering: with no references left to the ServerSocket instance, what would free the socket for a new connection? At what point would the ServerSocket become garbage collected? In general, what are good practices I can follow to avoid this type of bug?

    Read the article

  • is it possible to create a multi-project template that references n number of existing projects and

    - by jcollum
    The situation: I need to create about 40+ solutions that all reference 3 projects and have one project that is unique to each one. I'd like to create a multi-project template that does this, but from what I've read it looks like it's very difficult or impossible (related SO question, but doesn't answer). I want my solution to look like this (names changed of course): These three are used by all solutions created under this "family": MyCompany.Extensions MyCompany.MyProject.Tests.Shared MyCompany.MyProject.Scripts This one is the one that makes the solution unique, 123, 124, 125 etc: MyCompany.MyProject.Tests.Unit123 Is it possible to set up a multi-project template that will generate this structure? References: MSDN Create Multi Project Templates

    Read the article

  • How do I remove line references in generate output in doxygen?

    - by MeThinks
    I want to remove lines look as follows but I still want to return source code browsing Definition at line 377 of file xxx.h. I have tried the following two in the doxygen config file but these just remove cross references on types # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = NO update: I've just trying setting the following and seems to do the jobs but waiting to confirm if this is the correct way of achieving what I want SOURCE_BROWSER = NO

    Read the article

  • How can I use structured references to a column in an Excel macro?

    - by Eshwar
    Here's an example that will explain things: Sheets("Plot Data July").Select ActiveSheet.ListObjects("tPDJuly").Range.AutoFilter Field:=2 ActiveSheet.ListObjects("tPDJuly").Range.AutoFilter Field:=4 So as you can see above, Field:=2 is a relative reference to the second field in the table called "tPDJuly". So now if I add more columns, this number does not get updated. The field is actually called "Grade" in the table. So is there a way of coding this so that no matter which column it is in, "Grade" is always updated? I suppose one solution is that we add a line that find what is the column number for "Grade"?

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >