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

Internal Compiler Error

some more info...
-----Original Message-----
I built a VC++.Net project as a dll and
included it as a reference in a c# project.
When I call a c++ function from the csharp
project I get internal compiler error.

The function in the c++ dll got the signature
void __gc *CInitialContext::Lookup(char *)
throw (CJMSException*)

The function was called in csharp as
CInitialContext m_ic = new CInitialContext();
String m_tcfName = "primaryTCF";
m_ic.Lookup((sbyte *)(Marshal.StringToHGlobalAnsi
(m_tcfName)).ToPointer());

.

Nov 15 '05 #1
6 1961
Which version of Visual Studio are you using? Have you installed any of the
service packs?

--
--Grant
This posting is provided "AS IS" with no warranties, and confers no rights.
"Rajesh.S" <ra*******@hotmail.com> wrote in message
news:20****************************@phx.gbl...
some more info...
-----Original Message-----
I built a VC++.Net project as a dll and
included it as a reference in a c# project.
When I call a c++ function from the csharp
project I get internal compiler error.

The function in the c++ dll got the signature
void __gc *CInitialContext::Lookup(char *)
throw (CJMSException*)

The function was called in csharp as


CInitialContext m_ic = new CInitialContext();
String m_tcfName = "primaryTCF";
m_ic.Lookup((sbyte *)(Marshal.StringToHGlobalAnsi
(m_tcfName)).ToPointer());

.

Nov 15 '05 #2
I am using Visual Studio 2002 with
Microsoft .Net framework 1.0
I dont have any service packs installed.
Do you think that is the reason for the error?
If so can you please post what service pack(s)
I should install and if I should upgrade my VS?

Thanks
--Rajesh.S
-----Original Message-----
Which version of Visual Studio are you using? Have you installed any of theservice packs?

--
--Grant
This posting is provided "AS IS" with no warranties, and confers no rights.

"Rajesh.S" <ra*******@hotmail.com> wrote in message
news:20****************************@phx.gbl...
some more info...
>-----Original Message-----
>I built a VC++.Net project as a dll and
>included it as a reference in a c# project.
>When I call a c++ function from the csharp
>project I get internal compiler error.
>
>The function in the c++ dll got the signature
>void __gc *CInitialContext::Lookup(char *)
> throw (CJMSException*)
>
>The function was called in csharp as


CInitialContext m_ic = new CInitialContext();
String m_tcfName = "primaryTCF";
>m_ic.Lookup((sbyte *)(Marshal.StringToHGlobalAnsi
>(m_tcfName)).ToPointer());
>
>.
>

.

Nov 15 '05 #3
You should not upgrade just because of this, but there certainly are plenty
of other cool new features and reasons for upgrading.

This page lists all the available service packs that might affect the C#
compiler:
http://msdn.microsoft.com/vstudio/do...pdates/sp.aspx

After you've installed the .Net framework 1.0 service pack 2, does the error
still happen? Can you please provide the complete error text, or even
better a small sample solution that also causes the problem?

--
--Grant
This posting is provided "AS IS" with no warranties, and confers no rights.
"Rajesh.S" <ra*******@hotmail.com> wrote in message
news:27****************************@phx.gbl...
I am using Visual Studio 2002 with
Microsoft .Net framework 1.0
I dont have any service packs installed.
Do you think that is the reason for the error?
If so can you please post what service pack(s)
I should install and if I should upgrade my VS?

Thanks
--Rajesh.S
-----Original Message-----
Which version of Visual Studio are you using? Have you

installed any of the
service packs?

--
--Grant
This posting is provided "AS IS" with no warranties, and

confers no rights.


"Rajesh.S" <ra*******@hotmail.com> wrote in message
news:20****************************@phx.gbl...
some more info...

>-----Original Message-----
>I built a VC++.Net project as a dll and
>included it as a reference in a c# project.
>When I call a c++ function from the csharp
>project I get internal compiler error.
>
>The function in the c++ dll got the signature
>void __gc *CInitialContext::Lookup(char *)
> throw (CJMSException*)
>
>The function was called in csharp as

CInitialContext m_ic = new CInitialContext();
String m_tcfName = "primaryTCF";

>m_ic.Lookup((sbyte *)(Marshal.StringToHGlobalAnsi
>(m_tcfName)).ToPointer());
>
>.
>

.

Nov 15 '05 #4
I tried simulating a similar scenario in a fresh soln.
Now I get Compiler Error CS0570
'class' references a type not unsupported by the language

::The c++ code::
#using <mscorlib.dll>
public __gc class testICE
{
public:
void __gc *trythis()
{return reinterpret_cast<void __gc *>(new
testICE);}
};

::The c# code::
public class testclass
{
public static void Main (System.String[] a)
{new testICE().trythis();}
}

My requirement is to cast a managed class to void pointer
at the c++ layer and cast back to the managed class at
the c# layer.
How should I proceed?

Thanks
--Rajesh.S
-----Original Message-----
You should not upgrade just because of this, but there certainly are plentyof other cool new features and reasons for upgrading.

This page lists all the available service packs that might affect the C#compiler:
http://msdn.microsoft.com/vstudio/do...updates/sp.asp x
After you've installed the .Net framework 1.0 service pack 2, does the errorstill happen? Can you please provide the complete error text, or evenbetter a small sample solution that also causes the problem?
--
--Grant
This posting is provided "AS IS" with no warranties, and confers no rights.

"Rajesh.S" <ra*******@hotmail.com> wrote in message
news:27****************************@phx.gbl...
I am using Visual Studio 2002 with
Microsoft .Net framework 1.0
I dont have any service packs installed.
Do you think that is the reason for the error?
If so can you please post what service pack(s)
I should install and if I should upgrade my VS?

Thanks
--Rajesh.S
>-----Original Message-----
>Which version of Visual Studio are you using? Have you

installed any of the
>service packs?
>
>--
>--Grant
>This posting is provided "AS IS" with no warranties,
and confers no rights.
>
>
>"Rajesh.S" <ra*******@hotmail.com> wrote in message
>news:20****************************@phx.gbl...
>> some more info...
>>
>> >-----Original Message-----
>> >I built a VC++.Net project as a dll and
>> >included it as a reference in a c# project.
>> >When I call a c++ function from the csharp
>> >project I get internal compiler error.
>> >
>> >The function in the c++ dll got the signature
>> >void __gc *CInitialContext::Lookup(char *)
>> > throw (CJMSException*)
>> >
>> >The function was called in csharp as
>>
>> CInitialContext m_ic = new CInitialContext();
>> String m_tcfName = "primaryTCF";
>>
>> >m_ic.Lookup((sbyte *)(Marshal.StringToHGlobalAnsi
>> >(m_tcfName)).ToPointer());
>> >
>> >.
>> >
>
>
>.
>

.

Nov 15 '05 #5
Is there a reason you can't use an object instead of a void pointer? In
many cases where a void * was used in C/C++, object will work just fine in
C#. Just like in C/C++ where all pointer types can be cast to a void*, in
C# all types (except a few really weird ones) can be cast to object.

--
--Grant
This posting is provided "AS IS" with no warranties, and confers no rights.
"Rajesh.S" <ra*******@hotmail.com> wrote in message
news:51****************************@phx.gbl...
I tried simulating a similar scenario in a fresh soln.
Now I get Compiler Error CS0570
'class' references a type not unsupported by the language

::The c++ code::
#using <mscorlib.dll>
public __gc class testICE
{
public:
void __gc *trythis()
{return reinterpret_cast<void __gc *>(new
testICE);}
};

::The c# code::
public class testclass
{
public static void Main (System.String[] a)
{new testICE().trythis();}
}

My requirement is to cast a managed class to void pointer
at the c++ layer and cast back to the managed class at
the c# layer.
How should I proceed?

Thanks
--Rajesh.S
-----Original Message-----
You should not upgrade just because of this, but there

certainly are plenty
of other cool new features and reasons for upgrading.

This page lists all the available service packs that

might affect the C#
compiler:
http://msdn.microsoft.com/vstudio/do...updates/sp.asp

x

After you've installed the .Net framework 1.0 service

pack 2, does the error
still happen? Can you please provide the complete error

text, or even
better a small sample solution that also causes the

problem?

--
--Grant
This posting is provided "AS IS" with no warranties, and

confers no rights.


"Rajesh.S" <ra*******@hotmail.com> wrote in message
news:27****************************@phx.gbl...
I am using Visual Studio 2002 with
Microsoft .Net framework 1.0
I dont have any service packs installed.
Do you think that is the reason for the error?
If so can you please post what service pack(s)
I should install and if I should upgrade my VS?

Thanks
--Rajesh.S

>-----Original Message-----
>Which version of Visual Studio are you using? Have you
installed any of the
>service packs?
>
>--
>--Grant
>This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>"Rajesh.S" <ra*******@hotmail.com> wrote in message
>news:20****************************@phx.gbl...
>> some more info...
>>
>> >-----Original Message-----
>> >I built a VC++.Net project as a dll and
>> >included it as a reference in a c# project.
>> >When I call a c++ function from the csharp
>> >project I get internal compiler error.
>> >
>> >The function in the c++ dll got the signature
>> >void __gc *CInitialContext::Lookup(char *)
>> > throw (CJMSException*)
>> >
>> >The function was called in csharp as
>>
>> CInitialContext m_ic = new CInitialContext();
>> String m_tcfName = "primaryTCF";
>>
>> >m_ic.Lookup((sbyte *)(Marshal.StringToHGlobalAnsi
>> >(m_tcfName)).ToPointer());
>> >
>> >.
>> >
>
>
>.
>

.

Nov 15 '05 #6
I had been using void pointer for standards compatibility
reasons. But now object pointer seems more logical soln.
Thanks Grant
--Rajesh.S

-----Original Message-----
Is there a reason you can't use an object instead of a void pointer? Inmany cases where a void * was used in C/C++, object will work just fine inC#. Just like in C/C++ where all pointer types can be cast to a void*, inC# all types (except a few really weird ones) can be cast to object.
--
--Grant
This posting is provided "AS IS" with no warranties, and confers no rights.

"Rajesh.S" <ra*******@hotmail.com> wrote in message
news:51****************************@phx.gbl...
I tried simulating a similar scenario in a fresh soln.
Now I get Compiler Error CS0570
'class' references a type not unsupported by the language
::The c++ code::
#using <mscorlib.dll>
public __gc class testICE
{
public:
void __gc *trythis()
{return reinterpret_cast<void __gc *>(new
testICE);}
};

::The c# code::
public class testclass
{
public static void Main (System.String[] a)
{new testICE().trythis();}
}

My requirement is to cast a managed class to void pointer at the c++ layer and cast back to the managed class at
the c# layer.
How should I proceed?

Thanks
--Rajesh.S
>-----Original Message-----
>You should not upgrade just because of this, but there

certainly are plenty
>of other cool new features and reasons for upgrading.
>
>This page lists all the available service packs that

might affect the C#
>compiler:

http://msdn.microsoft.com/vstudio/do...updates/sp.asp
x
>
>After you've installed the .Net framework 1.0 service

pack 2, does the error
>still happen? Can you please provide the complete error
text, or even
>better a small sample solution that also causes the

problem?
>
>--
>--Grant
>This posting is provided "AS IS" with no warranties,
and confers no rights.
>
>
>"Rajesh.S" <ra*******@hotmail.com> wrote in message
>news:27****************************@phx.gbl...
>> I am using Visual Studio 2002 with
>> Microsoft .Net framework 1.0
>> I dont have any service packs installed.
>> Do you think that is the reason for the error?
>> If so can you please post what service pack(s)
>> I should install and if I should upgrade my VS?
>>
>> Thanks
>> --Rajesh.S
>>
>> >-----Original Message-----
>> >Which version of Visual Studio are you using? Have

you >> installed any of the
>> >service packs?
>> >
>> >--
>> >--Grant
>> >This posting is provided "AS IS" with no warranties,

and
>> confers no rights.
>> >
>> >
>> >"Rajesh.S" <ra*******@hotmail.com> wrote in message
>> >news:20****************************@phx.gbl...
>> >> some more info...
>> >>
>> >> >-----Original Message-----
>> >> >I built a VC++.Net project as a dll and
>> >> >included it as a reference in a c# project.
>> >> >When I call a c++ function from the csharp
>> >> >project I get internal compiler error.
>> >> >
>> >> >The function in the c++ dll got the signature
>> >> >void __gc *CInitialContext::Lookup(char *)
>> >> > throw (CJMSException*)
>> >> >
>> >> >The function was called in csharp as
>> >>
>> >> CInitialContext m_ic = new CInitialContext();
>> >> String m_tcfName = "primaryTCF";
>> >>
>> >> >m_ic.Lookup((sbyte *)(Marshal.StringToHGlobalAnsi
>> >> >(m_tcfName)).ToPointer());
>> >> >
>> >> >.
>> >> >
>> >
>> >
>> >.
>> >
>
>
>.
>

.

Nov 15 '05 #7

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

Similar topics

6
by: paul calvert | last post by:
I hope somewhere here has encountered and solved a similar problem in the past. 1) on a new Win2000 PC: installed Visual C++ 6.0 download & install single file Service Pack 5.0 2) try to...
30
by: Neil Zanella | last post by:
Hello, Allow me to share my frustrations with GNU g++. This is the second time something similar happens to me: I can't find anything wrong with my C++ program and yet I get segfaults, and...
19
by: Alf P. Steinbach | last post by:
// As usual the error message directs one to the report the bug. // // And as usual there is absolutely no way to do so without paying for // the privilege... // // Or using three or four hours...
7
by: Matthew Del Buono | last post by:
Don't try to solve the problem. I've found a way -- around or fixing it. I'm just curious as to whether this is Microsoft's problem in their compiler or if there's a standard saying this is to be...
6
by: David Lack | last post by:
Hi, I recently installed a 60-day trial of .NET 2003 on my development system. I made tests with previous personal projects (which compiled ok with VC6) and some open source files, and keep...
5
by: dilip ranganathan | last post by:
Hi I have taken the liberty to cross-post this. It appeared on c.l.c++.m but the ICE is regarding VS.NET 7.1 C++ compiler. post follows: ==============================================...
2
by: Jim Heavey | last post by:
Hello, I had an application which was working just fine and I decided to modify all database access within the application to utilizie a new Namespace that I had developed which would handle all...
1
by: Marcus Kwok | last post by:
I am not sure if this is related to my previous thread ("NullReferenceException with value struct") so I am starting a new thread. I saw in...
6
by: pasalic.zaharije | last post by:
I write some project, and after few lines (ok, not few, after a lot of lines) i got internal compiler error. After few hours of looking trough my code, I find error: two same names in typedef and...
1
by: kvarada | last post by:
Hello Experts, I am building my application on WinNT.4.0_i386_MSVC.7.1 platform. When I build the application on a stand alone machine, it builds fine. But when I build the same application from 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:
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
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
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
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
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.