Click here to Skip to main content
16,004,901 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
Questionnesting, looping, triangle Pin
Charles Reese3-May-06 8:04
Charles Reese3-May-06 8:04 
AnswerRe: nesting, looping, triangle Pin
Saksida Bojan3-May-06 19:54
Saksida Bojan3-May-06 19:54 
Questionnesting, looping, triangle Pin
Charles Reese3-May-06 8:03
Charles Reese3-May-06 8:03 
Question[urgent newbie] input streams problem with .NET Pin
kkyeung3-May-06 6:46
kkyeung3-May-06 6:46 
AnswerRe: [urgent newbie] input streams problem with .NET Pin
Saksida Bojan3-May-06 20:26
Saksida Bojan3-May-06 20:26 
GeneralRe: [urgent newbie] input streams problem with .NET Pin
kkyeung4-May-06 8:38
kkyeung4-May-06 8:38 
GeneralRe: [urgent newbie] input streams problem with .NET Pin
Saksida Bojan4-May-06 9:31
Saksida Bojan4-May-06 9:31 
QuestionExpose VC++ .Net function to VB .Net Pin
ppanke3-May-06 4:50
ppanke3-May-06 4:50 
I maintain a Visual C++ Version 6 app. It takes data structures from an Excel app, processes results, and returns structures to Excel. I must now write a C++ .Net wrapper, to take datasets from a VB.Net calling app, create structures from the datasets, send the structures to the Visual C++ Version 6 app, get the return structures, then create and return a dataset to the VB.Net calling app.

I have not been able to expose a public function in the C++ .Net wrapper.

The C++ .Net header code is:

using namespace System;
using namespace System::Data;
using namespace System::Runtime::InteropServices;


namespace TK_DLL_Header {

public class TK_DLL
{
public:
// constructor
TK_DLL();
// destructor
~TK_DLL();

unsigned short ProcessResults (DataSet dsStudyParm, DataRow drFinParms);
};
}

The C++ .Net .cpp code is:

#include "StdAfx.h"
#include "TK_CPlusPlus_Class_Library.h"

using namespace System;
using namespace System::Runtime::InteropServices;

const unsigned short TK_TRUE = 1;
const unsigned short TK_FALSE = 0;

//#define BDS_TK_API __declspec(dllexport)

using namespace TK_DLL_Header;

//namespace TK_DLL_Header {

unsigned short TK_DLL::ProcessResults(System::Data::DataSet dsStudyParm, System::Data::DataRow drFinParms)

{
BDS_ClearAggreg();
return TK_TRUE;
}


[DllImport("BDS_TK.dll", EntryPoint="BDS_ClearAggreg")]
short BDS_ClearAggreg();


I have attempted to access the ProcessResults function in a VB.Net app, in two ways. First, using intellisense:

‘ this statement works
Dim tk As New TK_DLL_Header.TK_DLL
‘ this statement does not work; ProcessResults is not in the list of items after tk.
result = tk.ProcessResults(dsStudyParm, drFinParms)

tk.ProcessResults has a blue line under it; a mouse-over message says “ProcessResults is not a member of TK_DLL_Header.TK_DLL”

In the same VB.Net app, I have added the following declaration at the top of the file:

Private Declare Function ProcessResults Lib "TK_CPlusPlus_Class_Library.dll" (ByRef dsStudyParm As DataSet, ByRef drFinParms As DataRow) As Integer

Using the following call:

result = ProcessResults(dsStudyParm, drFinParms)

Raises the error message:

“Unable to find an entry point named ‘ProcessResults’ in DLL ‘TK_CPlusPlus_Class_Library.dll’


I am missing something very fundamental here. If anyone can help, re how to expose a public function from VC++ .Net, it would be greatly appreciated.

Thanks.







ppanke
AnswerRe: Expose VC++ .Net function to VB .Net Pin
Milton Karimbekallil3-May-06 8:46
Milton Karimbekallil3-May-06 8:46 
GeneralRe: Expose VC++ .Net function to VB .Net Pin
ppanke10-May-06 4:15
ppanke10-May-06 4:15 
GeneralRe: Expose VC++ .Net function to VB .Net Pin
Milton Karimbekallil10-May-06 16:23
Milton Karimbekallil10-May-06 16:23 
QuestionHow to use timeSetEvent in C++/CLI Pin
attias gabi30-Apr-06 20:55
attias gabi30-Apr-06 20:55 
AnswerRe: How to use timeSetEvent in C++/CLI Pin
guestcat2-May-06 2:03
guestcat2-May-06 2:03 
GeneralRe: How to use timeSetEvent in C++/CLI Pin
attias gabi4-May-06 1:26
attias gabi4-May-06 1:26 
GeneralRe: How to use timeSetEvent in C++/CLI Pin
oshah13-May-06 11:31
oshah13-May-06 11:31 
QuestionGetCurrentDirectory() Pin
rahultaing30-Apr-06 14:11
rahultaing30-Apr-06 14:11 
AnswerRe: GetCurrentDirectory() Pin
Milton Karimbekallil30-Apr-06 18:52
Milton Karimbekallil30-Apr-06 18:52 
GeneralRe: GetCurrentDirectory() Pin
Milton Karimbekallil5-May-06 13:28
Milton Karimbekallil5-May-06 13:28 
QuestionGame Programming Pin
Akidomero29-Apr-06 20:07
Akidomero29-Apr-06 20:07 
QuestionHTTP: Pin
Anthony Moss28-Apr-06 5:45
Anthony Moss28-Apr-06 5:45 
AnswerRe: HTTP: Pin
led mike4-May-06 12:26
led mike4-May-06 12:26 
QuestionHow to call unmanaged C++ DLL method with a CString reference Pin
Bo Skjoett27-Apr-06 23:02
Bo Skjoett27-Apr-06 23:02 
AnswerRe: How to call unmanaged C++ DLL method with a CString reference Pin
Milton Karimbekallil28-Apr-06 2:01
Milton Karimbekallil28-Apr-06 2:01 
Questionadding dll Pin
rahultaing25-Apr-06 13:41
rahultaing25-Apr-06 13:41 
AnswerRe: adding dll Pin
2bee 25-Apr-06 23:50
2bee 25-Apr-06 23:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.