Click here to Skip to main content
15,902,445 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to Open compressed TIF (JTIF) within WinForm and C# Pin
Dave Kreskowiak30-Oct-08 15:56
mveDave Kreskowiak30-Oct-08 15:56 
GeneralRe: how to Open compressed TIF (JTIF) within WinForm and C# Pin
Dan Neely31-Oct-08 2:03
Dan Neely31-Oct-08 2:03 
Questionclosed dialog (from other thread) minimizes application - need some help please !!! Pin
Skeletor2330-Oct-08 7:00
Skeletor2330-Oct-08 7:00 
AnswerRe: closed dialog (from other thread) minimizes application - need some help please !!! Pin
jas0n232-Nov-08 1:53
jas0n232-Nov-08 1:53 
QuestionSecurity in a C# based Desktop Application Pin
mdwhite7630-Oct-08 6:07
mdwhite7630-Oct-08 6:07 
AnswerRe: Security in a C# based Desktop Application Pin
Simon P Stevens30-Oct-08 6:32
Simon P Stevens30-Oct-08 6:32 
AnswerRe: Security in a C# based Desktop Application Pin
Giorgi Dalakishvili30-Oct-08 8:30
mentorGiorgi Dalakishvili30-Oct-08 8:30 
QuestionProblem of Unloading Managed C++ DLL... Pin
chandrap30-Oct-08 5:57
chandrap30-Oct-08 5:57 
I am having problem to delete a Managed C++ DLL that was used in a
pure C# DLL even in the following scenario.


1. Launch the application. This applicatio has its own default
applicaiton domain.
2. Create a new Application Domain.
3. Load the Pure C# DLL in the new applicaiton domain. This C# DLL uses
managed C++ DLL.
4. Create a Proxy object using CreateInstanceAndUnwrap for the wrapper
object which is a wrapper for the class used from the pure C# DLL.
This wrapper object is exported from a seperate DLL.

DLL Configuration:- Wrapper for C# DLL, C# DLL, Managed C++ DLL.
The wrapper C# is used so that the main C# will not be loaded into
the default application domain when creating a Proxy object using the
menthod CreateInstanceAndUnwrap. The application domain talks with
only the wrapper DLL. If we do not have wrapper class, then the main
C# DLL will also be loaded into the default application. The sideeffect
of this is that, even when the new application is unloaded, we will not
be able to delete the main C# DLL. Wrapper is just a call frowader to
the C# DLL class.

5. Give the class name exported from C# DLL to the wrapper object and ask
it to create an instance of the class. The wrapper class creates the
the class and initializes its membet to it, so that it can forward
call requests.
6. From the default application domain, call a method on the wrapper object.
This call on the wrapper object calls the method on the C# class. This
C# class uses a function exported from a managed C++ DLL.
7. After executing the methods, unload the new application domain.
8. Now try to delete C# DLL, Mananged C++ DLL.


I was able to delete C# DLL, but not MC++ DLL. After further investigation
I found that the Visual Studio "Output" window has the following two lines:-

'Application.exe': Loaded 'C:\DLL1\Debug\MCPP.dll', Symbols loaded.----> LOADING FIRST TIME
'Application.exe' (Managed): Loaded 'C:\DLL1\Debug\MCPP.dll', Symbols loaded. ----> LOADING SECOND TIME

When the method on C# class is getting executed, the output log file
contains the above two lines. The .NET framework is loading it twice.
Once as Native C++ DLL, second time as Managed DLL.

Does any one know how to delete the MC++ DLL.
QuestionRe: Problem of Unloading Managed C++ DLL... Pin
Mark Salsbery30-Oct-08 7:29
Mark Salsbery30-Oct-08 7:29 
AnswerRe: Problem of Unloading Managed C++ DLL... Pin
chandrap30-Oct-08 7:32
chandrap30-Oct-08 7:32 
GeneralRe: Problem of Unloading Managed C++ DLL... Pin
chandrap30-Oct-08 7:44
chandrap30-Oct-08 7:44 
GeneralRe: Problem of Unloading Managed C++ DLL... Pin
Mark Salsbery30-Oct-08 7:53
Mark Salsbery30-Oct-08 7:53 
GeneralRe: Problem of Unloading Managed C++ DLL... Pin
chandrap30-Oct-08 8:13
chandrap30-Oct-08 8:13 
GeneralRe: Problem of Unloading Managed C++ DLL... Pin
Mark Salsbery30-Oct-08 8:18
Mark Salsbery30-Oct-08 8:18 
GeneralRe: Problem of Unloading Managed C++ DLL... Pin
chandrap30-Oct-08 8:23
chandrap30-Oct-08 8:23 
GeneralRe: Problem of Unloading Managed C++ DLL... Pin
Mark Salsbery30-Oct-08 8:47
Mark Salsbery30-Oct-08 8:47 
GeneralRe: Problem of Unloading Managed C++ DLL... Pin
chandrap30-Oct-08 8:50
chandrap30-Oct-08 8:50 
GeneralRe: Problem of Unloading Managed C++ DLL... Pin
Mark Salsbery30-Oct-08 9:01
Mark Salsbery30-Oct-08 9:01 
GeneralRe: Problem of Unloading Managed C++ DLL... Pin
chandrap30-Oct-08 9:17
chandrap30-Oct-08 9:17 
GeneralRe: Problem of Unloading Managed C++ DLL... Pin
Mark Salsbery30-Oct-08 9:45
Mark Salsbery30-Oct-08 9:45 
QuestionManipulating dates from bound DataGridView Pin
kanchoette30-Oct-08 5:11
kanchoette30-Oct-08 5:11 
AnswerRe: Manipulating dates from bound DataGridView Pin
Ben Fair30-Oct-08 5:51
Ben Fair30-Oct-08 5:51 
AnswerRe: Manipulating dates from bound DataGridView Pin
kanchoette30-Oct-08 23:17
kanchoette30-Oct-08 23:17 
GeneralRe: Manipulating dates from bound DataGridView Pin
kanchoette31-Oct-08 0:03
kanchoette31-Oct-08 0:03 
Questioncalculating difference betwen to time and dates Pin
Matjaz-xyz30-Oct-08 4:22
Matjaz-xyz30-Oct-08 4:22 

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.