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

Managed C++/CLI

 
QuestionConversion Pin
need4change4-Dec-05 2:18
need4change4-Dec-05 2:18 
AnswerRe: Conversion Pin
S. Senthil Kumar4-Dec-05 2:45
S. Senthil Kumar4-Dec-05 2:45 
AnswerRe: Conversion Pin
Saksida Bojan4-Dec-05 19:39
Saksida Bojan4-Dec-05 19:39 
AnswerRe: Conversion Pin
toxcct5-Dec-05 0:53
toxcct5-Dec-05 0:53 
QuestionVruses? Pin
Lord Kixdemp2-Dec-05 20:33
Lord Kixdemp2-Dec-05 20:33 
AnswerRe: Vruses? Pin
Christian Graus7-Dec-05 15:01
protectorChristian Graus7-Dec-05 15:01 
GeneralRe: Vruses? Pin
Lord Kixdemp9-Dec-05 12:29
Lord Kixdemp9-Dec-05 12:29 
QuestionTypeLoadException when accessing opaque unmanged struct Pin
dirkhelmet!@yahoo.com2-Dec-05 2:52
dirkhelmet!@yahoo.com2-Dec-05 2:52 
I'm getting a System.TypeLoadException when I try to access an unmanaged opaque struct.

I have an older, unmanaged API - in 'C' actually - and I am trying to access it from managed C++. The header for the api provides me with an opaque pointer to a struct:

typedef struct _table *TablePtr

so I make a call like this: TablePtr CreateTable();

The internals of the struct are hidden in a private header file.

I have this wrapped in managed C++ - so that my class makes this call in it's constructor:

#include "table_pub.h" // has the typedef for opaque TablePtr

private:
TablePtr mytable;

public:
TableClass(void)
{
mytable = CreateTable();
}

When I call this constructor, I get an exception:
An unhandled exception of type 'System.TypeLoadException' occurred in tester.exe
Additional information: Could not load type _table from assembly olf_mydll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.

YET, if I include the PRIVATE header for TablePtr - containing the internal structure definition, it works and I don't get the exception. I don't really want to access the private header - can't guarantee that I'll even have that access going forward.

Is there something I can do to say that this unmanaged type is NOT to be loaded?

Thanks
Rich

AnswerFound the answer Pin
dirkhelmet!@yahoo.com2-Dec-05 5:27
dirkhelmet!@yahoo.com2-Dec-05 5:27 
QuestionAdding text to multiline EditBox in win forms app Pin
9ine29-Nov-05 21:56
9ine29-Nov-05 21:56 
QuestionRe-engineering C++. Visual Basic binary in NT Pin
pramodktp29-Nov-05 21:24
pramodktp29-Nov-05 21:24 
AnswerRe: Re-engineering C++. Visual Basic binary in NT Pin
Nish Nishant30-Nov-05 8:38
sitebuilderNish Nishant30-Nov-05 8:38 
QuestionWierd Errors Pin
Bobamagoo29-Nov-05 16:14
Bobamagoo29-Nov-05 16:14 
AnswerRe: Wierd Errors Pin
Christian Graus29-Nov-05 17:46
protectorChristian Graus29-Nov-05 17:46 
QuestionRe: Wierd Errors Pin
Bobamagoo30-Nov-05 3:29
Bobamagoo30-Nov-05 3:29 
QuestionRe: Wierd Errors Pin
Bobamagoo30-Nov-05 7:55
Bobamagoo30-Nov-05 7:55 
AnswerRe: Wierd Errors Pin
Christian Graus30-Nov-05 11:20
protectorChristian Graus30-Nov-05 11:20 
AnswerRe: Wierd Errors Pin
Nish Nishant30-Nov-05 8:38
sitebuilderNish Nishant30-Nov-05 8:38 
Questionvolatile variable without volatile!!!!!!!!!!!!!!!!! Pin
Pegasus Kiddo28-Nov-05 23:53
Pegasus Kiddo28-Nov-05 23:53 
AnswerRe: volatile variable without volatile!!!!!!!!!!!!!!!!! Pin
toxcct29-Nov-05 0:39
toxcct29-Nov-05 0:39 
GeneralRe: volatile variable without volatile!!!!!!!!!!!!!!!!! Pin
Pegasus Kiddo29-Nov-05 0:53
Pegasus Kiddo29-Nov-05 0:53 
GeneralRe: volatile variable without volatile!!!!!!!!!!!!!!!!! Pin
hariharasuthan29-Nov-05 1:20
hariharasuthan29-Nov-05 1:20 
GeneralRe: volatile variable without volatile!!!!!!!!!!!!!!!!! Pin
toxcct29-Nov-05 2:02
toxcct29-Nov-05 2:02 
GeneralRe: volatile variable without volatile!!!!!!!!!!!!!!!!! Pin
toxcct29-Nov-05 2:06
toxcct29-Nov-05 2:06 
GeneralRe: volatile variable without volatile!!!!!!!!!!!!!!!!! Pin
S. Senthil Kumar4-Dec-05 2:55
S. Senthil Kumar4-Dec-05 2:55 

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.