473,386 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

C/C++ Wrapper help

I'm working on a project that is using a 3rd party DLL, and I'm having trouble writing the wrapper for it in c#. I've searced for hours for the answer, and can just can't seem to find a solution for this one. I think a lot of it has to do with understanding and wrapping the pointers properly

Here is the part of the C header file I'm working with

typedef struct _HCLIEN

PVOID Client
auth *cl_auth
} HCLIENT, *PHCLIENT

#define CLIENT HCLIEN

extern "C" CLIENT
__stdcall
Open_Client(char *Server, char System)
Here is all I've been able to come up with as far as creating the wrapper

[StructLayout(LayoutKind.Sequential,Pack=4,CharSet= CharSet.Ansi)
public struct HCLIENT

public IntPtr Client
public auth cl_auth
}

[DllImport("mydll.dll")
static extern int Open_Client(string Server, string System)

public void blah(
{
int returnval = (int) Open_Client("param1","param2")

I'm hitting the DLL properly, but it always returns it's default error code, and never any other value. I know the dll works properly as I can run it fine with a test application written by the developers of the DLL

Can anyone help

Thanks in advance
Aaron
Nov 22 '05 #1
0 1047

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mark McEahern | last post by:
I just wrote a very simple wrapper for the PayFlow Pro SDK (see below). A friend of mine did this before, but I didn't have access to his source, so I took it as a learning opportunity for me to...
2
by: James S | last post by:
Hi, Basically I've been fighting with this code for a few days now and can't seem to work around this problem. Included is the output, the program I use to get this error and the source code for...
12
by: Egil M?ller | last post by:
Is there any way to create transparent wrapper objects in Python? I thought implementing __getattribute__ on either the wrapper class or its metaclass would do the trick, but it does not work for...
4
by: Stephen | last post by:
Hi I am currently developing a web application that has a third party component on it. The third party component is a graph component from Xceed that uses a number of dlls. The problems occur...
4
by: Gary Bond | last post by:
Hi All, Can anybody point me to some 'how-to' documentation, tutorials, etc as to how to write a shrink/protect wrapper for .Net exes/dlls, (like the Shrinkwrap product for instance). I have...
9
by: Julien Biezemans | last post by:
Hi! Here is the problem: I'd like to restrict local filesystem stream operations to one directory just like a root jail. fopen('/file.bin') would actually open /some/path/file.bin. One goal...
6
by: Milsnips | last post by:
Hi there, this is what i'm trying to achieve, i have separate identical classes for SqlClient, OracleClient, Odbc and OleDb, what i want is to create a Wrapper class that calls any of these 4...
8
by: Seth7TS | last post by:
Hi everyone, i need to make a protection for a fortran software(a line command in linux). My desire is to write a C wrapper that control the execution of the program. Can someone help me? i dont...
2
by: andrew cooke | last post by:
Hi, Within Python (2.5): Help on method-wrapper object: __str__ = class method-wrapper(object) | Methods defined here: | | __call__(...) | x.__call__(...) <==x(...)
3
by: srbakshi | last post by:
Hey all, I'm stuck with the following: The mysql_real_escape_string(conn, to, from, strlen(from)) function does not return the escaped string. So how can I go about writing a wrapper for it so...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.