terminal services virtual channel client part in c#

W

Willy Denoyette [MVP]

me said:
I need to write the client part of a virtual channel for terminal services
in c#. I have already done the server part and it works just fine in c#. My
problem is exporting the function is requires me to export on the dll, I
have no idea how to do that from c#.
http://msdn.microsoft.com/library/d...mserv/termserv/virtual_channel_client_dll.asp

Thanks,

C# can't be used here, C++ only (all or not in a mixed managed/native DLL)
can create exports and the necessary entry points to load the DLL.
Willy.
 
M

me

Willy said:
C# can't be used here, C++ only (all or not in a mixed managed/native DLL)
can create exports and the necessary entry points to load the DLL.
Willy.


Thanks for all the help, turns out that using the ms rdp ocx I don't
need to write that DLL in order to send data from the server to the
clinet, I am now strugling sending the data from the client to the server.
 
R

Rob Leitman [MSFT]

Willy Denoyette said:
Rob,

I don't think this is of any help, the DLL has to "export" function and
must be loadable using LoadLibrary, something which isn't possible using
C#.

The DLL doesn't need to export the function, since you pass the function
pointer to VirtualChannelInit. All you need is a way to get a function
pointer in C#.

The article I pointed to explained how to do exactly that.

Rob
 
W

Willy Denoyette [MVP]

I wont suggest this, this is a hack that:
- isn't guaranteed to work in later versions of the CLR,
- turns into a maintenance mightmare.

Willy.

TP said:
Take a look at these articles, they should help you get started with
exporting a VirtualChannelEntry function from your C# assembly:

http://www.c-sharpcorner.com/Code/2003/Aug/ExportManagedCodeasUnmanaged.asp

http://www.codeproject.com/dotnet/emilio_managed_unmanaged.asp

For specific advice on how to get this working you will probably get a
better answer over in:

microsoft.public.dotnet.languages.csharp

Thanks.

-TP

me" <"c[r]asolorz said:
I need to write the client part of a virtual channel for terminal
services in c#. I have already done the server part and it works just
fine in c#. My problem is exporting the function is requires me to
export on the dll, I have no idea how to do that from c#.
http://msdn.microsoft.com/library/d...mserv/termserv/virtual_channel_client_dll.asp

Thanks,
 
W

Willy Denoyette [MVP]

Rob Leitman said:
The DLL doesn't need to export the function, since you pass the function
pointer to VirtualChannelInit. All you need is a way to get a function
pointer in C#.

The article I pointed to explained how to do exactly that.

Rob

--
This posting is provided "AS IS" with no warranties, and confers no
rights.
See the TS FAQ at
http://www.microsoft.com/windowsserver2003/community/centers/terminal/terminal_faq.mspx

Rob,

OP doesn't need to implement callback functions in managed code and pass the
pointer to unmanaged DLL code, he needs to implement a Virtual Channel
Client DLL in C# and this one has to:
1. Be dynamically loadable (LoadLibrary) and,
2. export the VirtualChannelEntry entrypoint.
Both of these are not possible in C#

Willy.
 
W

Willy Denoyette [MVP]

Forgot to mention that this isn't a solution as the DLL must be loadable by
Terminal Services as a regular native DLL which isn't possible using managed
assembly. Pure managed assemblies don't export/implement DllMain so can't be
loaded/mapped (using LoadLibrary(ex)) .

Willy.



TP said:
Take a look at these articles, they should help you get started with
exporting a VirtualChannelEntry function from your C# assembly:

http://www.c-sharpcorner.com/Code/2003/Aug/ExportManagedCodeasUnmanaged.asp

http://www.codeproject.com/dotnet/emilio_managed_unmanaged.asp

For specific advice on how to get this working you will probably get a
better answer over in:

microsoft.public.dotnet.languages.csharp

Thanks.

-TP

me" <"c[r]asolorz said:
I need to write the client part of a virtual channel for terminal
services in c#. I have already done the server part and it works just
fine in c#. My problem is exporting the function is requires me to
export on the dll, I have no idea how to do that from c#.
http://msdn.microsoft.com/library/d...mserv/termserv/virtual_channel_client_dll.asp

Thanks,
 
G

Guest

Como faço para que meus clientes que usam o SO em portugues, acessem os
recusros do servidor que esta em ingles ???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top