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

Managed C++/CLI

 
GeneralMemory leak in managed class!!! Pin
Ahmet Orkun GEDiK12-Dec-02 23:24
sussAhmet Orkun GEDiK12-Dec-02 23:24 
GeneralRe: Memory leak in managed class!!! Pin
monrobot1313-Dec-02 4:12
monrobot1313-Dec-02 4:12 
GeneralRe: Memory leak in managed class!!! Pin
Jeff J13-Dec-02 9:49
Jeff J13-Dec-02 9:49 
GeneralConversion problem Pin
Anthony_Yio12-Dec-02 15:12
Anthony_Yio12-Dec-02 15:12 
GeneralRe: Conversion problem Pin
Jeff J12-Dec-02 22:12
Jeff J12-Dec-02 22:12 
GeneralRe: Conversion problem Pin
Anthony_Yio12-Dec-02 22:28
Anthony_Yio12-Dec-02 22:28 
GeneralRe: Conversion problem Pin
Jeff J13-Dec-02 8:57
Jeff J13-Dec-02 8:57 
GeneralHelp!!!!! Pin
dyerstein11-Dec-02 9:20
dyerstein11-Dec-02 9:20 
Porting problem???

I have a set of defines:
#define PROT_NACK_NONE 0
#define PROT_NACK_BYE 1



#define PROT_NACK_BAD_PROT 3
________________________________

And I also have a typedef structure:
typedef struct reject_s
{
short int rejectCode;
const char *message;
} reject_t;

reject_t *m_rejectTable;
_________________________________
I than implement my function which uses the above:

void CMessageProtocol::setRejectTable( )
{//private:
static reject_t reject[]=
{
{ PROT_NACK_NONE, ""},
{ PROT_NACK_BYE, "Bye"},
{ PROT_NACK_NO_MORE_CON, "No More Connection availiable"},
{ PROT_NACK_BAD_PROT, "Protocol version not supported"},
{ PROT_NACK_BAD_ENC, "Encryption version not supported"},
{ PROT_NACK_BAD_APP, "Application refused"},
{ PROT_NACK_BAD_LOG_PASS, "Invalid Login or password"},
{ PROT_NACK_BAD_MSG, "Invalid Message format"},
{ PROT_NACK_DEFAULT, "Error"},
{ 0, 0}
};

m_rejectTable = reject;
}

The above has been complied and runs under Microsoft Visual Studio 6

I am now attempting to implement this into a .NET library, that has a bunch of __gc classes, when I now attempt to convert using the following syntax:

typedef __nogc struct reject_s
{
const char message;
short int RejectCode;
} reject_t;
reject_t* m_rejectTable;

typedef __nogc struct encrypting_s
{
char crypto;
char * encryptingName;
unsigned char cypher[2];
} encrypting_t;
encrypting_t* m_encryptingTable;






when I attempting to implement the __gc class method that use’s the above:

void GEMBrokerMessengerProtocol::CGEMMessageProtocol::setRejectTable()
{
static reject_t reject[]=
{
{ PROT_NACK_NONE, ""},
{ PROT_NACK_BYE, "Bye"},
{ PROT_NACK_NO_MORE_CON, "No More Connection availiable"},
{ PROT_NACK_BAD_PROT, "Protocol version not supported"},
{ PROT_NACK_BAD_ENC, "Encryption version not supported"},
{ PROT_NACK_BAD_APP, "Application refused"},
{ PROT_NACK_BAD_LOG_PASS, "Invalid Login or password"},
{ PROT_NACK_BAD_MSG, "Invalid Message format"},
{ PROT_NACK_DEFAULT, "Error"},
{ 0, 0}
};

m_rejectTable = reject;
}


I get the following error under Visual Studio C++.NET

c:\Documents and Settings\mdyer\My Documents\Visual Studio Projects\CGEMBroker\GEMBrokerMessengerProtocol.cpp(22): error C2440: 'initializing' : cannot convert from 'int' to 'GEMBrokerMessengerProtocol::CGEMMessageProtocol::reject_t'

c:\Documents and Settings\mdyer\My Documents\Visual Studio Projects\CGEMBroker\GEMBrokerMessengerProtocol.cpp(22): error C2689: Initializing 'reject' : this form of non-aggregate initialization requires a unary constructor


I am very curious as to why I am having these compile errors under .NET and not under my previous compile of Visual Studio 6???? Very lost here????

GeneralObject * to (void *,size_t) and back Pin
Anonymous11-Dec-02 4:55
Anonymous11-Dec-02 4:55 
GeneralRe: Object * to (void *,size_t) and back Pin
Anonymous15-Dec-02 22:50
Anonymous15-Dec-02 22:50 
GeneralMFC app - porting Pin
MattG10-Dec-02 8:35
MattG10-Dec-02 8:35 
GeneralRe: MFC app - porting Pin
Maximilien10-Dec-02 8:50
Maximilien10-Dec-02 8:50 
GeneralRe: MFC app - porting Pin
MattG10-Dec-02 9:28
MattG10-Dec-02 9:28 
GeneralRe: MFC app - porting Pin
Maximilien10-Dec-02 13:43
Maximilien10-Dec-02 13:43 
GeneralRe: MFC app - porting Pin
MattG10-Dec-02 14:03
MattG10-Dec-02 14:03 
GeneralLinker Errors Pin
Paul Ingles8-Dec-02 12:23
Paul Ingles8-Dec-02 12:23 
GeneralRe: Linker Errors Pin
Nick Parker9-Dec-02 15:17
protectorNick Parker9-Dec-02 15:17 
Questionans required? Pin
imran_rafique7-Dec-02 9:44
imran_rafique7-Dec-02 9:44 
GeneralC++ vs. Managed C++ Pin
SanShou6-Dec-02 4:50
SanShou6-Dec-02 4:50 
GeneralRe: C++ vs. Managed C++ Pin
Jeff J6-Dec-02 12:55
Jeff J6-Dec-02 12:55 
GeneralRe: C++ vs. Managed C++ Pin
Nitron7-Dec-02 12:49
Nitron7-Dec-02 12:49 
GeneralRe: C++ vs. Managed C++ Pin
SanShou9-Dec-02 11:02
SanShou9-Dec-02 11:02 
GeneralRe: C++ vs. Managed C++ Pin
Nick Parker7-Dec-02 5:08
protectorNick Parker7-Dec-02 5:08 
GeneralRe: C++ vs. Managed C++ Pin
SanShou9-Dec-02 11:05
SanShou9-Dec-02 11:05 
GeneralRe: C++ vs. Managed C++ Pin
Nick Parker11-Dec-02 9:47
protectorNick Parker11-Dec-02 9:47 

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.