MSFN Forum: Help - Converting C# to C++ in .NET environment - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Help - Converting C# to C++ in .NET environment Converting C# to C++ Rate Topic: -----

#1 User is offline   bored_womble 

  • Group: Members
  • Posts: 1
  • Joined: 27-October 05

Posted 27 October 2005 - 06:45 AM

Hi,

I am new to the boards and have spent alot of time searching the web for an answer, with limited success in converting code from C# to C++.

I have most of the material I need however one problem still persists and this seemed to be an appropriate place to ask for help.

I have the following C# code
public void TransitionalState(
	object ResponseBlob,
	IWMSContext pUserCtx,
	IWMSContext pPresentationCtx,
	IWMSCommandContext pCommandContext,
	IWMSAuthenticationCallback pCallback,
	object Context)
{
	string AUTH_QOP = "Instance";
	string AUTH_REALM = "REALM";

	Encoding Enc = Encoding.Unicode;
	string strNonce = GenerateNonce();
	byte[] Response;
	byte[] Challenge = Enc.GetBytes("");

	try
	{
		Response = (byte[])ResponseBlob;
		if( Response.Length == 0 )
		{
			// The client requested authentication; prepare the
			// challenge response to send to the client.
			Challenge = Enc.GetBytes("realm=\"" + AUTH_REALM +
								   "\",qop=\"" + AUTH_QOP +
								   "\",nonce=\"" + strNonce +
								   "\",charset=utf-8,algorithm=MD5-sess");

			m_Result =
					WMS_AUTHENTICATION_RESULT.WMS_AUTHENTICATION_CONTINUE;
		}


Which is basically a setup for request authentication from a Windows Media Plugin, and works as expected in C#, however I need to convert it to C++, the main issue I have is the VARIENT in C++ which I am failing to be able to fill with the string ( Challenge ) required.

Any Takers ?

Appologies if these appears something rather basic, however my C++ experience is relatively new, but I would like to understand some of the construct difference between the two ...

BW


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy