Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / January 2006

Tip: Looking for answers? Try searching our database.

Mixed mode C++ dll problems

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert Ginsburg - 06 Jan 2006 16:09 GMT
I have a mixed mode C++ dll, mostly it is unmanaged code that currently
communicates with a remote server over DCOM. I am trying to plug in the new
IPCChannel remoting provider to replace the DCOM (the replacment server is
in C#). (I cant CLR enable the whole dll, and just use managed classes due
to an ATL framework error/bug that I posted a question on previously).

I have created a new unmanaged class in the project and clr enabled that
class.  It has to be an unmanaged class so that the existing unmanaged
classes can use it and include it's header.  Well all of this works fine if
I connect and call the channel on every method, but  I want to keep a
persistant reference to the remote object in an instance of the class. I
cant declare the managed instance variable in the header because it is
included in the unmanaged code and the compiler wont let me . I have tried
to declare an void pointer and then pin it up using the GCHandle::Alloc .. ,
this compiles but throws an error since the remote reference is
"non-blittable".

Any thoughts or help is appreciated

Robert
Marcus Heege - 08 Jan 2006 10:17 GMT
gcroot is a wrapper around System::Runtime::InteropServices::GCHandle.
GCHandle can give you a native handle (int) for your object. To solve your
problem, you can use GCHandle manually.

Marcus Heege

>I have a mixed mode C++ dll, mostly it is unmanaged code that currently
>communicates with a remote server over DCOM. I am trying to plug in the new
[quoted text clipped - 16 lines]
>
> Robert
Robert Ginsburg - 08 Jan 2006 10:49 GMT
thanks, that is what I stumbled onto as well.

> gcroot is a wrapper around System::Runtime::InteropServices::GCHandle.
> GCHandle can give you a native handle (int) for your object. To solve your
[quoted text clipped - 23 lines]
>>
>> Robert

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.