callback

Ajax synchronous callbacks

Hi All, I have a pageTest.html in local folder,this page call a service.ashx?i=...(that return value param passed incremented +1) with follow Ajax code: . . getIncr: function(parameters, success){ $.ajax({ async: false, type: methodType, url: getTarget, data: "n="+parameters, ...

WPF: Returning a method AFTER an animation has completed

With reference to this programming game I am currently building. I have a Class Library (dll) that will have a method Run which will be composed of something like such: public class MyRobot : Robot { public void Run(} { while (true) { Ahead(200); //moves the bot 200pixels TurnLeft(90); /...

Callback Function

I have a method called funct which i want to have as my callback function when i am using the beingreceive socket method in c#. s.BeginReceive(buffer, 0, buffer.Length, System.Net.Sockets.SocketFlags.None, new AsyncCallback(funct), null); The error that am getting is: No overload for 'funct' matches delegate 'System...

C++ Pointers to Member Functions Inheritance

I have a need to be able to have a super class execute callbacks defined by a class that inherits from it. I am relatively new to C++ and from what I can tell it looks like the subject of member-function-pointers is a very murky area. I have seen answers to questions and random blog posts that discuss all sorts of things, but I am not s...

Javascript callback function issue.

Background I'm writing an asynchronous comment system for my website, after reading plenty of tutorials on how to accomplish this I started building one from scratch. The comments are pulled using a JSON request and displayed using Javascript (jQuery). When the user adds a new comment it goes through the hoops and finally is sent via ...

Callbacks in C#

I want to have a library that will have a function in it that accepts an object for it's parameter. With this object I want to be able to call a specified function when X is finished. The function that will be called is to be specified by the caller, and X will be done and monitored by the library. How can I do this? For reference I'm...

How to Invoke and use WSAAsyncSelect() in C#?

Hello, I edited my question when I set the bounty. I want to Invoke/DllImport WSAAsyncSelect() from WinAPI and use it much like I use it in Delphi/C++ For example - Delphi //Async CallBack handler Declaration procedure MessageHandler(var Msg:Tmessage);Message WM_WINSOCK_ASYNC_MSG; //Where i setup the Async dwError := WSAAsyncSelect(S...

Hiding then showing a div using jQuery

I want to slideUp some divs, then slideDown 1 div. However, I'm having some issues. $("#divDocument,#divLocation").slideUp("normal", function() { $("#divSearch").slideDown("normal", doStuff()); }); With this code, divDocument is visible, divLocation isn't. Because the divLocation is already hidden the doStuff() event fires immedia...

jQuery callback not being called

I'm using the .post AJAX method of jQuery: // completion toggling $('.item input').click(function() { $.post('complete.php', {item: this.id}, function() { $(this).parent().fadeOut('slow'); }); }); What am I doing wrong here? The AJAX works as the record is updated but the callback event never happens. No errors in Fire...

Invalid postback or callback argument

This question seems to have been asked before, but I feel like my situation is slightly different. I have a page that contains a gridview. When a button is pressed to edit one of the records in the gridview, the button first executes some client script that pops up a modal window for the purposes of editing (set using .onClientClick)...

Can/should I use a mocking framework to dynamically add events to a class?

Consider the following interface: public interface IMyCallback { void SomeEvent(int someArg); } which is the contract for a WCF callback that will be receiving "events" from a WCF service. My implementation for this interface looks like this public class MyCallback : IMyCallback { void IMyCallback.SomeEvent(int someArg) { O...

Rails after_save callback to create an associated model based on column_changed?

Hi, I have an ActiveRecord model with a status column. When the model is saved with a status change I need to write to a history file the change of status and who was responsible for the change. I was thinking an after_save callback would work great, but I can't use the status_changed? dynamic method to determine that the history writ...

Passing Interface's method as parameter

Hi, is it possible to pass inetrface's method as parameters? I'm trying something like this: interface type TMoveProc = procedure of object; // also tested with TMoveProc = procedure; // procedure of interface is not working ;) ISomeInterface = interface procedure Pred; procedure Next; end; TSomeObject = class(TO...

Compare Function and Multithreading

Assume a multi-threaded environment and a (properly synchronized) class that has one particular procedure procedure SortKeyList (KeyList : TList <Integer>; Inverted : Boolean); that takes a list of keys and sorts it. The procedure uses the RTL quicksort implementation TList.Sort: KeyList.Sort (TComparer <Integer>.Construct (CompareKe...

jQuery nyroModal with ASP.NET using Web Services

Hi, I have been using the jQuery nyroModal plugin for a little bit of time, and frankly its one of the best modal plugins I've used to date! I'm hoping that a lot of other people have also used this plugin, hence me requiring some help with regards to using it along with ASP.NET. I have however run into a problem with it in the past a...

Callback Routine Not Getting Triggered

I've created a very simple one-button MFC dialog app that attempts to utilize a callback function. The app complies and runs just fine, but the callback routine never gets triggered. What needs to be modified in order to get the callback to trigger properly? You can download the test.zip file here (the test app is in VS 2003 to ensure...

How should i create a callback

What is the best way to write a callback? I only need to call 1 function that has the sig of void (string, int); and this would need to invoke a class since i have member objs that i need to process. Whats the best way to write this? in C i would do pass a func pointer and an void*obj. i dislike that and i suspect there is a better way t...

does cloning affect activerecord callbacks?

I have a sequence of ActiveRecord objects that I want to cascade destroy but some of the objects are not being removed. Essentially I have as follows:- class Project < ActiveRecord::Base has_many :tasks, :dependent => :destroy has_many :schedules, :dependent => :destroy has_many :project_schedules, :through => :schedules, :class...

What is the difference between Page.IsPostBack and Page.IsCallBack?

I've recently ran into some code that checks Page.IsCallBack but I wasn't sure how it is different from Page.IsPostBack. Can anyone enlighten me? Edit: Are they mutually exclusive or can both occur at the same time in a given situation? ...

How to use WSAAsyncSelect from WinAPI in C#?

Hello, I'm tired of the .NET BeginRead,EndRead stuff.I'd love to use WSAAsyncSelect the way I used to in Delphi/C++ //Async CallBack handler Declaration procedure MessageHandler(var Msg:Tmessage);Message WM_WINSOCK_ASYNC_MSG; //Where i setup the Async dwError := WSAAsyncSelect(Sock, form1.handle, WM_WINSOCK_ASYNC_MSG, FD_CLOSE or FD_R...