Re: Mixed mode woes (hopefully I simply dont get it )



My understanding is that the gcroot template requies managed support, so how
would I declare an instance var that used gcroot in the header used by
unmanaged classes ?

"Nishant Sivakumar" <nish@xxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:u$ECIxtEGHA.2380@xxxxxxxxxxxxxxxxxxxxxxx
> Not sure if this is useful, but have you looked at using gcroot?
>
> --
> Regards,
> Nish [VC++ MVP]
>
>
> "Robert Ginsburg" <robert.ginsburg@xxxxxxxx> wrote in message
> news:OC7invtEGHA.472@xxxxxxxxxxxxxxxxxxxxxxx
>>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
>>
>
>


.



Relevant Pages

  • Re: Mixed mode woes (hopefully I simply dont get it )
    ... The following code compiles:- ... > My understanding is that the gcroot template requies managed support, ... >>> classes can use it and include it's header. ... >>> cant declare the managed instance variable in the header because it is ...
    (microsoft.public.dotnet.languages.vc)
  • Re: static library problems
    ... Do not declare variables in header files. ... variable itself must be declared in a .cpp file. ... >If i want to use this string in other modules, i just need include the header, i need not link this static lib. ...
    (microsoft.public.vc.mfc)
  • Re: Variables and scope ? !!!!
    ... without seeing the project but i no professional vba programmer but would ... > global -- available to all code in the application, declared in the header ... > a) Declare the variable, in the header of an ordinary module ... Global variables are, in general, bad practice. ...
    (microsoft.public.word.vba.general)
  • Re: Exported function mangaled name
    ... extern "C" { ... You have otherwise defined a function unrelated to the header ... You have to declare the function the same way in your .cpp file as in your .h file ... #define LIBSPEC __declspec ...
    (microsoft.public.vc.mfc)
  • Re: confused about global namespace and scope
    ... If you want a separate header for your global variables, ... I avoid too many global variables in a C++ app. ... are comparing a UNIX project that you write from scratch with a Windows ... >> You can declare it in any source file. ...
    (microsoft.public.vc.mfc)

Loading