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

Managed C++/CLI

 
QuestionDual Linkage Possible with Managed DLL? Pin
Richard Andrew x6430-Sep-09 13:13
professionalRichard Andrew x6430-Sep-09 13:13 
AnswerRe: Dual Linkage Possible with Managed DLL? Pin
Luc Pattyn30-Sep-09 13:30
sitebuilderLuc Pattyn30-Sep-09 13:30 
GeneralRe: Dual Linkage Possible with Managed DLL? Pin
Richard Andrew x6430-Sep-09 13:35
professionalRichard Andrew x6430-Sep-09 13:35 
GeneralRe: Dual Linkage Possible with Managed DLL? Pin
Luc Pattyn30-Sep-09 13:45
sitebuilderLuc Pattyn30-Sep-09 13:45 
AnswerRe: Dual Linkage Possible with Managed DLL? Pin
N a v a n e e t h30-Sep-09 17:19
N a v a n e e t h30-Sep-09 17:19 
GeneralRe: Dual Linkage Possible with Managed DLL? Pin
Richard Andrew x6430-Sep-09 17:22
professionalRichard Andrew x6430-Sep-09 17:22 
GeneralRe: Dual Linkage Possible with Managed DLL? Pin
N a v a n e e t h30-Sep-09 17:48
N a v a n e e t h30-Sep-09 17:48 
Questionusing unmanaged lib in managed class [modified] Pin
carlo.andreoli29-Sep-09 22:50
carlo.andreoli29-Sep-09 22:50 
- using visual studio 2008 -

what i have done so far is this:

a) i selected the file .lib and the .h and imported in my project -- done
b) i set in the project properties the linker to point to the lib file --done
c) i set in the project properties the c++ to look for the .h file --done
d) i set in the general project properties to compile using clr
e) my portion of code where i inlude the .h:
...
#pragma unmanaged
#include "database.h"
#pragma managed
...

f) i put a button in my form and onclick i initialize a class in the unmanaged class

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
    try {
        db::database db2;
    }
    catch (System::Exception ^exception) {
    }
}	


g) after that i compile and everything goes fine (i thinked "maybe too simple")
h) i run the application and ....tada error...

An unhandled exception of type 'System.TypeInitializationException' occurred in Unknown Module.
Additional information: The type initializer for '<Module>' threw an exception.

i googled around and i see is a common problem but i can't find an answer on what i have a todo...a magic code like #pragma something or some compiler settings or somethings....i neither find a good "howTo" on how to do this... can someone help me out or point me to a tutorial - how to ?? thx Big Grin | :-D

modified on Thursday, October 1, 2009 8:02 AM

QuestionRe: using unmanaged lib in managed class [modified] Pin
carlo.andreoli30-Sep-09 22:56
carlo.andreoli30-Sep-09 22:56 
AnswerRe: using unmanaged lib in managed class Pin
Richard MacCutchan30-Sep-09 23:40
mveRichard MacCutchan30-Sep-09 23:40 
GeneralRe: using unmanaged lib in managed class Pin
carlo.andreoli30-Sep-09 23:59
carlo.andreoli30-Sep-09 23:59 
GeneralRe: using unmanaged lib in managed class Pin
Richard MacCutchan1-Oct-09 0:56
mveRichard MacCutchan1-Oct-09 0:56 
GeneralRe: using unmanaged lib in managed class Pin
Richard MacCutchan1-Oct-09 1:38
mveRichard MacCutchan1-Oct-09 1:38 
GeneralRe: using unmanaged lib in managed class [modified] Pin
carlo.andreoli1-Oct-09 2:03
carlo.andreoli1-Oct-09 2:03 
GeneralRe: using unmanaged lib in managed class Pin
Richard MacCutchan1-Oct-09 2:29
mveRichard MacCutchan1-Oct-09 2:29 
GeneralRe: using unmanaged lib in managed class Pin
carlo.andreoli1-Oct-09 3:34
carlo.andreoli1-Oct-09 3:34 
GeneralRe: using unmanaged lib in managed class Pin
Richard MacCutchan1-Oct-09 5:21
mveRichard MacCutchan1-Oct-09 5:21 
Questioncli::array&lt;any^&gt;^ Array Pin
jashimu29-Sep-09 7:12
jashimu29-Sep-09 7:12 
AnswerRe: cli::array&lt;any^&gt;^ Array Pin
N a v a n e e t h29-Sep-09 17:58
N a v a n e e t h29-Sep-09 17:58 
GeneralRe: cli::array&lt;any^&gt;^ Array Pin
jashimu30-Sep-09 4:32
jashimu30-Sep-09 4:32 
GeneralRe: cli::array&lt;any^&gt;^ Array Pin
Richard MacCutchan30-Sep-09 22:18
mveRichard MacCutchan30-Sep-09 22:18 
GeneralRe: cli::array&lt;any^&gt;^ Array Pin
jashimu1-Oct-09 6:50
jashimu1-Oct-09 6:50 
Questionproblem extending datetimepicker Pin
carlo.andreoli27-Sep-09 21:50
carlo.andreoli27-Sep-09 21:50 
AnswerRe: problem extending datetimepicker Pin
Luc Pattyn28-Sep-09 0:30
sitebuilderLuc Pattyn28-Sep-09 0:30 
GeneralRe: problem extending datetimepicker Pin
carlo.andreoli28-Sep-09 1:52
carlo.andreoli28-Sep-09 1:52 

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.