Search Results

Search found 15081 results on 604 pages for 'passing by reference'.

Page 41/604 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • Passing pointer into function, data appears initialized in function, on return appears uninitialize

    - by Luke Mcneice
    Im passing function GetCurrentDate() the pointer to a tm struct. Within that function I printf the uninitialized data, then the initialized. Expected results. However when i return the tm struct appears uninitialized. See console output bellow. What am i doing wrong? uninitialized date:??? ???-1073908332 01:9448278:-1073908376 -1217355836 initialized date:Wed May 5 23:08:40 2010 Caller date:??? ???-1073908332 01:9448278:-1073908376 -121735583 int main() { test(); } int test() { struct tm* CurrentDate; GetCurrentDate(CurrentDate); printf("Caller date:%s\n",asctime (CurrentDate)); return 1; } int GetCurrentDate(struct tm* p_ReturnDate) { printf("uninitialized date:%s\n",asctime (p_ReturnDate)); time_t m_TimeEntity; m_TimeEntity = time(NULL); //setting current time into a time_t struct p_ReturnDate = localtime(&m_TimeEntity); //converting time_t to tm struct printf("initialized date:%s\n",asctime (p_ReturnDate)); return 1; }

    Read the article

  • Obj-C: Passing pointers to initialized classes in other classes

    - by FnGreg7
    Hey all. I initialized a class in my singleton called DataModel. Now, from my UIViewController, when I click a button, I have a method that is trying to access that class so that I may add an object to one of its dictionaries. My get/set method passes back the pointer to the class from my singleton, but when I am back in my UIViewController, the class passed back doesn't respond to methods. It's like it's just not there. I think it has something to do with the difference in passing pointers around classes or something. I even tried using the copy method to throw a copy back, but no luck. UIViewController: ApplicationSingleton *applicationSingleton = [[ApplicationSingleton alloc] init]; DataModel *dataModel = [applicationSingleton getDataModel]; [dataModel retrieveDataCategory:dataCategory]; Singleton: ApplicationSingleton *m_instance; DataModel *m_dataModel; - (id) init { NSLog(@"ApplicationSingleton.m initialized."); self = [super init]; if(self != nil) { if(m_instance != nil) { return m_instance; } NSLog(@"Initializing the application singleton."); m_instance = self; m_dataModel = [[DataModel alloc] init]; } NSLog(@"ApplicationSingleton init method returning."); return m_instance; } -(DataModel *)getDataModel { DataModel *dataModel_COPY = [m_dataModel copy]; return dataModel_COPY; } For the getDataModel method, I also tried this: -(DataModel *)getDataModel { return m_dataModel; } In my DataModel retrieveDataCategory method, I couldn't get anything to work. I even just tried putting a NSLog in there but it never would come onto the console. Any ideas?

    Read the article

  • iOS - Passing variable to view controller

    - by gj15987
    I have a view with a view controller and when I show this view on screen, I want to be able to pass variables to it from the calling class, so that I can set the values of labels etc. First, I just tried creating a property for one of the labels, and calling that from the calling class. For example: SetTeamsViewController *vc = [[SetTeamsViewController alloc] init]; vc.myLabel.text = self.teamCount; [self presentModalViewController:vc animated:YES]; [vc release]; However, this didn't work. So I tried creating a convenience initializer. SetTeamsViewController *vc = [[SetTeamsViewController alloc] initWithTeamCount:self.teamCount]; And then in the SetTeamsViewController I had - (id)initWithTeamCount:(int)teamCount { self = [super initWithNibName:nil bundle:nil]; if (self) { // Custom initialization self.teamCountLabel.text = [NSString stringWithFormat:@"%d",teamCount]; } return self; } However, this didn't work either. It's just loading whatever value I've given the label in the nib file. I've littered the code with NSLog()s and it is passing the correct variable values around, it's just not setting the label. Any help would be greatly appreciated. EDIT: I've just tried setting an instance variable in my designated initializer, and then setting the label in viewDidLoad and that works! Is this the best way to do this? Also, when dismissing this modal view controller, I update the text of a button in the view of the calling ViewController too. However, if I press this button again (to show the modal view again) whilst the other view is animating on screen, the button temporarily has it's original value again (from the nib). Does anyone know why this is?

    Read the article

  • JQuery Ajax Get passing parameters

    - by George
    Hi, I am working on my first MVC application and am running into a bit of a problem. I have a data table that when a row is clicked, I want to return the detail from that row. I have a function set up as: function rowClick(item) { $("#detailInfo").data("width.dialog", 800); $.ajax({ type: "GET", contentType: "application/json; charset=utf-8", url: "<%= Url.Action("GetDetails", "WarningRecognition")%>", data: "", dataType: "json", success: function(data) {//do some stuff...and show results} } The problem I am running into is the passing of the "item". I calls the Controller function that looks like this: public JsonResult GetDetails(string sDetail) { Debug.WriteLine(Request.QueryString["sDetail"]); Debug.WriteLine("sDetail: " + sDetail); var myDetailsDao = new WarnRecogDetailsDao(); return new JsonResult { Data = myDetailsDao.SelectDetailedInfo(Convert.ToInt32(sDetail)) }; } But it never shows anything as the the "sDetail". It does hit the function but nothing is passed to it. So, I have read where you pass the parameter via the data but I have tried every combination I can think of and it never shows up. Tried: data: {"item"} data: {sDetail[item]} data: {sDetail[" + item + "]} Any help is greatly appreciated. Thanks in advance. Geo...

    Read the article

  • Passing a Batch File an Argument Containing a Quote Containing a Space

    - by Synetech inc.
    Hi, On many occasions I have dealt with passing batch files arguments with spaces, quotes, percents, and slashes and all sorts of combinations of them. Usually I managed to figure out how to accomplish what I want, but this time I am stuck. I have tried a couple of hundred combinations now and my head is starting to hurt. I’ve reduced the problem quite nicely. It’s a simple requirement: pass a double-quoted space from one batch file to another. That is, one batch file should pass some string X to another so that the the second one echos " ". I just can’t figure out what X should be. Here is a minimal batch file that demonstrates and attempt that does not work. (This BAT file takes the place of both by calling itself.) ::Goal is to print: ::" " ::That is, to pass a quoted space from a BAT file to a BAT file if not (%1)==() goto recurse %0 "" "" :recurse echo %1 pause It does not work. I’ve tried using "\" \"", """ """, """" """", "\"" "\"", ""\" \""", "^" ^"", ^"" "^", and so on. Either they print double double-quotes, lose everything after the space, or something else (that is wrong). Any ideas? Thanks.

    Read the article

  • Filtering Questions (posts) by tag_name in TagController#index passing /tags?tag_name=something

    - by bgadoci
    I am trying to get my TagsController#index action to display only the Questions that contain certain tags when passing the search parameter tag_name. I am not getting an error just can't get the filter to work correctly such that upon receiving the /tags?tag_name=something url, only those questions are displayed . Here is the setup: class Tag < ActiveRecord::Base belongs_to :question def self.search(str) return [] if str.blank? cond_text = str.split.map{|w| "tag_name LIKE ? "}.join(" OR ") cond_values = str.split.map{|w| "%#{w}%"} all(:order => "created_at DESC", :conditions => (str ? [cond_text, *cond_values] : [])) end end and class Question < ActiveRecord::Base has_many :tags, :dependent => :destroy end tag link that would send the URL to the TagsController looks like this: <%= link_to(tag_name, tags_path(:tag_name => tag_name)) %> and outputs: /tags?tag_name=something In my /views/tags/index.html.erb view I am calling the questions by rendering a partial /views/questions/_question.html.erb. <%= render :partial => @questions %> When I send the URL with the search parameter nothing happens. Here is my TagsController#index action: def index @tags = Tag.search(params[:search]).paginate :page => params[:page], :per_page => 5 @tagsearch = Tag.search(params[:search]) @tag_counts = Tag.count(:group => :tag_name, :order => 'count_all DESC', :limit => 100) @questions = Question.all( :order => 'created_at DESC', :limit => 50) respond_to do |format| format.html # index.html.erb format.xml { render :xml => @tags } end end How can I properly filter questions displayed in the /views/tags/index.html.erb file for the parameter tag.tag_name?

    Read the article

  • Passing time from server to client

    - by gskoli
    Dear all, i am creating a digital clock using images & javascript but i want to pass a server time that time ... How to do that ... I am getting time from server and passing it to Date Following i have given snippet . var time_str = document.clock_form.time_str.value ; //alert (time_str); function dotime(){ theTime=setTimeout('dotime();',1000); //d = new Date(Date.parse(time_str)); d= new Date(time_str); hr= d.getHours()+100; mn= d.getMinutes()+100; se= d.getSeconds()+100; var time_str = document.clock_form.time_str.value ; //alert (time_str); alert(' TIME ---> '+hr+' :: '+mn+' :: '+ se); if(hr==100){ hr=112;am_pm='am'; } else if(hr<112){ am_pm='am'; } else if(hr==112){ am_pm='pm'; } else if(hr>112){ am_pm='pm';hr=(hr-12); } tot=''+hr+mn+se; document.hr1.src = '/flash_files/digits/dg'+tot.substring(1,2)+'.gif'; document.hr2.src = '/flash_files/digits/dg'+tot.substring(2,3)+'.gif'; document.mn1.src = '/flash_files/digits/dg'+tot.substring(4,5)+'.gif'; document.mn2.src = '/flash_files/digits/dg'+tot.substring(5,6)+'.gif'; document.se1.src = '/flash_files/digits/dg'+tot.substring(7,8)+'.gif'; document.se2.src = '/flash_files/digits/dg'+tot.substring(8,9)+'.gif'; document.ampm.src= '/flash_files/digits/dg'+am_pm+'.gif'; } dotime(); But it is not working Help me out Thanks in advance.

    Read the article

  • Passing an array of structs in C

    - by lelouch
    I'm having trouble passing an array of structs to a function in C. I've created the struct like this in main: int main() { struct Items { char code[10]; char description[30]; int stock; }; struct Items MyItems[10]; } I then access it like: MyItems[0].stock = 10; etc. I want to pass it to a function like so: ReadFile(MyItems); The function should read the array, and be able to edit it. Then I should be able to access the same array from other functions. I've tried heaps of declarations but none of them work. e.g. void ReadFile(struct Items[10]) I've had a look around for other questions, but the thing is they're all done different, with typedefs and asterisks. My teacher hasn't taught us pointers yet, so I'd like to do it with what I know. Any ideas? :S EDIT: Salvatore's answer is working after I fixed my prototype to: void ReadFile(struct Items[9]);

    Read the article

  • Passing a Variable into jQuery AJAX

    - by Scott
    I'm stuck in a rut. I hope some one can help. Basically, I am building an AJAX mobile web app with jQuery. I am able to parse a specific XML file just fine, but I want the option to parse other XML files based on the link they were clicked on and load them on the fly into the same DIV or UL. So: click on Link1, loads XML1 click on Link2, loads XML2 I would like to be able to do this all client side, so no PHP (or is that a bad idea?). This the jquery code I've been using: $(document).ready(function() { $("a.load_ajax").click(loadAjax()); function loadAjax() { var fileID = get('?lineID='); var dataID = "xml/" + fileID + ".xml" $.ajax({ type: "GET", url: dataID, dataType: "xml", success: parseXml }); function parseXml(xml) { $(xml).find("train").each(function() { $("ul#ajax-output").append('<li>' + $(this).find("time").text() + '</li>'); }); } } }); Its just not working at all. I have been passing the variable using GET in the url. So the link in the HTML goes to /?lineID=SBD_to_Union and it should load the XML file called SBD_to_Union.xml Making sense to anyone? I'd appreciate some help.

    Read the article

  • jQuery tokeninput plugin + passing id to another tokeninput url

    - by Elson Solano
    I am using a jquery plugin called jQuery Tokeninput http://loopj.com/jquery-tokeninput/ and I am having a logic issue. var country_id = ""; jQuery("#demo-input-prevent-duplicates").tokenInput(host+"/forms/campaign_location.php?action=country", { theme: "facebook", hintText: "Enter a Country...", placeholder: "Enter a Country...", preventDuplicates: true, onAdd: function(item) { country_id = item.id; }, onDelete: function(){ hideElements(); }, tokenDelimiter: "|", }); My question here is how would I pass the value of country_id to the parameter of the below code. I'm not seeing how to do this one on the jquery tokeninput documentation. jQuery("#targ_state").tokenInput(host+"/forms/campaign_location.php?action=stateorprovince&cid="+country_id, { theme: "facebook", preventDuplicates: true, hintText: "Enter a State or Province...", placeholder: "Enter a State or Province..." }); If you'll look on this part of the code, I am passing the country_id that was generated above on the "onAdd". This doesn't work though. jQuery("#targ_state").tokenInput(host+"/forms/campaign_location.php?action=stateorprovince&cid="+country_id .... How would I do that one? Your help would be greatly appreciated and of course, rewarded! Thanks! :-)

    Read the article

  • Passing objects across Appdomains

    - by MUSTAQ
    My issue is similar to the one posted in "http://stackoverflow.com/questions/981773/moving-objects-across-appdomains-in-net". In one of my application, I am creating a separate appdomain. I need to create an instance of a class (Note: this class is derived by MarshalByRefObject) in my parent domain and invoke a MethodA in that instance. This instance is created using "CreateInstanceAndUnwrap". The problem is that this MethodA takes objects of type class as an argument. These objects are not created in the MethodB where i created the appdomain. It was passed as an argument to the MethodB where i create the appdomain. So is it necessary to create a new instance of these objects using "CreateInstanceAndUnwrap" before passing it to the created domain. Not doing this gives me an error in the created domain mentioning that "MyClass object has no attribute foo" during some invocation. Please let me know how to pass the objects across appdomains and execute the method. My statements might be confusing, please let me know for any specific details required.

    Read the article

  • Jquery passing an HTML element into a function

    - by christian
    I have an HTML form where I am going to copy values from a series of input fields to some spans/headings as the user populates the input fields. I am able to get this working using the following code: $('#source').keyup(function(){ if($("#source").val().length == 0){ $("#destinationTitle").text('Sample Title'); }else{ $("#destinationTitle").text($("#source").val()); } }); In the above scenario the html is something like: Sample Title Basically, as the users fills out the source box, the text of the is changed to the value of the source input. If nothing is input in, or the user deletes the values typed into the box some default text is placed in the instead. Pretty straightforward. However, since I need to make this work for many different fields, it makes sense to turn this into a generic function and then bind that function to each 's onkeyup() event. But I am having some trouble with this. My implementation: function doStuff(source,target,defaultValue) { if($(source).val().length == 0){ $(target).text(defaultValue); }else{ $(target).text($(source).val()); } } which is called as follows: $('#source').keyup(function() { doStuff(this, '"#destinationTitle"', 'SampleTitle'); }); What I can't figure out is how to pass the second parameter, the name of the destination html element into the function. I have no problem passing in the element I'm binding to via "this", but can't figure out the destination element syntax. Any help would be appreciated - many thanks!

    Read the article

  • Passing models between controllers in MVC4

    - by wtfsven
    I'm in the middle of my first foray into web development with MVC4, and I've run into a problem that I just know is one of the core issues in web development in general, but can't seem to wrap my mind around it. So I have two models: Employee and Company. Employee has a Company, therefore /Employee/Create contains a field that is either a dropdown list for selecting an existing Company, or an ActionLink to /Company/Create if none exists. But here's the issue: If a user has to create a Company, I need to preserve the existing Employee model across both Views--over to /Company/Create, then back to /Employee/Create. So my first approach was to pass the Employee model to /Company/Create with a @Html.ActionLink("Add...", "Create", "Organization", Model , null), but then when I get to Company's Create(Employee emp), all of emp's values are null. The second problem is that if I try to come back to /Employee/Create, I'd be passing back an Employee, which would resolve to the POST Action. Basically, the whole idea is to save the state of the /Employee/Create page, jump over to /Company/Create to create a Company record, then back to /Employee/Create to finish creating the Employee. I know there is a well understood solution to this because , but I can't seem to phase it well enough to get a good Google result out of it. I've though about using Session, but it seems like doing so would be a bit of a kludge. I'd really like an elegant solution to this.

    Read the article

  • Passing the form scope to a Remote cfc

    - by cf_PhillipSenn
    What is the syntax for passing the form scope into a cfc with access="remote"? I have: <cfcomponent> <cfset Variables.Datasource = "xxx"> <cffunction name="Save" access="remote"> <cfset var local = {}> <!--- todo: try/catch ---> <cfif arguments.PersonID> <cfquery datasource="#Variables.Datasource#"> UPDATE Person SET FirstName = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.FirstName#"> ,LastName = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.LastName#"> WHERE PersonID = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.PersonID#"> </cfquery> <cfset local.result = arguments.PersonID> <cfelse> <cfquery name="local.qry" datasource="#Variables.Datasource#"> INSERT INTO Person(FirstName,LastName) VALUES( <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.FirstName#"> ,<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.LastName#"> ); SELECT PersonID FROM Person WHERE PersonID=Scope_Identity() </cfquery> <cfset local.result = local.qry.PersonID> </cfif> <cfreturn local.result> </cffunction> </cfcomponent> I need to pass in form.PersonID, form.firstname, form.lastname.

    Read the article

  • Passing contextual info to Views in ASP.NET MVC

    - by Andrey
    I wonder - what is the best way to supply contextual (i.e. not related to any particular view, but to all views at the same time) info to a view (or to master page)? Consider the following scenario. Suppose we have an app that supports multiple UI languages. User can switch them via UI's widgets (something like tabs at the top of the page). Each language is rendered as a separate tab. Tab for the current language should not be rendered. To address these requirements I'm planning to have a javascript piece that will hide current's language tab on the client. To do this, I need current's language tab Id on the client. So, I need some way of passing the Id to master page (for it to be 'fused' into the js script). The best thing I can think of is that all my ViewModels should inherit some ViewModeBase that has a field to hold current language tab Id. Then, whatever View I'm rendering, this Id will always be available for the master page's hiding script. However, I'm concerned that this ViewModelBase can potentially grow in an uncontrolled fashion as number of such pieces of contextual info (like current language) will grow.. Any ideas?

    Read the article

  • Passing null child object from parent object to a partial view

    - by Mike
    I have an object which contains models for my ASP.NET MVC web app. The Model that is being passed into the view has sub models for "gadgets" on that particular view. Each of these sub models gets passed to a partial view (gadget). The problem is when I have a null model in the view model. See example below. View Model: public class FooBarHolder() { public FooBar1 FooBar1 { get; set; } public FooBar2 FooBar2 { get; set; } } We pass FooBarHolder into the view and inside the view we make calls such as <% Html.RenderPartial("Foo", Model.FooBar1); %> <% Html.RenderPartial("Foo2", Model.FooBar2); %> Now say for instance that Model.FooBar2 was null. What I am experiencing from the strongly typed partial view is an error that says "This view expected a model of type FooBar2 but got a model of type FooBarHolder." Why is this happening instead of just passing in a null?

    Read the article

  • sortable list using jquery ui not passing updated list order

    - by Matthew Berman
    I am following the sortable lists railscast and got everything working except when I sort, the same (original) order gets passed to the update method each time, so it doesn't update the true order. Here's the code: In the view: %tbody#lineup{"data-update-url" => sort_lineups_url} - @lineup.pieces.each_with_index do |piece, index| = content_tag_for :tr, piece do = render 'piece', :piece => piece, :index => index and pieces.js.coffee: jQuery -> $('#lineup').sortable( axis: 'y' update: -> $.post($(this).data('update-url'), $(this).sortable('serialize')) ); sort and show methods of lineupscontroller: def show @lineup = Lineup.find_by_user_id(current_user.id) @pieces = @lineup.pieces.order("position") end def sort params[:piece].each_with_index do |id, index| current_user.lineup.pieces.update_all({position: index+1}, {id: id}) end render nothing: true end and the update request: Started POST "/lineups/sort" for 127.0.0.1 at 2012-06-24 20:06:14 -0700 Processing by LineupsController#sort as */* Parameters: {"piece"=>["8", "2", "1", "4", "3", "7"]} User Load (0.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 2 LIMIT 1 Lineup Load (0.6ms) SELECT `lineups`.* FROM `lineups` WHERE `lineups`.`user_id` = 2 LIMIT 1 SQL (2.9ms) UPDATE `pieces` INNER JOIN `piece_lineups` ON `pieces`.`id` = `piece_lineups`.`piece_id` SET `position` = 1 WHERE `piece_lineups`.`lineup_id` = 3 AND `pieces`.`id` = 8 SQL (0.6ms) UPDATE `pieces` INNER JOIN `piece_lineups` ON `pieces`.`id` = `piece_lineups`.`piece_id` SET `position` = 2 WHERE `piece_lineups`.`lineup_id` = 3 AND `pieces`.`id` = 2 SQL (0.6ms) UPDATE `pieces` INNER JOIN `piece_lineups` ON `pieces`.`id` = `piece_lineups`.`piece_id` SET `position` = 3 WHERE `piece_lineups`.`lineup_id` = 3 AND `pieces`.`id` = 1 SQL (0.5ms) UPDATE `pieces` INNER JOIN `piece_lineups` ON `pieces`.`id` = `piece_lineups`.`piece_id` SET `position` = 4 WHERE `piece_lineups`.`lineup_id` = 3 AND `pieces`.`id` = 4 SQL (0.6ms) UPDATE `pieces` INNER JOIN `piece_lineups` ON `pieces`.`id` = `piece_lineups`.`piece_id` SET `position` = 5 WHERE `piece_lineups`.`lineup_id` = 3 AND `pieces`.`id` = 3 SQL (0.5ms) UPDATE `pieces` INNER JOIN `piece_lineups` ON `pieces`.`id` = `piece_lineups`.`piece_id` SET `position` = 6 WHERE `piece_lineups`.`lineup_id` = 3 AND `pieces`.`id` = 7 Rendered text template (0.0ms) so each time i drag+drop the list, it sends the same order again. what am I doing wrong that the params isn't passing the right, updated order? Completed 200 OK in 2757ms (Views: 1.0ms | ActiveRecord: 6.7ms)

    Read the article

  • null reference problems with c#

    - by alex
    Hi: In one of my window form, I created an instance of a class to do some works in the background. I wanted to capture the debug messages in that class and displayed in the textbox in the window form. Here is what I did: class A //window form class { public void startBackGroundTask() { B backGroundTask = new B(this); } public void updateTextBox(string data) { if (data != null) { if (this.Textbox.InvokeRequired) { appendUIDelegate updateDelegate = new appendUIDelegate(updateUI); try { this.Invoke(updateDelegate, data); } catch (Exception e) { Console.WriteLine(e.Message); } } else { updateUI(data); } } } private void updateUI(string data) { if (this.Textbox.InvokeRequired) { this.Textbox.Invoke(new appendUIDelegate(this.updateUI), data); } else { //update the text box this.Textbox.AppendText(data); this.Textbox.AppendText(Environment.NewLine); } } private delegate void appendUIDelegate(string data); } class B // background task { A curUI; public b( A UI) { curUI = UI; } private void test() { //do some works here then log the debug message to UI. curUI.updateTextBox("message); } } I keep getting a null reference exception after this.Invoke(updateDelegate, data); is called. I know passing "this" as a parameter is strange. But I want to send the debug message to my window form. Please help. Thanks

    Read the article

  • VSDBCMD returns "An unexpected failure occurred: Object reference not set to an instance of an objec

    - by Matt Wrock
    I have been succesfully using the command line database deployment tool VSDBCMD on my dev and test environments but the tool fails in our integration environmrnt. I am using the VS 2010 version of the tool. The servers have all of the prerequisites including: .net 4.0 sql server compact edition 3.5 sp1 (as well as the full edition of 2008) sql server 2008 server management objects sql server 2008 native client sql server system clr types msxml 6 all of the dependent DLLs included in: C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\desktop*.dll C:\Program Files\Microsoft SQL Server Compact Edition\v3.5*.dll C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSTSDB\Deploy**. The only reference to this error that I have been able to find has to do with a bug in the VS 2008 edition when the HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0 key is missing. In my case the 10.0 version of the key exists. Has anyone else encountered this?

    Read the article

  • WPF parent-child window: binding reference problem

    - by LukePet
    I have a WPF Window that open a modal child window to load some data. Both window have a own viewmodel, now I have this problem: after I close the child window it seems still running in background! To close the child window I set DialogResult from viewmodel command; now, if I create a new data and then I edit it from parent window (with the child window closed before), the child window still capture the property changed event for the properties previously bind. How can avoid this? I would clear every reference with data when I close modal window. Which is the best practise to do it?

    Read the article

  • C# - Pass by value & Pass by Reference

    - by Lijo
    Hi Team, Could you please explain the following behavior of C# Class. I expect the classResult as "Class Lijo"; but actual value is “Changed”. We’re making a copy of the reference. Though the copy is pointing to the same address, the method receiving the argument cannot change original. Still why the value gets changed ? public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Person p = new Person(); p.Name = "Class Lijo"; Utilityclass.TestMethod(p); string classResult = p.Name; Response.Write(classResult); } } public class Utilityclass { public static void TestMethod(Person k) { k.Name = "Changed"; } } public class Person { private string name; public string Name { get { return name; } set { name = value; } } } Thanks Lijo

    Read the article

  • Passing parameter to SOAP Web Service Requests Using Visual Studio Team System 2008

    - by Nicholas
    How can I pass in the current datetime parameter to a SOAP request? I know you can pass in parameters by adding a datasource to the web test project and reference it like this {{DataSource.TableName.FieldName}}. But I want to pass in current datetime parameter as a dynamic value (something like DateTime.Now). How do I go about doing this? Below is sample SOAP request that I put into String Body: <soap:body> <MyQuery xmlns="http://something.com"> <req> <QueryType>{{DataSource.Table.QueryType}}</QueryType> <Name>{{DataSource.Table.Name}}</Name> <RequestDateTime>{{insert DateTime.Now here}}</RequestDatetime> </req> </MyQuery> </soap:body> P.S. Running web test by adding Web Service Request in Visual Studio Team System 2008

    Read the article

  • Problem using void pointer as a function argument

    - by Nazgulled
    Hi, I can't understand this result... The code: void foo(void * key, size_t key_sz) { HashItem *item = malloc(sizeof(HashItem)); printf("[%d]\n", (int)key); ... item->key = malloc(key_sz); memcpy(item->key, key, key_sz); } void bar(int num) { foo(&num, sizeof(int)); } And I do this call: bar(900011009); But the printf() output is: [-1074593956] I really need key to be a void pointer, how can I fix this?

    Read the article

  • Visual Studio reference x64 GAC

    - by icelava
    How can one get Visual Studio 2005/2008 to reference assemblies in the 64-bit GAC instead of the 32-bit GAC? We are settin the target platfom to x64 and the compiler is throwing the error of Error 2 Warning as Error: Assembly generation -- Referenced assembly 'System.Data.dll' targets a different processor Common Error 3 Warning as Error: Assembly generation -- Referenced assembly 'mscorlib.dll' targets a different processor Common Error 4 Assembly signing failed; output may not be signed -- The system cannot find the file specified. Common Update 29 Dec 08 Been trying out Aaron Stebner's suggestions to place 64-bit assemblies onto an isolated location (e.g. C:\Windows\Microsoft.NET\Framework64\v2.0.50727\GAC_64) and creating additional entries in the registry like HKLM\SOFTWARE\Microsoft.NETFramework\AssemblyFolders\GAC_64 or HKLM\SOFTWARE\Microsoft.NETFramework\v2.0.50727\AssemblyFoldersEx\GAC_64 but Visual Studio 2005 is still not picking it up....

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >