VC++ IJW wrapper for c lib

D

dotNEWBIE

Hi all, I'm attempting to write my first IJW wrapper for a old syle C
library that I have inherited. mylib.h contains the definitions of the
library calls used within myFunction(). Unfortunately, trying to run this
causes my compiler to throw back a huge number of syntax errors from the
header file. Is this normal? Should I attempt to re-write this header in ms
c++? Or is there something stupid that I am missing? The C library already
exists as a .dll with .lib and .exp so I'm not sure if I should be using
these!

Here is a code snippet, if its useful.


// This is the main DLL file
#include "stdafx.h"
#using <mscorlib.dll>

#include "mylib.h"

namespace myWrapper
{
public __gc class myClass
{
public long myFunction()
{
//Implementation
}
}
}
 
C

Carl Daniel [VC++ MVP]

dotNEWBIE said:
Hi all, I'm attempting to write my first IJW wrapper for a old syle C
library that I have inherited. mylib.h contains the definitions of the
library calls used within myFunction(). Unfortunately, trying to run
this causes my compiler to throw back a huge number of syntax errors
from the header file. Is this normal? Should I attempt to re-write
this header in ms c++? Or is there something stupid that I am
missing? The C library already exists as a .dll with .lib and .exp so
I'm not sure if I should be using these!

Here is a code snippet, if its useful.


// This is the main DLL file
#include "stdafx.h"
#using <mscorlib.dll>

#pragma unmanaged

extern "C"
{
#include "mylib.h"
}

#pragma managed
namespace myWrapper
{
public __gc class myClass
{
public long myFunction()
{
//Implementation
}
}
}

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top