1
голосов
2ответов
3813 просмотров

could not load dll or one of its dependency

a. My C# program will load a dll (which is dynamic), for now let's take a.dll (similarly my program will load more dll like b.dll, c.dll, etc....). b. My program will invoke a method "Onstart" inside a.dll (it's constant for all the dll). I am able to achieve the above 2 cases by reflection mec...

89
голосов
9ответов
22880 просмотров

Have you ever used PhantomReference in any project?

The only thing I know about PhantomReference is, If you use its get() method, it will always return null and not the object. What's the use of it? By using PhantomReference, you make it sure that the object cannot be resurrected from finalize method. But what is the use of this concept/cl...

0
голосов
2ответов
70 просмотров

referencing 32 assemblies on a 64 bit windows dev box

I and my co-developer have installed Microsoft Expression studio 3. I set a reference to the new mediaplayer and checked in my project. The co-dev get the project from TFS and can't do a build because of missing references. Odd I said --- until I realized that I was running on a 64 bit envi...

14
голосов
10ответов
7020 просмотров

String object is really by reference?

I have being studying (newbie) .NET and I got some doubts. Reading from a book examples I learnt that String are object then Reference Type. So, I did this test and the result was different what I expected: I'm really curious, is this an exception because "string" are special types? class Pro...

10
голосов
8ответов
22572 просмотров

Getter and setter, pointers or references, and good syntax to use in c++?

I would like to know a good syntax for C++ getters and setters. private: YourClass *pMember; the setter is easy I guess: void Member(YourClass *value){ this->pMember = value; // forget about deleting etc } and the getter? should I use references or const pointers? example: YourClass ...

4
голосов
3ответов
1840 просмотров

How to identify & use OSType in Cocoa

In Cocoa/Mac OSX 10.6 OSType IOSurfaceGetPixelFormat(IOSurfaceRef buffer) returns a type OSType where can I find some documentation/reference on the supported OSType with regard to the context of this function. What sort OSType should I expect with IOSurfaceGetPixelFormat? do you have any i...

2
голосов
3ответов
832 просмотров

Loading a C#dll into a C# exe

I am new to C# can any please tell how to load a dll created in C# to a exe in c# I have .NetFrameWork 3.5 and my o.s Vista

0
голосов
1ответов
417 просмотров

Protecting shared DLLs from being unregistered / deferenced during uninstall?

My .Net program in C# is referencing a proprietary DLL, which my program uses to access their API. Everything works great.. however, when I uninstall my program (add/remove programs), the original program (not mine) will no longer run because it appears that the DLL file has been dereferenced or...

1
голосов
3ответов
206 просмотров

C# Generics Samples

Like Linq 101 samples form Microsoft site,is there any site shows examples on Generics? or like albhari on threading can i get any ebook?

11
голосов
3ответов
1626 просмотров

C#: In what cases should you null out references?

The CLR Profiler can also reveal which methods allocate more storage than you expected, and can uncover cases where you inadvertently keep references to useless object graphs that otherwise could be reclaimed by GC. (A common problem design pattern is a software cache or lookup table of items ...

2
голосов
5ответов
709 просмотров

Value vs Reference

What decision should I take about Equals(), ReferenceEquals(), and == from the following results? What do they produce actually? #region int integer = 1; int integer2 = integer; bool referenceEquality = (integer == integer2);//true bool valueEquality = integer.Equals(integer2);//true bool value...

7
голосов
2ответов
4956 просмотров

Get paths of assemblies used in Type

I need a method that takes a Type and returns the paths of all assemblies that used in the type. I wrote this: public static IEnumerable<string> GetReferencesAssembliesPaths(this Type type) { yield return type.Assembly.Location; foreach (AssemblyName assemblyName in type.Assembly.Get...

1
голосов
2ответов
2951 просмотров

Visual Studio 2008: Project dependencies and build order all out of sync, plugin available?

I have quite a large project, actually 2 but they share a lot of projects between each other. The problem being when I compile from NOTHING, that is, no DLLs in my common bin directory, it fails.. This is due to the fact that some projects are not compiling before others that are dependent on th...

3
голосов
4ответов
4097 просмотров

Optional parameter for reference to pointer?

How do I declare the second parameter as optional? template <typename T> inline void Delete (T *&MemoryToFree, T *&MemoryToFree2 = ){ delete MemoryToFree; MemoryToFree = NULL; delete MemoryToFree2; MemoryToFree2 = NULL; } I tried several things after the = o...

1
голосов
3ответов
183 просмотров

Calling method that uses method<type>(parameters)</type>

Given the example below, can someone please show me how this could be called? bool WithinDelta&lt;T&gt;(T input1, T input2, T delta) Ive tried various ways such as bool foo = GenericMath.WithinDelta(1, 50, 75); bool foo = GenericMath.WithinDelta&lt;int&gt;(1, 50, 75); but the Type &lt;T...

4
голосов
5ответов
1960 просмотров

How is reference to java object is implemented?

Is pointer is just used for implementing java reference variable or how it is really implemented? Below are the lines from Java language specification 4.3.1 Objects An object is a class instance or an array. The reference values (often just references) are pointers to these objects, and a...

11
голосов
3ответов
22281 просмотров

Returning a const reference to vector of an object

I have 2 questions related to the same problem: How can I return a reference to a vector which belongs to a class? I have this class: class sys{ protected: vector&lt;int&gt; s; public: sys(); vector&lt;int&gt;&amp; getS() {return s;} //(1) }; (1) should ret...

3
голосов
2ответов
452 просмотров

Is it possible to change the temporary object and to pass it as an argument?

Is it possible to change the temporary object and to pass it as an argument? struct Foo { Foo&amp; ref() { return *this; } Foo&amp; operator--() { /*do something*/; return *this; } // another members }; Foo getfoo() { return Foo(); } // return Foo() for example or something else voi...

228
голосов
11ответов
96426 просмотров

How come a non-const reference cannot bind to a temporary object?

Why is it not allowed to get non-const reference to a temporary object, which function getx() returns? Clearly, this is prohibited by C++ Standard but I am interested in the purpose of such restriction, not a reference to the standard. struct X { X&amp; ref() { return *this; } }; X getx(...

0
голосов
5ответов
2515 просмотров

Recommended OpenGL / GLUT Reference

What OpenGL / GLUT reference is good for day to day programming as you learn? Ideally I'm looking for something with lots of C++ sample code to help me learn as I develop OpenGL applications as well as details about the APIs similar to what MSDN provides for .net programming. If there isn't a o...

4
голосов
3ответов
2722 просмотров

TeamCity path to external reference assemblies

I have been working with setting up TeamCity, and I have almost everything working with the exception of being able to compile VS2005 solutions that have referenced assemblies that are outside of the solution path. I have our SVN repository structured as follows Root Libraries ...

0
голосов
4ответов
10464 просмотров

How to use string and string pointers in C++

I am very confused about when to use string (char) and when to use string pointers (char pointers) in C++. Here are two questions I'm having. which one of the following two is correct? string subString; subString = anotherString.sub(9); string *subString; subString = &amp;anotherString.sub(9); ...

0
голосов
3ответов
668 просмотров

Weird problem with Visual Studio 2008 website reference

I'm trying to add a reference to the GAC version of System.Xml in a Visual Studio 2008 web site project. I right-click the project icon in the Solution Explorer, and click Property Pages. Under the References tree option, I click the 'Add' button on the right. I navigate to System.Xml in the ....

1
голосов
2ответов
1503 просмотров

relative references in .net

I browse to a a dll and add it as a reference. The problem is the reference absolute path is being stored. How do I change this to be a relative reference instead?

44
голосов
6ответов
30658 просмотров

Why Can't I store references in a `std::map` in C++?

I understand that references are not pointers, but an alias to an object. However, I still don't understand what exactly this means to me as a programmer, i.e. what are references under the hood? I think the best way to understand this would be to understand why it is I can't store a reference ...

8
голосов
2ответов
4619 просмотров

PHP How to know if a variable is a reference?

I want to call a function with call_user_func_array but i noticed that if an argument is a reference in the function definition and is a simple value in call_user_func_array, the following warning appears: Warning: Parameter 1 to test() expected to be a reference, value given Here is a simple e...

1
голосов
3ответов
1145 просмотров

Why Does List Argument in Python Behave Like ByRef?

This may be for most languages in general, but I'm not sure. I'm a beginner at Python and have always worked on copies of lists in C# and VB. But in Python whenever I pass a list as an argument and enumerate through using a "for i in range," and then change the value of the list argument, the i...

68
голосов
10ответов
47196 просмотров

Does foreach() iterate by reference?

Consider this: List&lt;MyClass&gt; obj_list = get_the_list(); foreach( MyClass obj in obj_list ) { obj.property = 42; } Is obj a reference to the corresponding object within the list so that when I change the property the change will persist in the object instance once constructed somewhere?

2
голосов
4ответов
1166 просмотров

Java references values are addresses values?

When I do: int x[] = new int[2]; System.out.println("...&gt; " + x); the output value is like this: [[email protected] so that hex number is concerning to the memory address where the object has been allocated? and [I what does it meaning?

1
голосов
3ответов
2930 просмотров

How to dereference a pointer passed by reference in c++?

I'm doing (something like) this: void insert(Node*&amp; node, string val, Node* parent) { if (node == NULL) instantiateNode(node, val, parent); else insert(node-&gt;child, val, node); } The thing is, that instantiateNode(..., parent) seems to modify the original *&amp;node pass...