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

Managed C++/CLI

 
Generalnatural deduction in c++ Pin
Ankit Aneja29-Nov-04 2:57
Ankit Aneja29-Nov-04 2:57 
GeneralRe: natural deduction in c++ Pin
Christian Graus30-Nov-04 14:30
protectorChristian Graus30-Nov-04 14:30 
GeneralRe: natural deduction in c++ Pin
ThatsAlok1-Dec-04 18:50
ThatsAlok1-Dec-04 18:50 
GeneralJava to C++ SSL communication Pin
Sajeesh Kumar28-Nov-04 22:04
Sajeesh Kumar28-Nov-04 22:04 
Generalreferencing a com dll Pin
Sandra Fuller28-Nov-04 16:46
sussSandra Fuller28-Nov-04 16:46 
GeneralRe: referencing a com dll Pin
Alex Evans28-Nov-04 16:48
Alex Evans28-Nov-04 16:48 
GeneralRe: referencing a com dll Pin
ursus zeta2-Dec-04 9:59
ursus zeta2-Dec-04 9:59 
GeneralSystem.NullReferenceException: Object reference not set to an instance of an object. Pin
Dino Leong26-Nov-04 21:33
sussDino Leong26-Nov-04 21:33 
Got this problem when I run my .net wrapper class over a "c" class when this method is called. The problem code line is highlighted:
When I replace i1 or i2 with int, it works fine.

the console version calling this method works perfectly fine.

Thks.

-----
int subst_cost_qwerty(const char c1, const char c2)
{

static const int n = 33;
static const
int index[] = {
-1, /* _ 0 */
-1, /* _ 1 */
-1, /* _ 2 */
-1, /* _ 3 */
-1, /* _ 4 */
-1, /* _ 5 */
-1, /* _ 6 */
-1, /* _ 7 */
-1, /* _ 8 */
-1, /* _ 9 */
-1, /* _10 */
-1, /* _11 */
-1, /* _12 */
-1, /* _13 */
-1, /* _14 */
-1, /* _15 */
-1, /* _16 */
-1, /* _17 */
-1, /* _18 */
-1, /* _19 */
-1, /* _20 */
-1, /* _21 */
-1, /* _22 */
-1, /* _23 */
-1, /* _24 */
-1, /* _25 */
-1, /* _26 */
-1, /* _27 */
-1, /* _28 */
-1, /* _29 */
-1, /* _30 */
-1, /* _31 */
-1, /* */
-1, /* ! */
-1, /* " */
-1, /* # */
-1, /* $ */
-1, /* % */
-1, /* & */
0, /* ' */
-1, /* ( */
-1, /* ) */
-1, /* * */
-1, /* + */
1, /* , */
-1, /* - */
2, /* . */
3, /* / */
-1, /* 0 */
-1, /* 1 */
-1, /* 2 */
-1, /* 3 */
-1, /* 4 */
-1, /* 5 */
-1, /* 6 */
-1, /* 7 */
-1, /* 8 */
-1, /* 9 */
-1, /* : */
4, /* ; */
-1, /* < */
-1, /* = */
-1, /* > */
-1, /* ? */
-1, /* @ */
-1, /* A */
-1, /* B */
-1, /* C */
-1, /* D */
-1, /* E */
-1, /* F */
-1, /* G */
-1, /* H */
-1, /* I */
-1, /* J */
-1, /* K */
-1, /* L */
-1, /* M */
-1, /* N */
-1, /* O */
-1, /* P */
-1, /* Q */
-1, /* R */
-1, /* S */
-1, /* T */
-1, /* U */
-1, /* V */
-1, /* W */
-1, /* X */
-1, /* Y */
-1, /* Z */
5, /* [ */
-1, /* \ */
6, /* ] */
-1, /* ^ */
-1, /* _ */
-1, /* ` */
7, /* a */
8, /* b */
9, /* c */
10, /* d */
11, /* e */
12, /* f */
13, /* g */
14, /* h */
15, /* i */
16, /* j */
17, /* k */
18, /* l */
19, /* m */
20, /* n */
21, /* o */
22, /* p */
23, /* q */
24, /* r */
25, /* s */
26, /* t */
27, /* u */
28, /* v */
29, /* w */
30, /* x */
31, /* y */
32 /* z */
};

static const
int ctab[] = {
/* ' , . / ; [ ] a b c d e f g h i j k l m n o p q r s t u v w x y z */
/* ' */ 0, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
/* , */ 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
/* . */ 2, 1, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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2, 2, 2, 1, 1, 1, 2, 2, 0, 2,
/* z */ 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 1, 2, 0
};
int i1 = index[(int)c1]; // problem code
int i2 = index[(int)c2]; // problem code

int retval;
if (i1 == -1 || i2 == -1)
retval = 2;
else
retval = ctab[i1*n+i2];

//printf("[%c/%d][%c/%d]=>%d\n",c1,i1,c2,i2,retval);
return retval;
}
-----------
GeneralWindows Forms control Pin
VKatti25-Nov-04 5:13
VKatti25-Nov-04 5:13 
GeneralRe: Windows Forms control Pin
ursus zeta2-Dec-04 10:18
ursus zeta2-Dec-04 10:18 
GeneralRe: Windows Forms control Pin
TigerNinja_14-Dec-04 13:43
TigerNinja_14-Dec-04 13:43 
QuestionWhat are the different project types? Pin
Hadi Fakhreddine23-Nov-04 23:04
Hadi Fakhreddine23-Nov-04 23:04 
AnswerRe: What are the different project types? Pin
toxcct25-Nov-04 1:01
toxcct25-Nov-04 1:01 
GeneralProgramming a ping n trace route program Pin
hafiziziziz22-Nov-04 16:20
hafiziziziz22-Nov-04 16:20 
GeneralRe: Programming a ping n trace route program Pin
Roland Bär7-Dec-04 0:40
Roland Bär7-Dec-04 0:40 
GeneralLinking with an unknow java VM from Managed C++ Pin
Large Data File20-Nov-04 22:11
Large Data File20-Nov-04 22:11 
GeneralPlacing a form on another form Pin
1gfr118-Nov-04 11:13
1gfr118-Nov-04 11:13 
Generalwrapping unmanaged classes for controls Pin
BlackDice18-Nov-04 9:50
BlackDice18-Nov-04 9:50 
GeneralHa Ha Pin
ursus zeta24-Nov-04 10:28
ursus zeta24-Nov-04 10:28 
GeneralRe: wrapping unmanaged classes for controls Pin
TigerNinja_14-Dec-04 13:51
TigerNinja_14-Dec-04 13:51 
GeneralRe: wrapping unmanaged classes for controls Pin
sunhui15-Dec-04 12:57
sunhui15-Dec-04 12:57 
GeneralMC++ and CString Pin
Cokeisit16-Nov-04 23:57
Cokeisit16-Nov-04 23:57 
GeneralRe: MC++ and CString Pin
TigerNinja_14-Dec-04 13:48
TigerNinja_14-Dec-04 13:48 
Generalerror PRJ0002 : error result returned from 'rc.exe'. Pin
Emiliano16-Nov-04 12:39
Emiliano16-Nov-04 12:39 
GeneralRe: error PRJ0002 : error result returned from 'rc.exe'. Pin
Flame Gitsnik23-Nov-04 10:41
Flame Gitsnik23-Nov-04 10:41 

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.