Search Results

Search found 3592 results on 144 pages for 'pointer'.

Page 91/144 | < Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >

  • variable names in function definition, call and declaration

    - by yCalleecharan
    Hi, I see C books that use the same variable names in the function definition, calling function and declaration. Others use the same variable names in the calling function and in the declaration/prototype but a different one in the definition as in: void blabla(int something); //prototype blabla(something) // calling function inside main after something has been initialized to int void blabla(int something_else) //definition I have two questions: What convention is best to use in C?; Does the convention apply regardless whether a value is being passed "by-value" or if it's being passed by a pointer? Thanks a lot...

    Read the article

  • How to dynamically replace a method implementation in ObjC2?

    - by Abhi
    I am trying to learn how to write plugins using SIMBL. I got my plugin to load with the target application, and also know the method that I wish to override. However, I am not able to use class_getInstanceMethod correctly based on snippets on the Internet. Have things changed in OSX 10.6 and/or ObjC2? The following code from culater.net gives "Dereferencing pointer to incomplete type" on the second-last statement: BOOL DTRenameSelector(Class _class, SEL _oldSelector, SEL _newSelector) { Method method = nil; // First, look for the methods method = class_getInstanceMethod(_class, _oldSelector); if (method == nil) return NO; method->method_name = _newSelector; return YES; } Is there a complete example of how to override a method using SIMBL plugins? Thanks!

    Read the article

  • Hide select option Cross Browser

    - by Tapas Bose
    Isn't there any way to do it? I have made jsFiddle which is not working in IE. The piece of code is given below: The HTML <select id="testing"> <option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> </select> The jQuery $(document).ready(function() { $('select#testing option').eq(1).attr({ disabled: 'disabled' }); }); The CSS select option[disabled] {display: none;} Any pointer would be helpful. Note: I cannot use .remove() method.

    Read the article

  • Does the WCF framework support the XSD IDREF restriction?

    - by Gerard
    A nice feature in XSD is the IDREF restriction, e.g.: <xs:restriction base="xs:IDREF"> <xs:pattern value="[0-9a-zA-Z\-]+"/> </xs:restriction> I used this restriction with great benefit in a Java JAXWS-project. An object serialized in a SOAP XML datamodel can hold a reference (pointer) to another object in the same SOAP message. I want to try the same approach in a C# WCF-project, can it be done? On the web site Data Contract Schema Reference I can see e.g. Id ignored, Ref forbidden, but I am not sure whether I understand what that means.

    Read the article

  • EXC_BAD_ACCESS when not using self.

    - by chris
    I got nabbed by the following bug again and would like some clarification to exactly why it is a bug. I have a simple UITableView that loads some data: // myclass.h @property (nonatomic, retain) NSArray *myData // myclass.m @synthesize myData; - (void) viewDidLoad { ... myData = someDataSource // note the lack of self } - (UITableViewCell *) cellForRowAtIndexPath ... { ... cell.textLabel.text = [self.myData objectAtIndex:indexPath.row]; // EXC_BAD_ACCESS } The table first loads fine, but when scrolling up enough that one of the cells is totally out of the view I then get the EXC_BAD_ACCESS error. Am I missing something in regards to @property retain. My understanding is that it releases anything that the pointer was previously pointing to before the reassignment. If I am correct then why would not using self. cause any problems? Thanks for the help.

    Read the article

  • Server returned HTTP response code: 500 for URL

    - by user617162
    java.io.IOException: Server returned HTTP response code: 500 for URL: http://ww .huadt.com.cn/zh-cn/i/l/@357671030745308@V500@0000@AUTOLOW@1@11d590f7$GPRMC,065 48.000,A,3959.8587,N,11617.2447,E,0.00,55.32,210311,,,A*56@@ at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown S urce) at hdt.SendCmdToP.Sendplatform(SendCmdToP.java:67) at hdt.SendCmdToP.process(SendCmdToP.java:198) at hdt.SendCmdToP.run(SendCmdToP.java:131) java.lang.NullPointerException at hdt.SendCmdToP.Sendplatform(SendCmdToP.java:91) at hdt.SendCmdToP.process(SendCmdToP.java:198) at hdt.SendCmdToP.run(SendCmdToP.java:131) Appeared pointer, and 500 wrong with the closure of the abnormal, a firewall relationship? If not is it code problems? Please help everybody see how to solve the problem. thanks?

    Read the article

  • What's the big difference between those two binary files?

    - by Lela Dax
    These are two files (contained in the tar.bz2) that were generated using a just-in-time compiler for a game engine. The generated code from ui-linux.bin is from a x86_64 gcc compiler and the ui-windows.bin from the same brand of compiler but targetting win x86_64 (mingw-w64). I've attempted to debug a problem that occurs only on the windows version and i stumbled upon what it seems to be different end-binary code. However, the input assembly code was virtually identical (only difference being pointer representations as int). (there's theoretically no winabi/unixabi conflict since that's taken care of by an attribute flag on certain declarations involved). Any idea what it might be that makes these two binary codes different? The C for the mini-compiler and base assembly producing it appears compatible at first glance. http://www0.org/vm/bins.tar.bz2

    Read the article

  • shared_ptr requires complete type; cannot use it with lua_State*

    - by topright
    Hello! I'm writing a C++/OOP wrapper for Lua. My code is: class LuaState { boost::shared_ptr<lua_State> L; LuaState(): L( luaL_newstate(), LuaState::CustomDeleter ) { } } The problem is lua_State is incomplete type and shared_ptr constructor requires complete type. And I need safe pointer sharing. (Funny thing boost docs say most functions do not require complete type, but constructor requires, so there is no way of using it. http://www.boost.org/doc/libs/1_42_0/libs/smart_ptr/smart_ptr.htm) Can can I solve this? Thank you.

    Read the article

  • How do I read an arbitrary chunk from a PNG file?

    - by Mason Wheeler
    I've got some custom metadata to put into a PNG file. It's being saved through libpng, and it's not difficult to write out a custom chunk. I just call png_write_chunk with the name, length and data. But I can't see how to get the data back out again. I'd expect there to be a png_read_chunk function that takes a chunk name and returns a pointer to the data or something like that, but there's nothing like that in png.h. Does anyone know how to accomplish this?

    Read the article

  • Objects in interface

    - by Peter Kowalchuk
    I created my own object, PKSurvey. In the interface of the View Controller I can define a pointer to it, then in a method I can alloc it and have an instance. How do I keep the instance beyond the method where it was allocated? I assign values in one method and want to be able to use those values in other methods. Should I allocate it in the viewDidLoad method or should I do it somewhere else? @interface DIrectionalDrillerViewController : UIViewController { PKSurvey *Survey=[PKSurvey new]; ---------------- - (void)viewDidLoad { [Survey new];

    Read the article

  • How to improve performance

    - by Ram
    Hi, In one of mine applications I am dealing with graphics objects. I am using open source GPC library to clip/merge two shapes. To improve accuracy I am sampling (adding multiple points between two edges) existing shapes. But before displaying back the merged shape I need to remove all the points between two edges. But I am not able to find an efficient algorithm that will remove all points between two edges which has same slope with minimum CPU utilization. Currently all points are of type PointF Any pointer on this will be a great help.

    Read the article

  • What is a practical, real world example of the Linked List?

    - by JStims
    I understand the definition of a Linked List, but how can it be represented and related to a common concept or item? For example, inheritance in OOP can be related to automobiles. All (most) automobiles in real life are the essentially same thing; an automobile has an Engine, you can start() it, you can make the car go(), stop() and so on. An automobile would typically have a maximum passenger capacity but it would differ between a Bus and a SportsCar, which are both automobiles. Is there some real life, intuitive example of the plain ole' singly Linked List like we have with inheritance? The typical textbook Linked List example shows a node with an integer and a pointer to the next, and it just doesn't seem very useful. Your input is appreciated.

    Read the article

  • How to set a reference from one object to another?

    - by Tzur Gazit
    Hi, Imagine the obvious model of employees and departments, where each employee must refer to a single department, and each department may have none to many employees. For Employee I have a pointer to Department, and I set its value to the address of the object of the relevant Department. When I try to save the Employee I get an error: 2010-04-07 10:05:22.491 CoreData2[1112:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: Department)' I tried, just for testing, to make the reference from Employee to Department optional, but I get the same result. I'm having my first steps in CoreData so please be as clear and simple as you can. Thanks, Tzur.

    Read the article

  • Container of shared_ptr's but iterate with raw pointers

    - by Sean Lynch
    I have a class that holds a list containing boost::shared_ptrs to objects of another class. The class member functions that give access to the elemets in the list return raw pointers. For consistency I'd also like to be able to iterate with raw pointers instead of shared_ptrs. So when I dereference the list iterator, I'd like to get raw pointer, not a shared_ptr. I assume I need to write a custom iterator for this. Is this correct? If so can someone point me in the right direction - I've never done this before.

    Read the article

  • Anyone know how to use TValue.AsType<TNotifyEvent> properly?

    - by Mason Wheeler
    I'm trying to use RTTI to add an event handler to a control, that may already have an event handler set. The code looks something like this: var prop: TRttiProperty; val: TValue; begin prop := FContext.GetType(MyControl.ClassInfo).GetProperty('OnChange'); val := prop.GetValue(MyControl); FOldOnChange := val.AsType<TNotifyEvent>; prop.SetValue(MyControl, TValue.From<TNotifyEvent>(self.MyOnChange)); end; I want this so I can do this in MyOnChange: begin if assigned(FOldOnChange) then FOldOnChange(Sender); //additional code here end; Unfortunately, the compiler doesn't seem to like the line FOldOnChange := val.AsType<TNotifyEvent>;. It says E2010 Incompatible types: 'procedure, untyped pointer or untyped parameter' and 'TNotifyEvent' Anyone know why that is or how to fix it? It looks right to me...

    Read the article

  • How can I find the places of system calls of my program?

    - by Lucky Man
    From strace manual: -i Print the instruction pointer at the time of the system call. I straced my programm: strace -i prog As a result I got a lot of system calls. One of them: [000da49c] open("./rabbit.o", O_RDONLY) = 3 But disassembled instruction at this address of prog doesn't call any syscall (hte editor): da49c ! mov r7, ip What is wrong? How can I find the places of system calls of my program? P.S. Architecture of my device doesn't support GDB-command catch syscall.

    Read the article

  • C++ and Scripting.Dictionary from scrrun.dll

    - by MaxFX
    Hello. I have some trouble with Scripting.Dictionary in C++. I'm trying to use interface IDictionary via smart pointer but methods of creating object don't work and I can't understand why. CoInitialize(NULL); IDictionaryPtr dict; dict.CreateInstance(__uuidof(Dictionary)); _variant_t num1 = 1; _variant_t num2 = 2; dict->Add(&num1, &num2); long i; dict->get_Count(&i); cout << i << "\n"; But method Add does not work and cout of elements in dictionary is always 0. How correct to use Scripting.Dictionary in that case. PS.: I'm getting Scripting interfaces by #import "scrrun.dll"

    Read the article

  • Alternative to c++ static virtual methods

    - by Jaime Pardos
    In C++ is not possible to declare a static virtual function, neither cast a non-static function to a C style function pointer. Now, I have a plain ol' C SDK that uses function pointers heavily. I have to fill a structure with several function pointers. I was planning to use an abstract class with a bunch of static pure virtual methods, and redefine them in derived classes and fill the structure with them. It wasn't until then that I realized that static virtual are not allowed in C++. Is there any good alternative? The best I can think of is defining some pure virtual methods GetFuncA(), GetFuncB(),... and some static members FuncA()/FuncB() in each derived class, which would be returned by the GetFuncX(). Then a function in the abstract class would call those functions to get the pointers and fill the structure.

    Read the article

  • compilation error: request member in something not a structure of union

    - by Fantastic Fourier
    Hi everybody, I'm having the above error request member rv in something not a structure of union. I've googled it and several answers told me it's when working with a pointer but tries to access it as a struct, where I should be using -> instead of . int foo(void * arg, struct message * msg) { struct fd_info * info = (struct something *) arg; int * socks[MAX_CONNECTION]; socks = &(info->_socks); // where int * _socks[MAX_CONNECTION] in struct info // do other things rv = sendto(socks[i], &msg, sizeof(&msg), NULL, &(csys->client_address), sizeof(csys->client_address)); ... } The problem is all of the arguments i have are pointers. i'm confused as to what is wrong. thanks to any comments/thoughts.

    Read the article

  • How to stop toggle event from being fired multiple times on mouseenter/mouseleave?

    - by Clean
    Hi, I'm using jQuery to toggle the visibility of a using the jQuery toggle method. The toggle is fired on the mouseenter and mouseleave event, thus creating the effect of the div to fold out on mouseenter and fold in on mouseleave. Problem is, if the user drags the mouse over the a few times and then leaves the , the div will toggle in and out several times. This can happen if the user accidentally moves around the mouse pointer in the are. Do anyone have any idea on how I can avoid this behavior? Thanx!

    Read the article

  • IO completion port key confusion

    - by Richard Tew
    I'm writing an IO completion port based server (source code here) using the Windows DLL API in Python using the ctypes module. But this is a pretty direct usage of the API and this question is directed at those who have a knowledge of IOCP, not Python. As I understand the documentation for CreateIoCompletionPort, you specify your "user defined" completion key when you call this function with a file handle (in my case a socket) you are associating with the created IOCP. When you get around to calling GetQueuedCompletionStatus, you get a completion key value along with a pointer to an overlapped object. The completion key should identify what overlapped object and request has completed. However, let's say I pass in 100 as the completion key in my CreateIoCompletionPort call with an overlapped object. When the same overlapped object has its IO completed and it arrives back through GetQueuedCompletionStatus, the completion key that accompanies it is much larger and bares no resemblance to the original value of 100. Am I misunderstanding how the completion key works, or must I be doing it wrong in the source code I linked above?

    Read the article

  • HierarchicalDataTemplate Link By Parent

    - by Andrew Kalashnikov
    Hello colleagues. I want bind my treeview. There are a lot of samples binding treeview by object, which contains children collection. I've got domain having just Parent pointer. public class Service : BaseDomain { public virtual string Name { get; set; } public virtual string Description { get; set; } public virtual Service Parent { get; set; } } Can I bind collection of this objects to my treeView. Thanks

    Read the article

  • drupal bootstrap script: how to get list of all nodes of type x?

    - by groovehunter
    hi. I create a custom import and export, at the moment as an external script (via bootstrap), i plan to create a module in a more generic fashion lateron. I am building a frontend for nagios and for our host management and nagios configuration btw. Maybe it might become useful for other environments (networkmanagement) Now i need to know how to get list of all nodes of type x? I want to avoid direct SQL. A suggestion i got was to make an rss and parse it but i acess the drupal db a dozen times to extract various nodes, so it feels strange to do a web request for one thing So what i am looking for as newbie drupal dev is just a pointer to basic search module api for this task TIA florian

    Read the article

  • C# SendMessage to C++ WinProc

    - by jws
    I need to send a string from C# to a C++ WindowProc. There are a number of related questions on SO related to this, but none of the answers have worked for me. Here's the situation: PInvoke: [DllImport("user32", CharSet = CharSet.Auto)] public extern static int SendMessage(IntPtr hWnd, uint wMsg, IntPtr wParam, string lParam); C#: string lparam = "abc"; NativeMethods.User32.SendMessage(handle, ConnectMsg, IntPtr.Zero, lparam); C++: API LRESULT CALLBACK HookProc (int code, WPARAM wParam, LPARAM lParam) { if (code >= 0) { CWPSTRUCT* cwp = (CWPSTRUCT*)lParam; ... (LPWSTR)cwp->lParam <-- BadPtr ... } return ::CallNextHookEx(0, code, wParam, lParam); } I've tried a number of different things, Marshalling the string as LPStr, LPWStr, also tried creating an IntPtr from unmanaged memory, and writing to it with Marshal.WriteByte. The pointer is the correct memory location on the C++ side, but the data isn't there. What am I missing?

    Read the article

  • Using a WinForm as a Windows Installer Custom Action

    - by Serexx
    Hello - I am working on in installer project that needs to gather some info and act on it during the install (mainly online key retreival and registration). The Setup Project UserInterface templates seem inflexible and poorly documented so I am looking at opening a WinForm as a Custom Action. I know this is possible because I see reference to it in many places but this is my first Windows Installer experience and so far it is mired in googled contradictions, partial or outdated information and guesswork... erg.... Does anyone have (even a pointer to) a clear concise description of how one gets this done in a VS 2008 WinForm project... Many thanks for inputs

    Read the article

< Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >