473,396 Members | 1,772 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,396 software developers and data experts.

VC++ IJW wrapper for c lib

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
}
}
}
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.776 / Virus Database: 523 - Release Date: 13/10/2004
Nov 17 '05 #1
1 898
dotNEWBIE wrote:
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
Nov 17 '05 #2

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

Similar topics

2
by: Weston Fryatt | last post by:
(Sorry for spamming multiple groups, But I need a solution to this problem) I think this should be a simple question on Memory Allocation in a managed DLL and passing a memory pointer over to an...
3
by: robert | last post by:
Hi All, I have a problem. I have written a COM DLL in VB6 to do some stuff. I need to call this DLL from a VC++ program for which I have the code. I have managed to get as far as creating the...
3
by: Francis Urquhart | last post by:
I am trying to find the simplest possible way of writing a GUI to run on top of a standard C++ library written in VC++. I would like to avoid MFCs, COM, and if possible .Net wrappers. The goal...
5
by: Alfonso Morra | last post by:
Hi, I am a C/C++ developer of quite a few yesrs, although I am relatively new to Windows (Unix background). I am about to begin work on a project that would require me to develop several GUI...
8
by: Edward Diener | last post by:
By reuse, I mean a function in an assembly which is called in another assembly. By a mixed-mode function I mean a function whose signature has one or more CLR types and one or more non-CLR...
1
by: Mads Westen | last post by:
Hi, I want to create a "dynamic" unmanaged VC++ wrapper that can call any C# DLL. I'm thinking that I call the the wrapper from another program like this: dllcall(name_of_wrapper_function ,...
5
by: Andy | last post by:
I'm having trouble accessing an unmanaged long from a managed class in VC++.NET When I do, the contents of the variable seem to be mangled. If I access the same variable byte-by-byte, I get the...
7
by: Amu | last post by:
Hi i am stuck up in a part of project where i have to inherit the VC++ template classes into C#.net. Please provide me the solution for this .
2
by: Amu | last post by:
i have a dll ( template class) ready which is written in VC++6. But presently i need to inherit its classes into my new C#.net project.so if there is some better solution with u then please give me...
2
by: Peter Duniho | last post by:
On Fri, 18 Jul 2008 10:41:23 -0700, jmDesktop <needin4mation@gmail.com> wrote: Well, that's an interesting example, if for no other reason than that the DirectShow video capture stuff is a...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.