Daily Archives

Articles indexed Friday March 12 2010

Page 16/130 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • C# wrapper and Callbacks

    - by fergs
    I'm in the process of writing a C# wrapper for Dallmeier Common API light (Camera & Surviellance systems) and I've never written a wrapper before, but I have used the Canon EDSDK C# wrapper. So I'm using the Canon wrapper as a guide to writing the Dallmeier wrapper. I'm currently having issues with wrapping a callback. In the API manual it has the following: dlm_connect int(unsigned long uLWindowHandle, const char * strIP, const char* strUser1, const char* strPwd1, const char* strUser2, const char* strPwd2, void (*callback)(void *pParameters, void *pResult, void *pInput), void * pInput) Arguments - ulWindowhandle - handle of the window that is passed to the ViewerSDK to display video and messages there - strUser1/2 - names of the users to log in. If only single user login is used strUser2 is - NULL - strPwd1/2 - passwords of both users. If strUser2 is NULL strPwd2 is ignored. Return This function creates a SessionHandle that has to be passed Callback pParameters will be structured: - unsigned long ulFunctionID - unsigned long ulSocketHandle, //handle to socket of the established connection - unsigned long ulWindowHandle, - int SessionHandle, //session handle of the session created - const char * strIP, - const char* strUser1, - const char* strPwd1, - const char* strUser2, - const char * strPWD2 pResult is a pointer to an integer, representing the result of the operation. Zero on success. Negative values are error codes. So from what I've read on the Net and Stack Overflow - C# uses delegates for the purpose of callbacks. So I create a my Callback function : public delegate uint DallmeierCallback(DallPparameters pParameters, IntPtr pResult, IntPtr pInput); I create the connection function [DllImport("davidapidis.dll")] public extern static int dlm_connect(ulong ulWindowHandle, string strIP, string strUser1, string strPwd1, string strUser2, string strPwd2, DallmeierCallback inDallmeierFunc And (I think) the DallPParameters as a struct : [StructLayout(LayoutKind.Sequential)] public struct DallPParameters { public ulong ulfunctionID; public ulong ulsocketHandle; public ulong ulWindowHandle; ... } All of this is in my wrapper class. Am I heading in the right direction or is this completely wrong?

    Read the article

  • How to change disclosure style when user enters in edit mode of a UITableView?

    - by R31n4ld0
    Hello, guys. I have a UITableView that in 'normal' mode, show a UITableViewCellAccessoryDisclosureIndicator meaning if the user taps the row, another list is showed, like HIG says: "Disclosure indicator. When this element is present, users know they can tap anywhere in the row to see the next level in the hierarchy or the choices associated with the list item. Use a disclosure indicator in a row when selecting the row results in the display of another list. Don’t use a disclosure indicator to reveal detailed information about the list item; instead, use a detail disclosure button for this purpose." When the user tap the edit button in the top bar of the UITableView, I think I have to change the disclosure because if the user tap it, a view for changing the information of the current row is showed (see the bold line above), again, like HIG says: "Detail disclosure button. Users tap this element to see detailed information about the list item. (Note that you can use this element in views other than table views, to reveal additional details about something; see “Detail Disclosure Buttons” for more information.) In a table view, use a detail disclosure button in a row to display details about the list item. Note that the detail disclosure button, unlike the disclosure indicator, can perform an action that is separate from the selection of the row. For example, in Phone Favorites, tapping the row initiates a call to the contact; tapping the detail disclosure button in the row reveals more information about the contact." Have I miss understood the HIG, or I really do have to change the disclosure style in edit mode of UITableView? If yes, how I can intercept the edit mode when the user taps the Edit button? Thanks in advance.

    Read the article

  • Black hat knowledge for white hat programmers

    - by Dinah
    There's always skepticism from non-programmers when honest developers learn the techniques of black hat hackers. Obviously though, we need to learn many of their tricks so we can keep our own security up to par. To what extent do you think an honest programmer needs to know the methods of malicious programmers?

    Read the article

  • Can't create file in Ada 95

    - by duder
    Hello, I'm trying to follow a standard reference for opening files but running into a constraint_error at the line when I call Ada.Text_IO.Create(). It says "range check failed". Any help appreciated, here's the code: WITH Ada.Text_IO; WITH Ada.Integer_Text_IO; USE Ada.Text_IO; USE Ada.Integer_Text_IO; PROCEDURE FileManip IS --Variables Start_Int : Integer; Stop_Int : Integer; Max_Length : Integer; --Output File MaxName : CONSTANT Positive := 80; SUBTYPE NameRange IS Positive RANGE 1..MaxName; OutFileName : String(NameRange) := (OTHERS => '#'); OutNameLength : NameRange; OutData : File_Type; --Array TYPE Chain_Array IS ARRAY(1..500) OF Integer; Sum : Integer := 1; BEGIN --Inputs Ada.Text_IO.Put(Item => "Enter a starting Integer: "); Ada.Integer_Text_IO.Get(Item => Start_Int); Ada.Text_IO.New_Line; Ada.Text_IO.Put(Item => "Enter a stopping Integer: "); Ada.Integer_Text_IO.Get(Item => Stop_Int); Ada.Text_IO.New_Line; Ada.Text_IO.Put(Item => "Enter a Maximum Length to search: "); Ada.Integer_Text_IO.Get(Item => Max_Length); Ada.Text_IO.New_Line; Ada.Text_IO.Put(Item => "Enter a output file name > "); Ada.Text_IO.Get_Line( Item => OutFileName, Last => OutNameLength); Ada.Text_IO.Create( File => OutData, Mode => Ada.Text_IO.Out_File, Name => OutFileName(1..OutNameLength)); Ada.Text_IO.New_Line;

    Read the article

  • tabbar hides when calling a UIViewController

    - by user292049
    Hi.. I am barely new to IPhone Programming so can anyone please shed some light for my problem. Current SetUp: I have Tabbar Controller(4 TabbarItem's) When u click the secondtabbaritem - It calls second.xib which is of type UIViewController. My Requirement: I have a button inside the view. So when i click the button, it should load another UIViewController with the tabbar visible. Problem: I am able to do so, but the tabbar disappears, and i need to quit the application to start go back to the see the tabbar again. Pls help me Cheers Anand

    Read the article

  • iPhone - move above buttons

    - by Mike
    I have a video at 320x240 on the middle of the screen area. Around this video, several buttons that will call different actions. When the MPMoviePlayerController is fired and the movie starts playing the buttons are behind the video and I cannot click them. I see them but they are not clickable. I think the video window is covering the whole area. How can I solve that?

    Read the article

  • iPhone - move above buttons

    - by Mike
    I have a video at 320x240 on the middle of the screen area. Around this video, several buttons that will call different actions. When the MPMoviePlayerController is fired and the movie starts playing the buttons are behind the video and I cannot click them. I see them but they are not clickable. I think the video window is covering the whole area. How can I solve that?

    Read the article

  • Ensuring WPF window is on top all the time even when user clicks another maximised application

    - by mttumbledown
    Hi I am trying to ensure my WPF window stays on top as long as it is open. It is acting as a pop-up set to TopMost=true, and a call to the win32 SetWindowPos to TOPMOST. When first opened it appears on top of another running application on the desktop- maximized or not. If the user activates or uses a window in the application mine loses focus and disappears. I thought of manipulating the other application window, setting it to a lower z index. How do I find the application window? How do I iterate through all windows? (This question still stands, even if it is not the correct approach). I would be using SetWindowPos, GetForegroundWindow, GetForegroundWindow, GetDesktopWindow et cetera. I suspect that as soon as the user clicks in their application that it will still focus it regardless and I am barking up the wrong tree. At the moment, my application is a black box and I can’t handle it the other way, for example, periodically messaging my app to focus. I also thought of having a long running background thread which periodically focuses my WPF popup, but need to watch resources and processor. Kind regards,

    Read the article

  • Is is better to store serialized data or raw html in mysql?

    - by Yegor
    I de-normalized my database, since the application was crawling otherwise, and Im storing a list of categories for each item in the DB as a raw html version, and simply echoing it out in my design. Each category is actually a link, which is include a tag. Naturally, this is abit of a pain, especially if I want to change the look of how the category links are displayed, since I gotta update all the old cached entries. What if I were to store this data as a serialized array instead, and simply unserialize it, and then apply formatting to it in php. Would there be a significant performance decrease over simply echoing out the raw html?

    Read the article

  • Single Table Per Class Hierarchy with an abstract superclass using Hibernate Annotations

    - by Andy Hull
    I have a simple class hierarchy, similar to the following: @Entity @Table(name="animal") @Inheritance(strategy=InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name="animal_type", discriminatorType=DiscriminatorType.STRING) public abstract class Animal { } @Entity @DiscriminatorValue("cat") public class Cat extends Animal { } @Entity @DiscriminatorValue("dog") public class Dog extends Animal { } When I query "from Animal" I get this exception: "org.hibernate.InstantiationException: Cannot instantiate abstract class or interface: Animal" If I make Animal concrete, and add a dummy discriminator... such as @DiscriminatorValue("animal")... my query returns my cats and dogs as instances of Animals. I remember this being trivial with HBM based mappings but I think I'm missing something when using annotations. Can anyone help? Thanks!

    Read the article

  • iphone - compiler conditionals

    - by Mike
    Two questions: this code #ifdef __IPHONE_3_0 // iPhone 3.0 specific stuff #else // iPhone 2.2 specific stuff #endif compiles specific codes for specific versions of the iPhone. How could this be transformed to compile for a range of devices? For example: if iphone version < 3.1 or if version = 3.2, and so one... 2) where do I get a list of all conditionals allowed by Xcode? thanks for any help.

    Read the article

  • Color Themes for Eclipse?

    - by John Stauffer
    I am a recovering Emacs user, who is trying to ease into Eclipse usage. (Since I'm encouraging the rest of the team to use it, I guess I should at least try to get along). My current excuse is that it hurts my eyes. I'm currently using the excellent zenburn theme in emacs, and would love to find it for eclipse. However, I find that changing my color theme every few months makes for a great way to procrastinate, so ideally I'd like to find a repository for eclipse color themes. There don't appear to be any eclipse themes indexed by Google, so all the great themes must be sitting on your hard disk somewhere. Please share them. Thanks

    Read the article

  • WCF Caching Solution - Need Advice

    - by Brandon
    The company I work for is looking to implement a caching solution. We have several WCF Web Services hosted and we need to cache certain values that can be persisted and fetched regardless of a client's session to a service. I am looking at the following technologies: Caching Application Block 4.1 WCF TCP Service using HttpRuntime Caching Memcached Win32 and Client Microsoft AppFabric Caching Beta 2 Our test server is a Windows Server 2003 with IIS6, but our production server is Windows Server 2008, so any of the above options would work (except for AppFabric Caching on our test server). Does anyone have any experience with any of these? This caching solution will not be used to store a lot of data, but it will need to be fetched from frequently and fast. Thanks in advance.

    Read the article

  • flexible length struct array inside another struct using C

    - by renz
    Hi I am trying to use C to implement a simple struct: 2 boxes, each contains different number of particles; the exact number of particles are passed in main(). I wrote the following code: typedef struct Particle{ float x; float y; float vx; float vy; }Particle; typedef struct Box{ Particle p[]; }Box; void make_box(Box *box, int number_of_particles); int main(){ Box b1, b2; make_box(&b1, 5); //create a box containing 5 particles make_box(&b2, 10); //create a box containing 10 particles } I've tried to implement make_box with the following code void make_box(struct Box *box, int no_of_particles){ Particle po[no_of_particles]; po[0].x = 1; po[1].x = 2; //so on and so forth... box->p = po; } It's always giving me "invalid use of flexible array member". Greatly appreciated if someone can shed some light on this.

    Read the article

  • MYSQL - Query to check against other table (hard to explain...)

    - by Sam
    I have a query that gets a list of emails who have subscribed for a newsletter trial which lasts 30 days.. $thirty = time() - 3024000; SELECT c.email FROM tbl_clients AS c JOIN tbl_clientoptions AS o ON o.client = c.id WHERE o.option = 'newsletter' AND c.datecreated $thirty What I want to do is do a check in that same query so it also returns clients OVER 30 days old if they have the tbl_clientoptions.option = 'trialoverride' (ie; a row in the client options table with the value "trialoverride") basic columns are: TBL_CLIENTS id,name,email,datecreated TBL_CLIENTOPTIONS id,client,option

    Read the article

  • how can I prevent my SESSION to be overwritten on pageLoad of my MasterPage

    - by Darkyo
    I'm new to asp world, and I have to keep my new job :) Switching form php to asp.net 3.5 (never used before). What would be the best practice for storing a SESSION variable in my project ? How can I prevent my SESSION to be overwritten if my initialisation code is in the onPageLoad method of my MasterPage ? My variables keeps beeing overwritten, please someone help me and tell me if there is any other solution than dealing with this pageLoad problem. Thank you all

    Read the article

  • Help writing database queries for derby?

    - by outsyncof
    I have a database containing multiple tables (Person, Parents, etc) Person table has certain attributes particularly ssn, countryofbirth and currentcountry. Parents table has ssn, and fathersbirthcountry I'm trying to output the SSNs of all people who have the same countryofbirth as their fathersbirthcountry and also have same currentcountry as fathersbirthcountry. SELECT Person.ssn FROM Person, Parents WHERE fathersbirthcountry = countryofbirth AND currentcountry = fathersbirthcountry; the above doesn't seem to be working, could anyone please help me out?

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >