Search Results

Search found 1788 results on 72 pages for 'debugger'.

Page 53/72 | < Previous Page | 49 50 51 52 53 54 55 56 57 58 59 60  | Next Page >

  • MissingMethodException thrown when calling new form in Compact Framework

    - by Boerema
    I'm updating an old mobile device application for better flexibility. I had basically added the ability to configure the address of our SQL server in the case that we want to use our test server as opposed to our production server. I don't think this is causing the problem, but I wanted to state it. I also upgraded the project from a VS 2000 project to a VS 2005 project. The issue I am having is that when I try to run the program in the VS emulator for Pocket PC, I get an error. It occurs after our "main menu" form loads and the user selects the next form to load. The form is initialized without issue, but when we try to run the .ShowDialog() method, it throws a System.MissingMethodException. I don't have a lot of experience with the Compact Framework and really have no idea where to start looking for problems. I stepped the debugger through the entire initializing process for the new form and it ran without issue. But, again, when we come to the ShowDialog call, it throws the error. Any ideas in where to start looking or known issues would be greatly appreciated.

    Read the article

  • Core-data: when accessing a relationship, the count method on NSSet fails

    - by lordsandwich
    I'm trying to access a relationship (one to many) programatically. My Data model contains an NSManagedEntity called language (with a two string attributes) with a relationship to an entity called WordCategory (one-to-many). I use an NSFetchRequest to get all the Language entities. that works fine. I get the valueForKey for the relationship and that works fine. I can work with its objects. However, when I try to send the message count to the NSSet that stores the WordCategory objects I get a In other words, this line works: NSLog(@"word category count %@",[[wordCategory anyObject] valueForKey:@"name"]); This one doesn't: NSLog(@"word category count %@",[wordCategory count] I get a the message: EXC_BAD_ACCESS in the debugger. Here's the rest of the code: NSManagedObjectContext *moc = [myAppDelegate managedObjectContext]; NSFetchRequest *request = [[NSFetchRequest alloc] init]; [request setEntity:[NSEntityDescription entityForName:@"Language" inManagedObjectContext:moc]]; NSError *error = nil; NSArray *results = [moc executeFetchRequest:request error: &error]; if (error) { [NSApp presentError:error]; return; } NSManagedObject *obj = [results objectAtIndex:0]; NSSet *wordCategory = [obj valueForKey:@"category"]; NSLog(@"word category count %@",[wordCategory count]); I'll appreciate any light than anybody can shed in this mystery. Thanks for your help!

    Read the article

  • iPhone programming - problem with CoreFoundation forking

    - by Tom
    Hello all, I've been working on an iPhone for several months. It's a 2d shooting game akin to the old Smash TV type games. I'm doing everything alone and it has come out well so far, but now I am getting unpredictable crashes which seem to be related to CoreFoundation forking and not exec()ing, as the message __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONA LITY___YOU_MUST_EXEC__ always shows up somewhere in the debugger. Usually it shows up around a CFRunLoopRunSpecific and is related to either a timer firing or _InitializeTouchTapCount. I cannot figure out exactly what is causing the fork to occur. My main game loop is running on a timer, first updating all the logic and then drawing everything with openGL. There is nothing highly complex or unusual. I understand you cannot make CF calls on the childside of a fork, or access shared memory and things like that. I am not explicitly trying to fork anything. My question is: can anyone tell me what type of activity might cause CoreFoundation to randomly fork like this? I'd really like to finish this game and I don't know how to solve this problem. Thanks for any help.

    Read the article

  • jQuery ajax call doesn't seem to do anything at all

    - by icemanind
    I am having a problem with making an ajax call in jQuery. Having done this a million times, I know I am missing something really silly here. Here is my javascript code for making the ajax call: function editEmployee(id) { $('#<%= imgNewEmployeeWait.ClientID %>').hide(); $('#divAddNewEmployeeDialog input[type=text]').val(''); $('#divAddNewEmployeeDialog select option:first-child').attr("selected", "selected"); $('#divAddNewEmployeeDialog').dialog('open'); $('#createEditEmployeeId').text(id); var inputEmp = {}; inputEmp.id = id; var jsonInputEmp = JSON.stringify(inputEmp); debugger; alert('Before Ajax Call!'); $.ajax({ type: "POST", url: "Configuration.aspx/GetEmployee", data: jsonInputEmp, contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { alert('success'); }, error: function (msg) { alert('failure'); } }); } Here is my CS code that is trying to be called: [WebMethod] public static string GetEmployee(int id) { var employee = new Employee(id); return Newtonsoft.Json.JsonConvert.SerializeObject(employee, Newtonsoft.Json.Formatting.Indented); } When I try to run this, I do get the alert that says Before Ajax Call!. However, I never get an alert back that says success or an alert that says failure. I did go into my CS code and put a breakpoint on the GetEmployee method. The breakpoint did hit, so I know jQuery is successfully calling the method. I stepped through the method and it executed just fine with no errors. I can only assume the error is happening when the jQuery ajax call is returning from the call. Also, I looked in my event logs just to make sure there wasn't an ASPX error occurring. There is no error in the logs. I also looked at the console. There are no script errors. Anyone have any ideas what I am missing here? `

    Read the article

  • thread reaches end but isn't removed

    - by pstanton
    I create a bunch of threads to do some processing: new Thread("upd-" + id){ @Override public void run(){ try{ doSomething(); } catch (Throwable e){ LOG.error("error", e); } finally{ LOG.debug("thread death"); } } }.start(); I know i should be using a threadPool but i need to understand the following problem before i change it: I'm using eclipse's debugger and looking at the threads in the debug pane which lists active threads. Many of them complete as you would expect, and are removed from the debug pane, however some seem to stay in the list of active threads even though the log shows the "thread death" entry for these. When i attempt to debug these threads, they either do not pause for debugging or show an error dialog: "A timeout occurred while retrieving stack frames for thread: upd-...". there is some synchronization going on within the doSomething() call but i'm fairly sure it's ok and since the "thread death" log is being called i'm assuming these threads aren't deadlocked in that method. i don't do any Thread.join()s, however i do call a third party API but doubt they do either. Can anyone think of another reason these threads are lingering? Thanks. EDIT: I created this test to check the Garbage Collection theory: Thread thread = new Thread("!!!!!!!!!!!!!!!!") { @Override public void run() { System.out.println("running"); ThreadUs.sleepQuiet(5000); System.out.println("finished"); // <-- thread removed from list here } }; thread.start(); ThreadUs.sleepQuiet(10000); System.out.println(thread.isAlive()); // <-- thread already removed from list but hasn't been GC'd ThreadUs.sleepQuiet(10000); this proves that it is nothing to do with garbage collection as eclipse removes the thread from the thread list as soon as it completes and isn't waiting for the object to be de-referenced/GC'd.

    Read the article

  • Interception with Unity in Prism v2 for WPF (not working for me)

    - by Bobby Chopra
    I cannot get interception to work with Prism v2 (Oct 2009). I am trying to intercept the Setter for any Public Properties and then fire the PropertyChanged event if the property has changed. I can see that the code gets executed (by stepping through with the debugger or adding a debug point). However, the WPF Window controls that are bound to these properties do not get updated. If I subscribe to these events and print to the console, I can print out the property change notifications. So, if the View has a textbox, which updates the property on the ViewModel, then the property in the ViewModel gets updated. However, if a button on the view (implemented as a DelegateCommand) causes the property to get updated, then the textbox (TwoWay Binding Mode) that is bound to that Property is not updated even though the event is triggered and the console has printed out the information about which property was updated. Has anyone encountered this issue? Here is the sample WPF Application that I have written. Wordpress doesn't allow uploads of zip files, so I renamed it to have a pdf extension (rename the file to have a zip extension). Please let me know what I am doing wrong. Thanks in advance.

    Read the article

  • How do I fix my "Stream closed" error in spring-ws?

    - by mcherm
    I have working code using the spring-ws library to respond to soap requests. I moved this code to a different project (I'm merging projects) and now it is failing. I would like to figure out the reason for the failure. The symptom I get is this: when the HTTP request arrives, spring begins handling the call. Then I get the following exception: org.springframework.ws.soap.saaj.SaajSoapEnvelopeException: Could not access envelope: java.io.IOException: Stream closed; nested exception is javax.xml.soap.SOAPException: java.io.IOException: Stream closed at org.springframework.ws.soap.saaj.SaajSoapMessage.getEnvelope(SaajSoapMessage.java:109) <<more lines that don't matter>> Caused by: java.io.IOException: Stream closed at java.io.PushbackInputStream.ensureOpen(PushbackInputStream.java:57) at java.io.PushbackInputStream.read(PushbackInputStream.java:116) at org.apache.xerces.impl.XMLEntityManager$RewindableInputStream.read(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) ... 30 more Examining it in a debugger, it appears that spring successfully handles HTTP headers, but then when it begins to process the contents of the SOAP message itself, it chokes when reading the very first character of the body. Some googling for the error message suggests that the problem is that a PushbackInputStream which is apparently used for reading from the socket is read twice or perhaps has close() called and then is read afterward. It is happening inside of spring-ws, not my code, and since it worked fine before I moved the code to a new project it must have something to do with versions of spring, or something it uses like axis or xerces. But I can't find any differences in versions of these! Has anyone encountered this error before? Or do you have any suggestions of approaches I could take in troubleshooting this?

    Read the article

  • Is this a tableView issue or a CoreData Issue

    - by monotreme
    I have a CoreData-driven navigation app and I'm trying to figure out why It's crashing. I've got a hierarchy which is 3 view Controllers deep, all related by coredata relatioships, like this. TableViewA =relationship= TableViewB =relationship= TableViewC I'm honestly a novice at core data and I think my problem lies in the fetched results controller. I have one in TableViewA and another in TableViewB, and no matter how deep I go, the console always cites TableViewB's fetched results controller methods after a crash. Is this the problem? What's happening specifically is if I launch my app and drill down into the hierarchy of one record, let's call it Record1, I can delete sub records to my hearts content. Gone! no problem! But the second I go back to TableViewA and drill down into a different record, let's call that one Record2, and try to delete it's subrecords my app crashes, with the console citing this code from TableViewB as the problem. - (void)controllerWillChangeContent:(NSFetchedResultsController *)controller { // The fetch controller is about to start sending change notifications, so prepare the table view for updates. [self.tableView beginUpdates]; } When I go into the debugger, the specific method it always has a problem with is: if (![x.managedObjectContext save:&error]) { NSLog(@"Unresolved error %@, %@", error, [error userInfo]); abort(); } Just a confirmation of my idiocy with CoreData is all I'm looking for I think. Oh and how many ManagedObjectContexts should I have in an app of this type. I've been told I should have separate ones for adding content, which then should re-integrate into the main one. Is this true? Thanks!

    Read the article

  • -[NSCFData writeStreamHandleEvent:]: unrecognized selector sent to instance in a stream callback

    - by user295491
    Hi everyone, I am working with streams and sockets in iPhone SDK 3.1.3 the issue is when the program accept a callback and I want to handle this writestream callback the following error is triggered " Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[NSCFData writeStreamHandleEvent:]: unrecognized selector sent to instance 0x17bc70'" But I don't know how to solve it because everything seems fine. Even when I run the debugger there is no error the program works. Any hint here will help! The code of the callback is: void myWriteStreamCallBack (CFWriteStreamRef stream, CFStreamEventType eventType, void *info){ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; Connection *handlerEv = [(Connection *)info retain] autorelease]; [handlerEv writeStreamHandleEvent:eventType]; [pool release]; } The code of the writeStreamHandleEvent: - (void)writeStreamHandleEvent:(CFStreamEventType) eventType{ switch(eventType) { case kCFStreamEventOpenCompleted: writeStreamOpen = YES; break; case kCFStreamEventCanAcceptBytes: NSLog(@"Writing in the stream"); [self writeOutgoingBufferToStream]; break; case kCFStreamEventErrorOccurred: error = CFWriteStreamGetError(writeStream); fprintf(stderr, "CFReadStreamGetError returned (%ld, %ld)\n", error.domain, error.error); CFWriteStreamUnscheduleFromRunLoop(writeStream, CFRunLoopGetCurrent(),kCFRunLoopCommonModes); CFWriteStreamClose(writeStream); CFRelease(writeStream); break; case kCFStreamEventEndEncountered: CFWriteStreamUnscheduleFromRunLoop(writeStream, CFRunLoopGetCurrent(),kCFRunLoopCommonModes); CFWriteStreamClose(writeStream); CFRelease(writeStream); break; } } The code of the stream configuration: CFSocketContext ctx = {0, self, nil, nil, nil}; CFWriteStreamSetClient (writeStream,registeredEvents, (CFWriteStreamClientCallBack)&myWriteStreamCallBack,(CFStreamClientContext *)(&ctx) ); CFWriteStreamScheduleWithRunLoop (writeStream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); You can see that there is nothing strange!, well at least I don't see it. Thank you in advance.

    Read the article

  • Why is iPdb not displaying STOUT after my input?

    - by BryanWheelock
    I can't figure out why ipdb is not displaying stout properly. I'm trying to debug why a test is failing and so I attempt to use ipdb debugger. For some reason my Input seems to be accepted, but the STOUT is not displayed until I (c)ontinue. Is this something broken in ipdb? It makes it very difficult to debug a program. Below is an example ipdb session, notice how I attempt to display the values of the attributes with: user.is_authenticated() user_profile.reputation user.is_superuser The results are not displayed until 'begin captured stdout ' In [13]: !python manage.py test Creating test database... < SNIP remove loading tables nosetests ...E.. /Users/Bryan/work/APP/forum/auth.py(93)can_retag_questions() 92 import ipdb; ipdb.set_trace() ---> 93 return user.is_authenticated() and ( 94 RETAG_OTHER_QUESTIONS <= user_profile.reputation < EDIT_OTHER_POSTS or user.is_authenticated() user_profile.reputation user.is_superuser c F /Users/Bryan/work/APP/forum/auth.py(93)can_retag_questions() 92 import ipdb; ipdb.set_trace() ---> 93 return user.is_authenticated() and ( 94 RETAG_OTHER_QUESTIONS <= user_profile.reputation < EDIT_OTHER_POSTS or c .....EE...... FAIL: test_can_retag_questions (APP.forum.tests.test_views.AuthorizationFunctionsTestCase) Traceback (most recent call last): File "/Users/Bryan/work/APP/../APP/forum/tests/test_views.py", line 71, in test_can_retag_questions self.assertTrue(auth.can_retag_questions(user)) AssertionError: -------------------- begin captured stdout << --------------------- ipdb True ipdb 4001 ipdb False ipdb --------------------- end captured stdout << ---------------------- Ran 20 tests in 78.032s FAILED (errors=3, failures=1) Destroying test database... In [14]: Here is the actual test I'm trying to run: def can_retag_questions(user): """Determines if a User can retag Questions.""" user_profile = user.get_profile() import ipdb; ipdb.set_trace() return user.is_authenticated() and ( RETAG_OTHER_QUESTIONS <= user_profile.reputation < EDIT_OTHER_POSTS or user.is_superuser) I've also tried to use pdb, but that doesn't display anything. I see my test progress .... , and then nothing and not responsive to keyboard input. Is this a problem with readline?

    Read the article

  • Why won't my program terminate?

    - by Qwertie
    I have a .NET Compact Framework app that can runs on three windows machines (Desktop windows and two WinCE machines) and on the WinCE devices, the process never terminates on exit, even if I call Application.Exit(). Besides .NET, it uses one COM component (which does everything on the UI thread). If I break into the debugger after exitting, Visual Studio shows only one thread and a completely blank call stack. What could possibly cause this? Update: My process is terminating on the desktop but not the WinCE machines. I tried to force the process to terminate with the following code, but it doesn't work: [DllImport("coredll.dll")] static extern int TerminateProcess(IntPtr hProcess, uint uExitCode); static public void ExitProcess() { if (Platform.IsWindowsCE) TerminateProcess(new IntPtr(-1), 0); Application.Exit(); } There are also supposed to be ExitProcess() and GetCurrentProcess() APIs like the following, but if I try to call them, I get EntryPointNotFoundException. Therefore I am using TerminateProcess(-1, 0) because the documentation for the desktop version of GetCurrentProcess claims that it simply returns -1. [DllImport("coredll.dll")] static extern int ExitProcess(IntPtr hProcess); [DllImport("coredll.dll")] static extern IntPtr GetCurrentProcess(); Even if I do this: static public void ExitProcess() { if (Platform.IsWindowsCE) TerminateProcess(new IntPtr(-1), 0); Application.Exit(); throw new Exception("Trying to force quit."); } A fatal error dialog appears with a helpful "Quit" button, but pushing the button still does not cause the process to terminate on either machine!

    Read the article

  • List.Sort in C#: comparer being called with null object

    - by cbp
    I am getting strange behaviour using the built-in C# List.Sort function with a custom comparer. For some reason it sometimes calls the comparer class's Compare method with a null object as one of the parameters. But if I check the list with the debugger there are no null objects in the collection. My comparer class looks like this: public class DelegateToComparer<T> : IComparer<T> { private readonly Func<T,T,int> _comparer; public int Compare(T x, T y) { return _comparer(x, y); } public DelegateToComparer(Func<T, T, int> comparer) { _comparer = comparer; } } This allows a delegate to be passed to the List.Sort method, like this: mylist.Sort(new DelegateToComparer<MyClass>( (x, y) => { return x.SomeProp.CompareTo(y.SomeProp); }); So the above delegate will throw a null reference exception for the x parameter, even though no elements of mylist are null. UPDATE: Yes I am absolutely sure that it is parameter x throwing the null reference exception! UPDATE: Instead of using the framework's List.Sort method, I tried a custom sort method (i.e. new BubbleSort().Sort(mylist)) and the problem went away. As I suspected, the List.Sort method passes null to the comparer for some reason.

    Read the article

  • Working with ieee format numbers in ARM

    - by Jake Sellers
    I'm trying to write an ARM program that will convert an ieee number to a TNS format number. TNS is a format used by some super computers, and is similar to ieee but different. I'm trying to use several masks to place the three different "part" of the ieee number in separate registers so I can move them around accordingly. Here is my unpack subroutine: UnpackIEEE LDR r1, SMASK ;load the sign bit mask into r1 LDR r2, EMASK ;load the exponent mask into r2 LDR r3, GMASK ;load the significand mask into r3 AND r4, r0, r1 ;apply sign mask to IEEE and save into r4 AND r5, r0, r2 ;apply exponent mask to IEEE and save into r5 AND r6, r0, r3 ;apply significand mask to IEEE and save into r6 MOV pc, r14 ;return And here are the masks and number declarations so you can understand: IEEE DCD 0x40300000 ;2.75 decimal or 01000000001100000000000000000000 binary SMASK DCD 0x80000000 ;Sign bit mask EMASK DCD 0x7F800000 ;Exponent mask GMASK DCD 0x007FFFFF ;Significand mask When I step through with the debugger, the results I get are not what I expect after working through it on paper. EDIT: What I mean, is that after the subroutine runs, registers 4, 5, and 6 all remain 0. I can't figure out why the masks are not working. I think I do not fully understand how the number is being stored in the register or using the masks wrong. Any help appreciated. If you need more info just ask. EDIT: entry point: Very simple, just trying to get these subroutines working. ENTRY LDR r1, IEEE ;load IEEE num into r1 BL UnpackIEEE ;call unpack sub SWI SWI_Exit ;finish

    Read the article

  • Converting UnicodeString to PAnsiChar in Delphi XE

    - by moodforaday
    In Delphi XE I am using the BASS audio library, which contains this function: function BASS_StreamCreateURL(url: PAnsiChar; offset: DWORD; flags: DWORD; proc: DOWNLOADPROC; user: Pointer):HSTREAM; stdcall; external bassdll; The 'url' parameter is of type PAnsiChar, so in my code I do a cast: FStreamHandle := BASS_StreamCreateURL(PAnsiChar( url ) [...] The compiler emits a warning on this line: "suspicious typecast of string to PAnsiChar". In trying to eliminate the warning, I found that the recommended way is to use a double cast: FStreamHandle := BASS_StreamCreateURL(PAnsiChar( AnsiString( url )) [...] This does eliminate the warning, but the BASS function now returns error code 2 ("cannot open file"), which tells me the URL string it receives is somehow broken. I cannot see what the bass DLL actually receives, but using a breakpoint in the debugger the string looks good: var s : PAnsiChar; begin s := PAnsiChar( AnsiString( url )); At this point string s appears fine, but the BASS function fails when I pass it. My initial code: PAnsiChar( url ) works well with BASS, but emits a warning. So what's the correct way of getting from UnicodeString to PAnsiChar without a warning?

    Read the article

  • Linq-to-SQL produces bad SQL?

    - by strager
    I am trying to run a Linq-to-SQL query, but when the query is evaluated, I get the following exception: System.Data.OleDb.OleDbException was unhandled Message=The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect. Source=Microsoft JET Database Engine ErrorCode=-2147217900 StackTrace: at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.OleDb.OleDbCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader() at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult) at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries) at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) at System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute[S](Expression expression) at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source) at xxx.InventoryPopulator`2.Clear(String barcode) in F:\Projects\C#\xxx\xxx\InventoryPopulator.cs:line 38 [..etc..] InnerException: The debugger shows my query is: SELECT [t0].[SupplierID] AS [Id], [t0].[SupplierSKU] AS [Sku], [t0].[LocalSKU] AS [LocalSku], [t0].[ManufacturersBarcode] AS [Barcode], [t0].[QuantityAvailable] FROM [inventorySupplier] AS [t0] WHERE [t0].[ManufacturersBarcode] = @p0 And the Linq query which generates the above is: var items = from item in this.supplierItems where item.Barcode == barcode select item; How do I fix my query?

    Read the article

  • .NET CF -- Set Form height based on InputPanel state

    - by user354941
    Hi, So, I've got a C# project for Windows Mobile phones and I'm trying to work with the InputPanel. Specifically, I've got one form with a stack of Labels and TextBoxes that collect user input. I have an InputPanel that alerts me when the user opens the SIP. Everything works fine so far. When I get messages that the SIP status has changed, I want to change the height of the Form, which doesn't seem possible. Here's my event handler for my InputPanel: void m_InputPanel_EnabledChanged(object sender, EventArgs e) { // :( this assignment operation doesn't work and it doesn't this.ClientSize = inputPanel1.VisibleDesktop.Size; // doesn't work this.Size = inputPanel1.VisibleDesktop.Size; // assignment operation works, but isn't very useful this.visibleHeight = inputPanel1.VisibleDesktop.Height; this.InitializeUI(); } When I say that the assignment operation doesn't work, I mean that the values don't change in the debugger. I can understand that maybe I can't change the size of a Form, but I can't understand why trying to change it wouldn't throw an exception, or give a compiler error. I have my Form WindowState set to Normal instead of Maximized, but it doesn't make a difference. Also, I have read http://www.christec.co.nz/blog/archives/42 this page that tells me how I'm supposed to do this, but I can't easily put all of my controls in a Panel because I'm using a bunch of custom stuff to do alpha background controls.

    Read the article

  • Why can't I initialize a class through a setter?

    - by Rob emenaker
    If I have a custom class called Tires: #import <Foundation/Foundation.h> @interface Tires : NSObject { @private NSString *brand; int size; } @property (nonatomic,copy) NSString *brand; @property int size; - (id)init; - (void)dealloc; @end ============================================= #import "Tires.h" @implementation Tires @synthesize brand, size; - (id)init { if (self = [super init]) { [self setBrand:[[NSString alloc] initWithString:@""]]; [self setSize:0]; } return self; } - (void)dealloc { [super dealloc]; [brand release]; } @end And I synthesize a setter and getter in my View Controller: #import <UIKit/UIKit.h> #import "Tires.h" @interface testViewController : UIViewController { Tires *frontLeft, *frontRight, *backleft, *backRight; } @property (nonatomic,copy) Tires *frontLeft, *frontRight, *backleft, *backRight; @end ==================================== #import "testViewController.h" @implementation testViewController @synthesize frontLeft, frontRight, backleft, backRight; - (void)viewDidLoad { [super viewDidLoad]; [self setFrontLeft:[[Tires alloc] init]]; } - (void)dealloc { [super dealloc]; } @end It dies after [self setFrontLeft:[[Tires alloc] init]] comes back. It compiles just fine and when I run the debugger it actually gets all the way through the init method on Tires, but once it comes back it just dies and the view never appears. However if I change the viewDidLoad method to: - (void)viewDidLoad { [super viewDidLoad]; frontLeft = [[Tires alloc] init]; } It works just fine. I could just ditch the setter and access the frontLeft variable directly, but I was under the impression I should use setters and getters as much as possible and logically it seems like the setFrontLeft method should work. This brings up an additional question that my coworkers keep asking in these regards (we are all new to Objective-C); why use a setter and getter at all if you are in the same class as those setters and getters.

    Read the article

  • C#/.Net Error: MySql.Data Object reference not set to an instance of an object.

    - by Simon
    Hello, I get this exception on my Windows 7 64bit in application running in VS 2008 express. I am using Connector/Net 6.2.2.0: Message: Object reference not set to an instance of an object. Source: MySql.Data in MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId) Stack trace: in MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId) in MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId) in MySql.Data.MySqlClient.MySqlDataReader.NextResult() in MySql.Data.MySqlClient.MySqlDataReader.Close() in MySql.Data.MySqlClient.MySqlConnection.Close() in MySql.Data.MySqlClient.MySqlConnection.Dispose(Boolean disposing) in System.ComponentModel.Component.Finalize() No inner exception. This exception is unhalted and the debugger dont point on any code line. It just say "Object reference not set to an instance of an object. MySql.Data" This error is really hard to repeat. On my Windows XP 32bit is all ok. Could it be error in 64bit Windows 7? Thank you very much for your answers. Regards, simon

    Read the article

  • [Google Maps] Trouble with invalid argument when switching jQueryUI based tabs

    - by Chad
    Here's a page with the issue To reproduce the error, using IE - click the directions tab, then any of the others. What I'm trying to do is this: On page load, do nothing really. However, when the directions tab loads - setup the map. Like so: $('#tabs').bind('tabsshow', function(event, ui) { if (ui.panel.id == "tabs-5") { // get map for directions var dirMap = new GMap2($("div#dirMap").get(0)); dirMap.setCenter(new GLatLng(35.79648921414565,139.40663874149323), 12); dirMap.enableScrollWheelZoom(); dirMap.addControl(new PanoMapTypeControl()); geocoder = new GClientGeocoder(); $("#dirMap").resizable({ stop: function() { dirMap.checkResize(); } }); // clear dirText $("div#dirMapText").html(""); dirMap.clearOverlays(); var polygon = new GPolygon([new GLatLng(35.724496338474104,139.3444061279297),new GLatLng(35.74748750802863,139.3363380432129),new GLatLng(35.75765724051559,139.34303283691406),new GLatLng(35.76545779822543,139.3418312072754),new GLatLng(35.767547103447725,139.3476676940918),new GLatLng(35.75835374997911,139.34955596923828),new GLatLng(35.755149755962755,139.3567657470703),new GLatLng(35.74679090345495,139.35796737670898),new GLatLng(35.74762682821177,139.36294555664062),new GLatLng(35.744422402303826,139.36346054077148),new GLatLng(35.74860206266584,139.36946868896484),new GLatLng(35.735644401200986,139.36843872070312),new GLatLng(35.73843117306677,139.36174392700195),new GLatLng(35.73592308277646,139.3531608581543),new GLatLng(35.72686543236113,139.35298919677734),new GLatLng(35.724496338474104,139.3444061279297)], "#f33f00", 5, 1, "#ff0000", 0.2);dirMap.addOverlay(polygon); // load directions directions = new GDirections(dirMap, $("div#dirMapText").get(0)); directions.load("from: [email protected],139.37083393335342 to: Ruby [email protected],139.40663874149323"); } }); What the heck is causing the error? The IE javascript debugger claims the error lies in main.js, line 139 character 28. (the google maps api file). Which is this line: function zf(a,b){a=a.style;a.width=b.getWidthString();a.height=b.getHeightString()} Any ideas? Thanks in advance!

    Read the article

  • _resignRootViewController causes app to crash.

    - by RickiG
    [MainViewController _resignRootViewController]: message sent to deallocated instance 0x4ebfe50 This error happens when I try to pop my MainViewController Object from within it self: - (void) switchToTableView { //a method on the MainViewController [self.navigationController popViewControllerAnimated:NO]; [[UIApplication applicationDelegate] switchToTableView]; //convenience method for the app delegate } The debugger stops at the [super dealloc] command in MainViewControllers dealloc method. I do the exact same thing in the TripTableViewController, but here it never crashes. MainViewController and TripTableViewController are handled in my AppDelegate like this: - (void) switchToTableView { TripTableViewController *tripTableViewController = [[TripTableViewController alloc] init]; [[self.navigationController navigationBar] setHidden:NO]; [self.navigationController pushViewController:tripTableViewController animated:NO]; [tripTableViewController release]; } - (void) switchToScrollView { MainViewController *scrollView = [[MainViewController alloc] init]; [[self.navigationController navigationBar] setHidden:YES]; [self.navigationController pushViewController:scrollView animated:NO]; [scrollView release]; } I am trying to achieve that when the user goes from TripTableViewController to MainViewController; TripTableViewController is released/popped and visa versa for the MainViewController. I do not wish for the navigationController to make the decision about when to pop/cache/release them, this is why I try to do it from within it self. I have not been able to find the _resignRootViewController mentioned anywhere. My guess is that it is a delegate message sent by a ViewController that resigns as rootViewController for a navigationController and that somehow it is called twice, once before MainViewCOntroller is released/popped and somehow again afterwards. Have any one else seen this error message before? Google and the Apple Docs does not mention it? How can I debug such an error? Hope someone can guide me in the right direction on this one, Thanks:)

    Read the article

  • What programming hack from your past are you most ashamed of?

    - by LeopardSkinPillBoxHat
    We've all been there (usually when we are young and inexperienced). Fixing it properly is too difficult, too risky or too time-consuming. So you go down the hack path. Which hack from your past are you most ashamed of, and why? I'm talking about the ones where you would be really embarrassed if someone could attribute the hack to you (quite easily if you are using revision control software). One hack per answer please. Mine was shortly after I started in my first job. I was working on a legacy C system, and there was this strange defect where a screen view failed to update properly under certain circumstances. I wasn't familiar with how to use the debugger at this time, so I added traces into the code to figure out what was going on. Then I realised that the defect didn't occur anymore with the traces in the code. I slowly backed out the traces one-by-one, until I realised that only a single trace was required to make the problem go away. My logic now would tell me that I was dealing with some sort of race-condition or timing related issue that the trace just "hid under the rug". But I checked in the code with the following line, and all was well: printf(""); Which hacks are you ashamed of?

    Read the article

  • Iterating through controls on a Windows Form

    - by icemanind
    I seem to have some weird issue going on that I am sure will turn out to be a simple thing. I have a Windows Form and on the form I have 1 panel called MainPanel and inside MainPanel, I got another panel with a button inside and a label that is inside MainPanel, but not in the second panel. 2 controls. What I am trying to do is copy all the controls inside MainPanel over to another panel object. I am using the following C# code to do this: GUIPanel gp = new GUIPanel(); foreach (System.Windows.Forms.Control ctrl in gp.Controls["MainPanel"].Controls) { m_OptionsControl.Controls.Add(ctrl); } When I run this code, it copies over the panel with the button, but not the label. What's even more odd is when I set a breakpoint and run it through the debugger, and I type "?gp.Controls["MainPanel"].Controls.Count" in the immediate window, it returns 2, just like it should. However, when stepping through the code, it only executes the foreach loop once. What am I missing here?

    Read the article

  • Python: puzzling behaviour inside httplib

    - by Anna
    I have added one line ( import pdb; pdb.set_trace() ) to httplib's HTTPConnection.putheader, so I can see what's going on inside. httplib.py, line 489: def putheader(self, header, value): """Send a request header line to the server. For example: h.putheader('Accept', 'text/html') """ import pdb; pdb.set_trace() if self.__state != _CS_REQ_STARTED: raise CannotSendHeader() str = '%s: %s' % (header, value) self._output(str) then ran this from the interpreter import urllib2 urllib2.urlopen('http://www.ioerror.us/ip/headers') ... and as expected PDB kicks in: > c:\python26\lib\httplib.py(858)putheader() -> if self.__state != _CS_REQ_STARTED: (Pdb) in PDB I have the luxury of evaluating expressions on the fly, so I have tried to enter self.__state: (Pdb) self.__state *** AttributeError: HTTPConnection instance has no attribute '__state' Alas, there is no __state of this instance. However when I enter step, the debugger gets past the if self.__state != _CS_REQ_STARTED: line without a problem. Why is this happening? If the self.__state doesn't exist python would have to raise an exception as it did when I entered the expression. Python version: 2.6.4 on win32

    Read the article

  • TypeError: Error #1009 - (Null reference error) With Flash.

    - by Wind Chimez
    I am not an expert in flash, but i do work with AS and tweak Flash projects , though not having deep expertise in it. Currently i need to revamp a flash website done by one another guy, and the code base given to me, upon execution is throwing the following error. "--- TypeError: Error #1009: Cannot access a property or method of a null object reference. at NewSite_fla::MainTimeline/__setProp_ContactOutP1_ContactOut_Contents_0() at NewSite_fla::MainTimeline/frame1() --" The structure of the project is like, it has the different sections split into different movie clips. There is no single main timeline, but click actions on different areas of seperate movie clips will take them between one another. All the AS logic of event handling are written inline in FLA , no seperate Document class exists. Preloader Movie clip is the first one getting loaded. As i understood the error is getting thrown initially itself, and it is not happening due to any Action script logic written inline, because it is throwing error even before hitting the first inline AS code. I am not able to figure Out what exactly it causing the problem, or where to resolve it. I setup the stuff online, for reference if anybody want to take a look at it, and here is the link.You need to have flash debugger turned ON in your browser, if need to see the exception getting triggered. http://tinyurl.com/2alvlfx I really got stuck at this point. Any help will be great.I had not seen the particular solution i am looking for anywhere yet, though Error #1009 is common.

    Read the article

  • Bound checkbox does not update its datasource.

    - by Scott Chamberlain
    I have a checkbox who's checked value is bound to a binding source which is bound to a boolean data table column. When I click my save button to push my changes in my data table to my sql server the value in the data table is never changed. Designer code. this.cbxKeepWebInfinityChanges = new System.Windows.Forms.CheckBox(); this.preProductionBindingSource = new System.Windows.Forms.BindingSource(); // // cbxKeepWebInfinityChanges // this.cbxKeepWebInfinityChanges.AutoSize = true; this.cbxKeepWebInfinityChanges.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.preProductionBindingSource, "WEBINFINTY_CHANGES", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.cbxKeepWebInfinityChanges.Location = new System.Drawing.Point(6, 98); this.cbxKeepWebInfinityChanges.Name = "cbxKeepWebInfinityChanges"; this.cbxKeepWebInfinityChanges.Size = new System.Drawing.Size(152, 17); this.cbxKeepWebInfinityChanges.TabIndex = 30; this.cbxKeepWebInfinityChanges.Text = "Keep WebInfinity Changes"; this.cbxKeepWebInfinityChanges.UseVisualStyleBackColor = true; this.cbxKeepWebInfinityChanges.CheckedChanged += new System.EventHandler(this.CauseApplyChangesActivation); // // preProductionBindingSource // this.preProductionBindingSource.AllowNew = false; this.preProductionBindingSource.DataMember = "PreProduction"; this.preProductionBindingSource.DataSource = this.salesLogix; Save Code //the comments are the debugger values before the call in going from checked when loaded to unchecked when saved. private void btnApplyChanges_Click(object sender, EventArgs e) { (...) // non related saving logic for other controls preProductionBindingSource.EndEdit(); // checked = false, databinding = true, datatable = true preProductionTableAdapter.Update(salesLogix.PreProduction); // checked = false, databinding = true, datatable = true } After the saving code the box rechecks itself. The same things happens when going from unchecked to checked. does not save the change and reverts to the old value. Other items I have bound to the same data-binding source (I have two combo boxes) are updating correctly.

    Read the article

< Previous Page | 49 50 51 52 53 54 55 56 57 58 59 60  | Next Page >