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

Calling a "Mixed mode" dll from c#

I have just implemented a "mixed mode" dll in VC++. I
have implemented this dll in accordence with several
articles found on the MSDN website including KB 814472.
The crux of the problem is that when the dll is built
with the \noentry linker option, I can not load the dll
in a c# client. There is plenty of help available for
loading this dll in a c++ client.

Does anyone know how to load this dll in C# or VB?? Am I
forced to use reflection on this assembly??

Thanks in advance,

Ron Jacobs
Nov 16 '05 #1
5 4818
ron jacobs wrote:
Does anyone know how to load this dll in C# or VB?? Am I
forced to use reflection on this assembly??


The simplest way is to put a reference to the DLL into your project. Then
you can access all __gc classes/types.

--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/useritems/leakfinder.asp
Nov 16 '05 #2
I guess I should have mentioned that... I have added a
reference to the dll in my c# project, the error I get is
that the namespace (defined in the dll) is unrecognized.
I have no problem if I remove the "\noentry" link option
from the dll.
-----Original Message-----
ron jacobs wrote:
Does anyone know how to load this dll in C# or VB?? Am I forced to use reflection on this assembly??
The simplest way is to put a reference to the DLL into

your project. Thenyou can access all __gc classes/types.

--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/useritems/leakfinder.asp
.

Nov 16 '05 #3
>
Does anyone know how to load this dll in C# or VB?? Am I
forced to use reflection on this assembly??


What is the exact error message you are receiving and when?

What type of C# project did you create?
Nov 16 '05 #4
It complains about my using namespace call.
snip...
using System;
using System.Data;
using Xcellenet.Data.Client;

snip...

error:
Z:\Platform\Server\DLLs\Database\XSDataAccess\Test er\Class
1.cs(3): The type or namespace name 'Xcellenet' could not
be found (are you missing a using directive or an
assembly reference?)

I have the correct assembly already as a reference, when
I browse this assembly with the object browser, I can see
my namespace and all of my types.

This problem occurs on any C# project, but this example
is a console application.

-----Original Message-----

Does anyone know how to load this dll in C# or VB?? Am I forced to use reflection on this assembly??

What is the exact error message you are receiving and

when?
What type of C# project did you create?
.

Nov 16 '05 #5
yes.
-----Original Message-----
ron jacobs wrote:
I have the correct assembly already as a reference, when I browse this assembly with the object browser, I can see my namespace and all of my types.


Are your MC++ classes really defined as:

public __gc class MyClass

!?

--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/useritems/leakfinder.asp
.

Nov 16 '05 #6

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

Similar topics

0
by: chaitan | last post by:
Hi, I have a search engine site written in Perl. How could I display a temporarily page while the system retrieving data, then a page refresh, display the search result in a new page? I try to do...
0
by: Jean-Marc Blaise | last post by:
Dear all, The LOAD indexing mode is by default, I presume, "autoselect", and the LOAD should choose between REBUILD or INCREMENTAL. In version 7.2 FP11, so in "offline" mode, with a LOAD...
3
by: Carpe Diem | last post by:
Hello I have an aspx page that loses Session("user") value after a few minutes even after I set <sessionState mode="InProc" cookieless="false" timeout="300"> in web.config and wrote function...
21
by: nicholas | last post by:
Although in my web.config I have <customErrors mode="off" /> I still get no detailed errors. How comes ? THX This is what I get: Server Error in '/mywebfolder'Application.
5
by: Savas Ates | last post by:
I have a web application It works well in my local folder.. When i upload it to my web server i got To enable the details of this specific error message to be viewable on remote machines,...
10
by: albert.neu | last post by:
To what extent does Microsoft Visual C++ also called: VC++ also called: Microsoft (R) 32-bit C/C++ Optimizing Compiler support C99? VC++ compiles either in C mode (which is def. *not*...
3
by: Moe Sisko | last post by:
Using dotnet 2.0 sp1, I've got ASP.NET session state working ok in SQLServer mode, but the sessions never seem to expire. e.g if I add a timeout attribute like so : <sessionState...
15
by: =?ISO-8859-15?Q?L=E9na=EFc?= Huard | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello all, For some reasons, somewhere in a program, I'd like, if possible, to quickly parse a whole file before rewinding it and letting the...
4
by: wilderness | last post by:
I have a Windows 2000 Server (SP4) with .NET Framework 1.1 (with hotfixes) installed, along with .NET Framework 2 I have a Delphi .DLL that interfaces with several .aspx files as part of a member...
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: 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
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
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,...
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...

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.