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

Managed C++/CLI

 
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 
Your problem is mostly a conceptual one, and less of a programming problem at this point.
First you need to get your design straight. Without seeing *all* the code involved, it's a guessing game here, because there is something wrong with the lifetime of objects and the flow of the program: this encompasses all the relevant code, not just the bits and pieces you posted. However, I'm guessing it's a lot of code, so not very easy/nice to share here.

What would help you and us is if you could 'sketch' how your program works. We know that there is static data. How and where is this initialised? We know that there is a class involved: what does this class do with the data, and does it allocate/initialise (for instance in constructor, and deallocate in destructor). Furthermore, there is some kind of communication with a VB6 application. How does this work?

The problem is that there is data 'floating around' and conceptually, you haven't yet figured out who is responsible for creating it, maintaining it, how and with who it is shared and who is responsible for cleaning it up. I'm guessing somewhat here, but I believe your destructor is cleaning up more than it should (for instance: cleaning up (too much of) the static variables).

So, like I said, a sketch of what happens (without the nitty gritty details of the exact code and functions called) would be nice. I'm thinking like:
C++
class CXyz
{
  // static data:
  ...

  constructor: describe what it does with static data
               and what non-static data is allocated

  destuctor: ditto

  // function that somehow interacts with VB6
  void VB6Function(): describe which data it passes to VB6 and how
}

// Static data initialised in function Something():
...


That way, we'll get an overview of the lifetime of the data and the class and where the data is kept. It should shed some light on what the proper lifecycles for the data is (probably, it isn't static as it is now).

I might sound a bit harsh here; if so I'm sorry. Trying to help Wink | ;) Maybe someone else can make more sense of it than me, but I believe having the above information will help.
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 
GeneralRe: Weird problem using C++ dll from vb6 Pin
MicroVirus25-Aug-11 3:25
MicroVirus25-Aug-11 3:25 
GeneralRe: Weird problem using C++ dll from vb6 Pin
lenourien25-Aug-11 12:39
lenourien25-Aug-11 12:39 
QuestionWTSSendMessage fails as RPC Server is unavailable Pin
Arun Parthasarathy22-Aug-11 1:24
Arun Parthasarathy22-Aug-11 1:24 
AnswerRe: WTSSendMessage fails as RPC Server is unavailable Pin
Tony Richards25-Aug-11 13:05
Tony Richards25-Aug-11 13:05 
QuestionConverting ADO data types into C++ data types Pin
Bahram198420-Aug-11 0:47
Bahram198420-Aug-11 0:47 
AnswerRe: Converting ADO data types into C++ data types Pin
John Schroedl22-Aug-11 3:28
professionalJohn Schroedl22-Aug-11 3:28 
QuestionInheriting a template class Pin
Subin Mavunkal17-Aug-11 1:43
Subin Mavunkal17-Aug-11 1:43 
AnswerRe: Inheriting a template class Pin
George L. Jackson9-Sep-11 12:13
George L. Jackson9-Sep-11 12:13 
Questionc++ function name parameter problem Pin
ali_zdn14-Aug-11 3:11
ali_zdn14-Aug-11 3:11 
AnswerRe: c++ function name parameter problem Pin
Richard MacCutchan14-Aug-11 7:03
mveRichard MacCutchan14-Aug-11 7:03 
QuestionProject Converted From VS2003 to VS2008, get exception when call dialog.doModal Pin
Andraw Tang5-Aug-11 11:16
Andraw Tang5-Aug-11 11:16 
AnswerRe: Project Converted From VS2003 to VS2008, get exception when call dialog.doModal Pin
Richard MacCutchan5-Aug-11 22:32
mveRichard MacCutchan5-Aug-11 22:32 
GeneralRe: Project Converted From VS2003 to VS2008, get exception when call dialog.doModal Pin
Andraw Tang8-Aug-11 4:37
Andraw Tang8-Aug-11 4:37 
GeneralRe: Project Converted From VS2003 to VS2008, get exception when call dialog.doModal Pin
Richard MacCutchan8-Aug-11 7:02
mveRichard MacCutchan8-Aug-11 7: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.