Click here to Skip to main content
15,908,775 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Using a DLL containing MFC functions in a Managed C++ app (Help please) Pin
led mike4-Jun-09 5:17
led mike4-Jun-09 5:17 
GeneralRe: Using a DLL containing MFC functions in a Managed C++ app (Help please) Pin
James19764-Jun-09 5:21
James19764-Jun-09 5:21 
QuestionDRMInitEnvironment function fails............... :( Pin
deadlyabbas1-Jun-09 21:31
deadlyabbas1-Jun-09 21:31 
QuestionHow to return a multidimensional array with a pointer function in Visual C++? Pin
emira671-Jun-09 4:40
emira671-Jun-09 4:40 
QuestionReturning a multidimensional array from pointer function in Visual C++ Pin
emira671-Jun-09 4:00
emira671-Jun-09 4:00 
QuestionLNK2005 Redefinition Error on using CLI --already defined LNK2005 error Pin
jobin00700730-May-09 21:15
jobin00700730-May-09 21:15 
AnswerRe: LNK2005 Redefinition Error on using CLI --already defined LNK2005 error Pin
Mark Salsbery31-May-09 9:37
Mark Salsbery31-May-09 9:37 
GeneralRe: LNK2005 Redefinition Error on using CLI --already defined LNK2005 error Pin
jobin00700731-May-09 10:18
jobin00700731-May-09 10:18 
Thanks. I removed the #pragmas and #ifendef's

I was able to find another solution by looking at some examples I looked at.
I actually made all the object variable definitions in the header file to another class I already had in the header file and declared them static.Is there any disadvantage in moving them to the class versus declaring them as global?????? I know global variables are not permitted in C#..and (c++.NET i think)?

I have 2 questions. Please read on.

I have another question relating to performance. My ultimate goal is to use some functions declared in Unmanaged.h in a C# program. I need to know whether this will relate in a performance issue because one of the classes I use (class Data) has a very big size in terms of variables declared and pointers declared.

So essentially my Unmanaged.h looks like this.

*******************Unmanaged.h*********************************
namepace UNMANAGEDNAMESPACE
{
class CHardwareDelegate1 : public IDeckLinkVideoOutputCallback, public IDeckLinkInputCallback
{
//variables
//Functions

//STATIC VARIABLES //These are moved inside the class now
//STATIC FUNCTIONS //These are moved inside the class now
//STATIC OBJECTS //These are moved inside the class now
}
class Data{

int frametoCapture[40];

//About 50 pointer arrays are declared in here each of size 10 bytes.
//About 30 arrays of size 1000 bytes each are declared in here
//Other objects of varying size declared here.

static EntryPointUnmanged() { //Do algorithm.

}
}

}

Now in my Managed.cpp file I did something like this:

*******************Managed.cpp*********************************
namespace Managed
{
public ref class ManagedCLR
{
public:
ManagedCLR (void)
{
pObj = new UNMANAGEDNAMESPACE.Data();
}
~ManagedCLR(void)
{
delete pObj;
}
void EntryPoint(void)
{
//pass through to the unmanaged object
pObj->EntryPointUnmanged(); //Here the managed program accesses my unmanaged program.

}
private:
UNMANAGEDNAMESPACE.Data *pObj; //Here my Unmanaged Class is referenced through a pointer.
};

QUESTION 1)So as seen above I am creating an pointer object of type UNMANAGEDNAMESPACE.Data So i guess the larger the size of UNMANAGEDNAMESPACE.Data class, the larger the memory used will be when i define pObj = new UNMANAGEDNAMESPACE.Data(). Is this true?

Now in my C# file I do the following.
.................Interface.cs...................................
//Add the CLRProject as a reference.

using ManagerCLRproject;

ManagedCLR object1=ManagedCLR();
object1.EntryPoint(); //This should start my UNMANAGED function written in UNMANAGED.H


QUESTION 2)Is there any problems in the above approach. Is there a better approach for reducing memory of the program?

I would appreciate it if you could answer my questions. Thanks.
GeneralRe: LNK2005 Redefinition Error on using CLI --already defined LNK2005 error [modified] Pin
Mark Salsbery31-May-09 10:40
Mark Salsbery31-May-09 10:40 
GeneralRe: LNK2005 Redefinition Error on using CLI --already defined LNK2005 error Pin
jobin00700731-May-09 10:48
jobin00700731-May-09 10:48 
GeneralRe: LNK2005 Redefinition Error on using CLI --already defined LNK2005 error Pin
Mark Salsbery31-May-09 10:53
Mark Salsbery31-May-09 10:53 
GeneralRe: LNK2005 Redefinition Error on using CLI --already defined LNK2005 error Pin
jobin00700731-May-09 11:00
jobin00700731-May-09 11:00 
GeneralRe: LNK2005 Redefinition Error on using CLI --already defined LNK2005 error Pin
Mark Salsbery31-May-09 11:08
Mark Salsbery31-May-09 11:08 
GeneralRe: LNK2005 Redefinition Error on using CLI --already defined LNK2005 error Pin
jobin00700731-May-09 12:07
jobin00700731-May-09 12:07 
GeneralRe: LNK2005 Redefinition Error on using CLI --already defined LNK2005 error Pin
Mark Salsbery1-Jun-09 7:09
Mark Salsbery1-Jun-09 7:09 
AnswerAttempt to load an unverifiable executable with fixups (IAT with more than 2 sections or a TLS section.) (Exception from HRESULT: 0x80131019) Help! Pin
jobin0070071-Jun-09 12:37
jobin0070071-Jun-09 12:37 
GeneralRe: Attempt to load an unverifiable executable with fixups (IAT with more than 2 sections or a TLS section.) (Exception from HRESULT: 0x80131019) Help! Pin
Mark Salsbery1-Jun-09 12:42
Mark Salsbery1-Jun-09 12:42 
GeneralRe: Attempt to load an unverifiable executable with fixups (IAT with more than 2 sections or a TLS section.) (Exception from HRESULT: 0x80131019) Help! Pin
jobin0070071-Jun-09 13:15
jobin0070071-Jun-09 13:15 
AnswerUnable to access variables. Pin
jobin0070071-Jun-09 13:18
jobin0070071-Jun-09 13:18 
GeneralRe: Unable to access variables. Pin
jobin0070071-Jun-09 13:21
jobin0070071-Jun-09 13:21 
GeneralRe: Unable to access variables. Pin
jobin0070071-Jun-09 13:27
jobin0070071-Jun-09 13:27 
GeneralRe: Unable to access variables. Pin
jobin0070071-Jun-09 13:54
jobin0070071-Jun-09 13:54 
GeneralRe: Unable to access variables. Pin
Mark Salsbery1-Jun-09 17:25
Mark Salsbery1-Jun-09 17:25 
NewsNo Intellisense support in VC10 for C++/CLI!!! Pin
small_mountain28-May-09 7:05
small_mountain28-May-09 7:05 
GeneralRe: No Intellisense support in VC10 for C++/CLI!!! Pin
teejayem28-May-09 7:27
teejayem28-May-09 7:27 

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.