Click here to Skip to main content
15,908,172 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Pointer error with SendMessage() and LPARAM Pin
zarzor11-Dec-02 15:18
zarzor11-Dec-02 15:18 
GeneralTemplate Pin
Gary Kirkham11-Dec-02 10:34
Gary Kirkham11-Dec-02 10:34 
GeneralRe: Template Pin
Maximilien11-Dec-02 10:42
Maximilien11-Dec-02 10:42 
GeneralRe: Template Pin
Alvaro Mendez11-Dec-02 11:04
Alvaro Mendez11-Dec-02 11:04 
QuestionIs this possible? Pin
Mash11-Dec-02 10:17
Mash11-Dec-02 10:17 
AnswerRe: Is this possible? Pin
Christian Graus11-Dec-02 10:30
protectorChristian Graus11-Dec-02 10:30 
AnswerRe: Is this possible? Pin
Ravi Bhavnani11-Dec-02 12:53
professionalRavi Bhavnani11-Dec-02 12:53 
QuestionVC++(6 ) & VC.NET porting problems?? 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????

AnswerRe: VC++(6 ) & VC.NET porting problems?? Pin
Christian Graus11-Dec-02 10:02
protectorChristian Graus11-Dec-02 10:02 
GeneralSpace between rows in CListCtrl Pin
Jason Henderson11-Dec-02 9:19
Jason Henderson11-Dec-02 9:19 
GeneralRe: Space between rows in CListCtrl Pin
David Salter11-Dec-02 10:10
David Salter11-Dec-02 10:10 
GeneralRe: Space between rows in CListCtrl Pin
Jason Henderson11-Dec-02 10:24
Jason Henderson11-Dec-02 10:24 
Generalempty virtual method good practice question ... Pin
Maximilien11-Dec-02 9:12
Maximilien11-Dec-02 9:12 
GeneralRe: empty virtual method good practice question ... Pin
Daniel Turini11-Dec-02 9:15
Daniel Turini11-Dec-02 9:15 
GeneralRe: empty virtual method good practice question ... Pin
Maximilien11-Dec-02 9:25
Maximilien11-Dec-02 9:25 
GeneralRe: empty virtual method good practice question ... Pin
Ranjan Banerji11-Dec-02 9:23
Ranjan Banerji11-Dec-02 9:23 
GeneralRe: empty virtual method good practice question ... Pin
Alvaro Mendez11-Dec-02 9:26
Alvaro Mendez11-Dec-02 9:26 
GeneralRe: empty virtual method good practice question ... Pin
Maximilien11-Dec-02 9:30
Maximilien11-Dec-02 9:30 
GeneralRe: empty virtual method good practice question ... Pin
Alvaro Mendez11-Dec-02 9:35
Alvaro Mendez11-Dec-02 9:35 
GeneralRe: empty virtual method good practice question ... Pin
Maximilien11-Dec-02 9:38
Maximilien11-Dec-02 9:38 
QuestionChar to INT? Pin
Anonymous11-Dec-02 9:09
Anonymous11-Dec-02 9:09 
AnswerRe: Char to INT? Pin
Alvaro Mendez11-Dec-02 9:12
Alvaro Mendez11-Dec-02 9:12 
GeneralRe: Char to INT? Pin
Nitron11-Dec-02 13:23
Nitron11-Dec-02 13:23 
AnswerRe: Char to INT? Pin
Greven11-Dec-02 9:21
Greven11-Dec-02 9:21 
GeneralRe: Char to INT? Pin
Alvaro Mendez11-Dec-02 9:29
Alvaro Mendez11-Dec-02 9:29 

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.