wrapper

Writing a C++ wrapper for a C library

I have a legacy C library, written in an OO type form. Typical functions are like: LIB *lib_new(); void lib_free(LIB *lib); int lib_add_option(LIB *lib, int flags); void lib_change_name(LIB *lib, char *name); I'd like to use this library in my C++ program, so I'm thinking a C++ wrapper is required. The above would all seem to map to s...

How can I wrap an executable on UNIX (SunOS) so that it is never run more than once at the same time?

I have an executable (no source) that I need to wrap, to make sure that it is not called more than once at a time. I immediately think of some sort of queue wrapper, but how do I actually make it so that my wrapper is called instead of the executable itself? Is there a better way to do this? The solution needs to be invisible because the...

SQLite Step Failed: attempt to write a readonly database , using wrapper

I keep getting an error "SQLite Step Failed: attempt to write a readonly database" when using this code to copy a database: -(void)createEditableCopyOfDatabaseIfNeeded { // Testing for existence BOOL success; NSFileManager *fileManager = [NSFileManager defaultManager]; NSError *error; NSArray *paths = NSSearchPathFo...

Closing database when using a wrapper in iPhone SDK

Hey guys I am using http://th30z.netsons.org/2008/11/objective-c-sqlite-wrapper/ wrapper for my iPhone Application. How do I close my database when applicationWillTerminate with the help of this wrapper? Thanks in advance. ...

Wrapper c# using unmanaged dll

I am making a wrapper to read TDM and TDMS files but i have a problem [DllImport(lib, CharSet = CharSet.Auto)] static extern int DDC_OpenFileEx( [MarshalAs(UnmanagedType.LPStr)] string filePath, [MarshalAs(UnmanagedType.LPStr)] string fileType, int read_only, ...

C# serial port driver wrapper class code and concept quality

Hi folks, Would like to know from all you guys what do you think about my Serial Wrapper class. Had been a while I've been working with serial ports but never shared the code what somekind make me closed to my very own vision. Would like to know if it's a good/bad approach, if the interface is enough and what more you see on it. I know...

Applying mvc to domain-driven design

From a practical point of view, how can you adapt the domain model to the MVC pattern? For example, could I use some wrapper classes? ...

a problem in socks.h

i use this (http://www.codeproject.com/KB/IP/Socks.aspx) lib in my socket programing in c++ and copy the socks.h in include folder and write this code: #include <windows.h> #include <winsock.h> #include <stdio.h> #include <conio.h> #include <process.h> #include "socks.h" #define PORT 1001 // the port client wil...

C++ strcpy(Struct.Property, "VALUE") Use in C#?

Hi all, i created a Wrapper for a C++ dll. While reading the documentation i reached to a point using this function strcpy(StructName.strPropGetter, "A STRING"); I'm not kinda C++ guy, i can't figure how to transfer this code in C#. My wrapper gave me this property without a setter. Any light would be nice. Thank you ...

Writing a synchronized thread-safety wrapper for NavigableMap

java.util.Collections currently provide the following utility methods for creating synchronized wrapper for various collection interfaces: synchronizedCollection(Collection<T> c) synchronizedList(List<T> list) synchronizedMap(Map<K,V> m) synchronizedSet(Set<T> s) synchronizedSortedMap(SortedMap<K,V> m) synchronizedSortedSet(SortedSet<T...

What is the inet_addr function equivalent in C#.

Hello all, i need to know how to use an IP address like inet_addr("192.168.0.2"); in C++ where this returns DWORD. My wrapper in C# treats this field as an Int? Can anyone help on this misunderstanding? ...

Combining Cocoa and MySQL

Hey guys, i was searching SO for help on this, but i can't seem to find a concrete solution. Is, or isn't it possible to connect to a mysql database with Cocoa? Because i'm working on a program that i'd like to extend to a database, but i sure as hell don't know how! I mean, that cocoa-mysql package is heavily outdated, and i dont even ...

Simplest way to create a wrapper class around some strings for a WPF DataGrid?

I'm building a simple hex editor in C#, and I've decided to use each cell in a DataGrid to display a byte*. I know that DataGrid will take a list and display each object in the list as a row, and each of that object's properties as columns. I want to display rows of 16 bytes each, which will require a wrapper with 16 string properties. W...

Cross-platform HTML application options

I'd like to develop a stand-alone desktop application targeting Windows (XP through 7) and Mac (Tiger through Snow Leopard), and if possible iPhone and Android. In order to make it all work with as much common code as possible (and because it's the only thing I'm good at), I'd like to handle the main logic with HTML and JS. Using Adobe A...

Embedding a Jar into a C# Form

Ok this situation is a bit difficult. But I am trying to embed a Java Jar into a C# form. Not as a new window or new process. The Jar will be a game that uses the LWJGL library. The C# Form will be a "wrapper" for it with tools and more. Anyone have any ideas? Is this even possible? ...

wrapper not containing content div

Hi, I'm trying to get my wrapper to hold my content but it won't. I've taken out the floats and added "overflow: visible" no no avail. I'm thinking it's because of my z-indexing and negative margins, but have tried taking these out and still no change. Any ideas? http://www.jenniferhope.com/bio (the float is still in this example.) T...

designing an API wrapper for Twitter, Facebook, Youtube etc...

I am looking at some pointers on how to design a wrapper for these social networking sites. Ideally what I want to do is create a black box where I am able to create an interface for other libraries to call certain functions to interact with these social networking sites. I am planning on using oAuth for most of these sites, I already ...

Tripple-wrapping fails: \colorbox → \NewEnviron → \newenvironment fails

Hello! I am trying to wrap an environment created with \NewEnviron (package 'environ') into an old good \newenvironment: \NewEnviron{test}{\colorbox[gray]{0.7}{\BODY}} \newenvironment{wrapper}{\begin{test}}{\end{test}} \begin{wrapper} debug me \end{wrapper} However, this gives me a strange error: LaTeX Error: \begin{test} on in...

Why does autoboxing in Java allow me to have 3 possible values for a boolean?

Reference: http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html "If your program tries to autounbox null, it will throw a NullPointerException." javac will give you a compile-time error if you try to assign null to a boolean. makes sense. assigning null to a Boolean is a-ok though. also makes sense, i guess. but let'...

C# wrapper for objects

I'm looking for a way to create a generic wrapper for any object. The wrapper object will behave just like the class it wraps, but will be able to have more properties, variable, methods etc., for e.g. object counting, caching etc. Say the wrapper class be called Wrapper, and the class to be wrapped be called Square and has the construc...