PC Review


Reply
Thread Tools Rate Thread

c# interop dll method seems to return wrong values

 
 
New Member
Join Date: Oct 2011
Posts: 1
 
      25th Oct 2011
Hi

I am using vs2005.

I think my c++/mfc app was working fine with the c# dll up until I decided to change the c++/mfc app to be able to compile 64bit. It meant changing a lot of int and UINT to INT_PTR.

Anyway, now, when running the 32 bit edition of my program, I am finding for one of the methods in the DLL, that even though it returns "true" for the bool value, the value returned by the IDL interface method (as a VARIANT_BOOL parameter) is invalid.

eg:

Code:
VARIANT_BOOL bRes;
pInterface->SomeFunction(&bRes)
if(bRes == VARIANT_FALSE)
{
  AfxMessageBox("There was an error");
}
I tried to look at the value of bRes by formatting a string with %d and the value was not -1 or 0. It was some four figure negative value.

So even though the C# method was OK and returned a proper value the return value on many occasions is ending up as incorrect in C++/MFC calling code. So I get errors displayed.

Why might this be happening? I don't know enough about this.

Thank you.

Andrew
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interop.CDO uses Interop.ADODB which has a higher version... muriwai Microsoft C# .NET 7 27th Oct 2011 08:00 PM
Return string from c++ dll - interop services Jason Microsoft C# .NET 5 7th Sep 2006 09:15 PM
Interop.xxx.dll vs AxInterop.xxx.dll Chris Dunaway Microsoft VB .NET 2 10th Jun 2004 09:16 PM
Interop without interop Tamir Khason Microsoft C# .NET 11 1st Dec 2003 07:01 PM
Is there a published COM Interop Wrapper for Interop.MSDASC.dll? Burton G. Wilkins Microsoft ADO .NET 0 10th Nov 2003 02:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:56 AM.