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

Managed C++/CLI

 
Questioncreate wrapper class in vc ++ Pin
vitthal0902197722-Sep-11 4:31
vitthal0902197722-Sep-11 4:31 
QuestionDifference between a User dump and Kernel dump Pin
rupeshkp72822-Sep-11 0:17
rupeshkp72822-Sep-11 0:17 
AnswerRe: Difference between a User dump and Kernel dump Pin
Richard MacCutchan22-Sep-11 2:52
mveRichard MacCutchan22-Sep-11 2:52 
Questionora-12541 in c++/cli project.. Pin
aupres12-Sep-11 19:02
aupres12-Sep-11 19:02 
Questionproblem communicating between managed and unmanaged code inside a dll Pin
mtestt8-Sep-11 5:32
mtestt8-Sep-11 5:32 
AnswerRe: problem communicating between managed and unmanaged code inside a dll Pin
Richard Andrew x649-Sep-11 13:56
professionalRichard Andrew x649-Sep-11 13:56 
Questionhooking winsock send function Pin
vkgktm24-Aug-11 1:31
vkgktm24-Aug-11 1:31 
QuestionWeird problem using C++ dll from vb6 Pin
lenourien22-Aug-11 15:57
lenourien22-Aug-11 15:57 
Hello all,

I have a problem I just can't solve.

I have a c++ dll that returns a VARIANT of type VT_ARRAY|VT_BYREF|VT_BSTR.

following what was explained in Step by Step: Calling C++ DLLs from VC++ and VB - Part 3[^]. I turned my whole C++ process into a class.

On the vb side, I have a string array that receives the info back from the C++ dll
it is declared at a form level as private myarray() as string

The problem is that the first time I use it, it works perfectly. But if I push the button a second time, the whole process works until the dll reaches the point where it returns the variant and it just fails.

I don't understand. I'm pretty sure the class is destroyed the first time and so any value contained in the variant is deleted.

Also in vb if I unload and reload the dll every time, then it works well. So it's not an array problem on vb part (and I tried redim and erase and all). But I don't really want to load and unload every time, seems like bad programming and it creates other problems anyway.

So to summarise:
From vb6:
1-call C++ dll to create class
2-call class function to return array
3-call C++ dll to destroy class

first time works without a glinch, second time gets an error when returning the array.

Please help, it's driving me crazy.

Oh and as you might have guessed I'm a noob with C++ Smile | :)

Many thanks
AnswerRe: Weird problem using C++ dll from vb6 Pin
Richard Andrew x6422-Aug-11 16:22
professionalRichard Andrew x6422-Aug-11 16:22 
GeneralRe: Weird problem using C++ dll from vb6 Pin
lenourien22-Aug-11 17:35
lenourien22-Aug-11 17:35 
GeneralRe: Weird problem using C++ dll from vb6 Pin
Richard MacCutchan22-Aug-11 23:06
mveRichard MacCutchan22-Aug-11 23:06 
GeneralRe: Weird problem using C++ dll from vb6 Pin
lenourien22-Aug-11 23:23
lenourien22-Aug-11 23:23 
GeneralRe: Weird problem using C++ dll from vb6 Pin
Richard MacCutchan23-Aug-11 0:05
mveRichard MacCutchan23-Aug-11 0:05 
GeneralRe: Weird problem using C++ dll from vb6 Pin
lenourien23-Aug-11 0:10
lenourien23-Aug-11 0:10 
GeneralRe: Weird problem using C++ dll from vb6 Pin
Richard MacCutchan23-Aug-11 0:12
mveRichard MacCutchan23-Aug-11 0:12 
GeneralRe: Weird problem using C++ dll from vb6 Pin
lenourien23-Aug-11 2:55
lenourien23-Aug-11 2:55 
GeneralRe: Weird problem using C++ dll from vb6 Pin
lenourien23-Aug-11 5:05
lenourien23-Aug-11 5:05 
AnswerRe: Weird problem using C++ dll from vb6 Pin
MicroVirus23-Aug-11 5:24
MicroVirus23-Aug-11 5:24 
GeneralRe: Weird problem using C++ dll from vb6 Pin
Richard MacCutchan23-Aug-11 5:51
mveRichard MacCutchan23-Aug-11 5:51 
AnswerRe: Weird problem using C++ dll from vb6 Pin
MicroVirus23-Aug-11 5:18
MicroVirus23-Aug-11 5:18 
GeneralRe: Weird problem using C++ dll from vb6 Pin
lenourien23-Aug-11 13:33
lenourien23-Aug-11 13:33 
QuestionRe: Weird problem using C++ dll from vb6 Pin
MicroVirus23-Aug-11 15:22
MicroVirus23-Aug-11 15:22 
AnswerRe: Weird problem using C++ dll from vb6 Pin
lenourien24-Aug-11 4:17
lenourien24-Aug-11 4:17 
AnswerRe: Weird problem using C++ dll from vb6 Pin
MicroVirus24-Aug-11 17:41
MicroVirus24-Aug-11 17:41 
GeneralRe: Weird problem using C++ dll from vb6 Pin
lenourien25-Aug-11 1:31
lenourien25-Aug-11 1:31 

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.