Thread: help convert code to C++...

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    2

    help convert code to C++...

    Hi, i need some help convert my C# code to C++...im building a DLL file and the function to be exported...i believe there is something like __declspec(dllexport) but i do not know how to use it. Here is my code.

    Code:
    using System;using System.Collections.Generic;
    using System.Text;
    using Microsoft.Web.Services3.Security.Tokens;
    using Microsoft.Web.Services3.Security;
    using Microsoft.Web.Services3;
    using System.Web.Services;
    using System.Web.Services.Protocols;
    
    
    namespace ClassLibrarySetupProcess
    {
        public class Class1
        {
            public string callSetup(string msisdn, string contractid, string customerid, string accountind, string customercode)
            {
                DateTime dt = DateTime.Now;
    
    
                string datestr = String.Format("{0:yyMMddHHmmss}", dt);
    
    
               SetupService.SetupServiceService x = new  SetupService.SetupServiceService();
                SoapContext mycon = x.RequestSoapContext;
                UsernameToken tok = new UsernameToken("MGR1", "mg01Ch", PasswordOption.SendHashed);
    
    
                mycon.Security.Tokens.Add(tok);
                x.Dispose();
    
    
                SetupService.SetupServiceRequest mpInput = new SetupService.SetupServiceRequest();
                mpInput .ReferenceID = datestr + msisdn;
                mpInput .ChannelID = "CSSMBT";
                mpInput .ChannelMedia = "TTIVR";
                mpInput .TicklerIndicator = "2";
                mpInput .MSISDN = msisdn;
                mpInput .ContractID = contractid;
                mpInput .CustomerID = customerid;
                mpInput .CustomerCode = customercode;
                mpInput .AccountIndicator = accountind;
                mpInput .TicklerCode = "MBTFTP";
                mpInput .TicklerStatus = "NOTE";
                mpInput .TicklerShortDesc = "CLOVA VIA IVR";
                mpInput .TicklerLongDesc = "Temporary Unavailable";
                mpInput .TicklerPriority = "5";
    
    
    
    
    
    
                SetupService.SetupServiceResponse wseOutput = x.SetupService(wseInput);
    
    
                return mpInput.TransactionID + "|" + mpInput.ReferenceID + "|" + mpInput.ResultStatus.StatusCode + "|" + mpInput.ResultStatus.ErrorCode + "|" + mpInput.ResultStatus.ErrorDescription;
    
    
    
    
            }
        }
    }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    So do you have an attempt at writing the C++ equivalent code?

    Because most of it seems to be a lot of simple string manipulation, which you ought to be able to have a stab at doing yourself.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Nov 2011
    Posts
    2
    yeah i were trying to write in C++ using visual studio 2005..but i have no idea hows the C++ works o.O

    new project > Class Library' project or 'Win32 Console -> DLL' project? What .h file used for? and where should I put the __declspec(dllexport)? could somebody help guide me please...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Comment each line and convert this C++ OOP code into C++ code.
    By Shayaan_Mustafa in forum C++ Programming
    Replies: 3
    Last Post: 01-03-2011, 01:23 PM
  2. Convert ASM to C Code
    By clag in forum C Programming
    Replies: 2
    Last Post: 01-28-2010, 03:48 AM
  3. Convert a.out back to C code??
    By Rob4226 in forum C Programming
    Replies: 3
    Last Post: 09-16-2009, 10:33 PM
  4. convert vb.net code to C#
    By Nyoud33 in forum C# Programming
    Replies: 3
    Last Post: 01-11-2009, 03:29 PM
  5. Replies: 14
    Last Post: 04-01-2008, 02:23 AM