reference

Knowing if function is taking reference or value at runtime

So this is a purely academic question, mostly as its been a while since I've done anything too complex in C++. But is there any way to know if a method is taking a paramter as a reference or a value? This isn't important for pointers, as if you try to pass a non-pointer to a method that takes a pointer, you get a compile error. But somet...

Add reference to project in c#

I have some strange problem. I have a solution with the following structure http://i33.tinypic.com/10fbzbq.jpg As you can see when i wonna import the VDB.Common.RequestAndResponses it gives an error. The namespace of dat Class Library is VDB.Common.RequestAndResponses. I am new in c# , so it could be that i forgot something stupid. ...

Lifecycle of objects passed by reference to STL containers

I'm an experienced coder, but am still relatively new to the STL, and have just come across this problem: As far as I'm aware, STL containers aren't meant to copy the objects which they contain, or otherwise affect their lifecycles, yet experimentally I'm seeing different results. In particular, string classes, which are meant to zero ...

Model View Presenter - How to add a reference to assembly Controller/Model

I'm new and learning on how to use MVP - Model View Presenter. In basic terms MVP was derived from MVC patterns. I have a project solutions named Model, Controller, Presenter and UI. Model, Controller and Presenter are reference to each other as the MVC pattern and UI will reference the Controller. How can I display the data to UI which...

Microsoft.mshtml / mshtml.dll versioning and reference issues

Hi, I'm using .NET 4, trying to add a reference to mshtml, and I want to have all the capabilities depending on the version the client has installed. If I add a reference to the COM component called 'Microsoft HTML Object Library', the reference is labelled "MSHTML" and the path points to an assembly in the GAC called 'Microsoft.html' ...

Gethashcode() function

Why aren't C1 and c2 have the same hashcode ? the code doesn't get to "Same".... ( i=0 in both classes) class myclass { public static int i; static void Main() { myclass c1 = new myclass(); myclass c2 = new myclass(); if (c1.GetHashCode() == c2.GetHashCode()) Console.Write("Same"); ...

Visual C# app.config file for a referenced assembly

We have a Visual Studio 2010 solution that contains several C# projects in accordance with Jeffery Palermo's Onion Architecture pattern (http://jeffreypalermo.com/blog/the-onion-architecture-part-1/). We have a UI project that is an ASP.Net MVC project, and we have a C# Class Library project called Infrastructure that is referenced by t...

referencing a source controlled project (using TFS) in another source controlled project.

i have three VS solutions : Human-resource Solution Payroll Solution And a Main web site (Shell); Human-resource is a solution which is also a team project. Payroll is the same, and so do the Main web Site(Shell). what i need is to reference the (Shell) in Human-resource solution and also in Payroll. is that possible in TFS...

What to pass to this function?

Hi! :) I have the following problem: //A.h class A { //... // this is the important part, i have to call this in the proper way // in A::SetNewValue(), but i don't know how to do that protected: void SetValue(const int* i); //... public: // ?? void SetNewValue(const int* p); } the cpp: //A.cpp //?? A::SetNe...

Python permanent assignment variables

I have just started python and came across something kind of strange. The following code assigns a co-ordinate of x=1 and y=2 to the variable test. The test2 variable assigns itself the same value as test and then the [x] value for test2 is changed to the old [x] value minus 1. This works fine, however, when the last part is executed, n...

Strange problem with reference and object cloning

Hi I have a strange problem with reference and object cloning, which I'm not able to solve. I have a class MyClass which consist of property Name. I also have my custon user control, which have a property of type MyClass - myclassproperty. These controls are placed on form. If I click one of control a new form apperas. I pass one argume...

executing a reference to field.onchange in Firefox

I have HTML code which calls a javascript function from a form, using: <form name="f" id="f" ...> <input name="myField" onchange="doFunct(f.myField.value,f.yourField);" /> <input name="yourfield" onchange="doFunct(f.yourField.value,f.anotherField);" /> ... In the javascript code: function doFunct(field,dest){ // do something ...

MySQL: select on a table with tablename from a recordset

I would like to do this in one step so I would like to know how can I: table a (documents) has: pk, document_id, template_id table b (templates) has: pk, template_id, template_table_name table c (template_table_name_1) has: pk, document_id, document_specific_columns so... I would like to query table a, get document_id and template_id...

Variables addresses

Hello, I'm writing statistic system. It should make some output with given params. For example: float getSunActivity() { ... } int getEarthActivity() { ... } StatisticSystem::track("sun_activity", boost::any(getSunActivity())); StatisticSystem::track("earth_activity", boost::any(getEarthActivity())); class StatisticSystem { typedef...

why referenced c# dll is in full path in VS2010?

why the referenced dll of a c# project is in full path? when i move the source code to a different pc, the reference is broken. ...

Referencing a part of an array in C#.

Hi there, I have got the array containing some data, say, a header and a real data. I need to pass the data contained in the array to a method, but I definitely want to avoid copying it to another array. I thought of something like ArraySegment, but it seems not to work in my case (or maybe I'm wrong?). So, how to pass a part of an a...

Passing an array by reference in C# and managed C++.

Hi there, here is the situation: I want to call a method from a C++ module, and pass an array to it: x.Method(array, ...) x is a C# object. I would suppose that I could change the array and fill it with my own data - but it seems not be the case (?) How should I pass the array by reference and change its content in the method? Tha...

In PHP can someone explain cloning vs pointer reference?

To begin with, I understand programming and objects, but the following doesn't make much sense to me in PHP. In PHP we use the & operator to retrieve a reference to a variable. I understand a reference as being a way to refer to the same 'thing' with a different variable. If I say for example $b = 1; $a =& $b; $a = 3; echo $b; will...

Error "HRESULT E_FAIL has been returned from a call to a COM component" when adding a reference to a .Net 4 project in Visual Studio 2010

Hi, I get an Error "HRESULT E_FAIL has been returned from a call to a COM component" when adding a .dll reference to a project in Visual Studio 2010. The weird thing is, if I make a local copy of the .dll, and reference it locally it's fine. However, if I try and reference it from our shared resources server (\server\release\Common\Pa...

Confusing output?

I fail to understand is why does the code print '3' in VS2010 (release build), whether I leave the declaration of 'r' or comment it out. int main(){ int arr1[2]; int &r = arr1[0]; int arr2[2]; cout << (&arr1[1] - &arr2[0]); } So, three questions: a. why does the code print 3? b. why does it print 3 even if the decla...