Click here to Skip to main content
16,005,149 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
Questionstd::string within .NET 2003 Pin
richiebaby9-Apr-06 13:40
richiebaby9-Apr-06 13:40 
AnswerRe: std::string within .NET 2003 Pin
PJ Arends9-Apr-06 15:52
professionalPJ Arends9-Apr-06 15:52 
AnswerRe: std::string within .NET 2003 Pin
Michael Dunn9-Apr-06 18:56
sitebuilderMichael Dunn9-Apr-06 18:56 
AnswerRe: std::string within .NET 2003 Pin
George L. Jackson11-Apr-06 10:44
George L. Jackson11-Apr-06 10:44 
AnswerRe: for opinion.. using wut type of c++ can solved tis problem ? urgent...thk Pin
George L. Jackson7-Apr-06 11:33
George L. Jackson7-Apr-06 11:33 
GeneralRe: i done it...thk u all..let me share tis to u all Pin
George L. Jackson8-Apr-06 1:25
George L. Jackson8-Apr-06 1:25 
GeneralRe: i done it...thk u all..let me share tis to u all Pin
cusack8-Apr-06 19:26
cusack8-Apr-06 19:26 
QuestionInvoke to dynamic library with custom object Pin
dawei.code7-Apr-06 4:28
dawei.code7-Apr-06 4:28 
Hello,

I have a special question on the Invoke Method of the MethodInfo class and maybe it will show to be a general question on assembly techniques. I am using Managed C++ bytheway.

My goal is to load a library dynamically (as a plugin) and just get a specific function. This is all working well as long as I keep it simple.

- I defined an interface class and all plugin classes derive from that one.
- Now, the function that I want to invoke needs 4 parameters of which 3 are standard .NET objects. The fourth however is my own type.
- If I invoke that function with the parameter array, I get an exception as soon as my type object is not NULL saying the typical "Object cannot be converted to target type".

At first, I had my data class definitions in the main applications and additionally made a library with the same classes, which was linked by the plugin, as the plugin needs the same data classes, of course. I figured, he might have trouble realizing that these are really the same types. So I put the classes into a separate library. Now, the main application AND the plugin link the SAME library. But seperately at different times, I guess.
Could this already be the problem? Or where else is the problem?
I also found something about "copylocal" related to similar problems, which should be set to "false". But I have no idea in which area this setting is to be made and if it will really solve the problem.

Further thought: in the common plugin-samples the thisObject for
mi->Invoke (thisObject,...) is created by
thisObject = Activator::CreateInstance (type);

This doesn't work for me either, as the class information I have is only the Interface which cannot be instanziated. The specific class definition is in the plugin. Is that related to my problem? If the invoke works anyway, I'm fine as it is.
Again: Invoking methods of the same plugin, that do not use my own classes cause no problems.

I would appreciate any help and hint. Maybe I am close or I am far off. I just don't know. My samples were all C# and too simple, so finally, I am lost.

Thank you very much in advance! If you need some code, I can provide that on Monday, when I'm back on my PC.

Thank you and have a nice weekend,

dawei




AnswerRe: Invoke to dynamic library with custom object Pin
S. Senthil Kumar8-Apr-06 13:50
S. Senthil Kumar8-Apr-06 13:50 
GeneralRe: Invoke to dynamic library with custom object Pin
dawei.code8-Apr-06 15:12
dawei.code8-Apr-06 15:12 
GeneralRe: Invoke to dynamic library with custom object Pin
S. Senthil Kumar8-Apr-06 18:50
S. Senthil Kumar8-Apr-06 18:50 
AnswerThat will do for now Pin
dawei.code9-Apr-06 15:14
dawei.code9-Apr-06 15:14 
Question'System.NullReferenceException' Pin
Kranti12519846-Apr-06 23:31
Kranti12519846-Apr-06 23:31 
AnswerRe: 'System.NullReferenceException' Pin
2bee 7-Apr-06 1:01
2bee 7-Apr-06 1:01 
GeneralRe: 'System.NullReferenceException' Pin
Kranti12519847-Apr-06 1:47
Kranti12519847-Apr-06 1:47 
GeneralRe: 'System.NullReferenceException' Pin
2bee 7-Apr-06 2:08
2bee 7-Apr-06 2:08 
GeneralRe: 'System.NullReferenceException' Pin
Kranti12519849-Apr-06 20:15
Kranti12519849-Apr-06 20:15 
Questionwrite and read an object of user defined class into file. Pin
anilksingh6-Apr-06 22:26
anilksingh6-Apr-06 22:26 
AnswerRe: write and read an object of user defined class into file. Pin
toxcct6-Apr-06 22:54
toxcct6-Apr-06 22:54 
QuestionParallel Port input/output Pin
cullercoats6-Apr-06 3:45
cullercoats6-Apr-06 3:45 
AnswerRe: Parallel Port input/output Pin
Gordon Brandly11-Apr-06 7:40
Gordon Brandly11-Apr-06 7:40 
Questionmanaged c++ in mobile development Pin
GDavy5-Apr-06 0:25
GDavy5-Apr-06 0:25 
Questionproject help Pin
reyou4-Apr-06 5:42
reyou4-Apr-06 5:42 
AnswerRe: project help Pin
George L. Jackson4-Apr-06 12:44
George L. Jackson4-Apr-06 12:44 
AnswerRe: project help Pin
toxcct4-Apr-06 22:02
toxcct4-Apr-06 22:02 

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.