Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. C++ Problems...

C++ Problems...

Scheduled Pinned Locked Moved Managed C++/CLI
c++help
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AndrewVos
    wrote on last edited by
    #1

    Hey... Im trying to use a small bit of c++ code but have never done a line of it in my life. I am looking for some help porting it into something readable. Doesn't have to be another language, I just need an explanation on whats going on. I would learn some cpp myself but honestly I really don't have the time. Any help would be greatly appreciated. Thanks

    J T 2 Replies Last reply
    0
    • A AndrewVos

      Hey... Im trying to use a small bit of c++ code but have never done a line of it in my life. I am looking for some help porting it into something readable. Doesn't have to be another language, I just need an explanation on whats going on. I would learn some cpp myself but honestly I really don't have the time. Any help would be greatly appreciated. Thanks

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      Ok...perhaps you could post the code here? Otherwise we cannot offer an explanation of it.

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: Cops & Robbers Judah Himango

      A 1 Reply Last reply
      0
      • J Judah Gabriel Himango

        Ok...perhaps you could post the code here? Otherwise we cannot offer an explanation of it.

        Tech, life, family, faith: Give me a visit. I'm currently blogging about: Cops & Robbers Judah Himango

        A Offline
        A Offline
        AndrewVos
        wrote on last edited by
        #3

        Cool, didnt get an email notifying me of a response.. sorry it took so long. Heres the code. Its from a Microsoft sample app for creating a voice font, for SAPI. /****************************************************************************** * mkvoice.cpp * *-------------* * This application assembles a simple voice font for the sample TTS engine. *Copyright (c) Microsoft Corporation. All rights reserved. * ******************************************************************************/ #include "stdafx.h" #include #include int wmain(int argc, WCHAR* argv[]) { USES_CONVERSION; static const DWORD dwVersion = { 1 }; ULONG ulNumWords = 0; HRESULT hr = S_OK; //--- Check args if( argc != 4 ) { printf( "%s", "Usage: > mkvoice [[in]word list file] [[out]voice file] [voice name]\n" ); hr = E_INVALIDARG; } else { ::CoInitialize( NULL ); //--- Open word list file and create output voice file //--- _wfopen is not supported on Win9x, so use fopen. FILE* hWordList = fopen( W2A(argv[1]), "r" ); FILE* hVoiceFile = fopen( W2A(argv[2]), "wb" ); if( hWordList && hVoiceFile ) { //--- Write file version and leave space for word count if( !fwrite( &dwVersion, sizeof(dwVersion), 1, hVoiceFile ) || fseek( hVoiceFile, 4, SEEK_CUR ) ) { hr = E_FAIL; } //--- Get each entry WCHAR WordFileName[MAX_PATH]; while( SUCCEEDED( hr ) && fgetws( WordFileName, MAX_PATH, hWordList ) ) { ULONG ulTextLen = wcslen( WordFileName ); if( WordFileName[ulTextLen-1] == '\n' ) { WordFileName[--ulTextLen] = NULL; } //--- Include NULL character when writing to the file ulTextLen = (ulTextLen+1) * sizeof(WCHAR); if( fwrite( &ulTextLen, sizeof(ulTextLen), 1, hVoiceFile ) && fwrite( WordFileName, ulTextLen, 1, hVoiceFile ) ) { ++ulNumWords; //--- Open the wav data ISpStream* pStream; wcscat( WordFileName, L".wav" ); hr = SPBindToFile( WordFileName, SPFM_OPEN_READONLY, &pStream ); if( SUCCEEDED( hr ) ) {

        1 Reply Last reply
        0
        • A AndrewVos

          Hey... Im trying to use a small bit of c++ code but have never done a line of it in my life. I am looking for some help porting it into something readable. Doesn't have to be another language, I just need an explanation on whats going on. I would learn some cpp myself but honestly I really don't have the time. Any help would be greatly appreciated. Thanks

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          if you want to learn C++, don't use this example !!!! start with the basics, then start learnin at some libraries (Win32, MFC, ATL, ...), and only then, you could read some advanced examples like that.


          TOXCCT >>> GEII power
          [toxcct][VisualCalc]

          A 1 Reply Last reply
          0
          • T toxcct

            if you want to learn C++, don't use this example !!!! start with the basics, then start learnin at some libraries (Win32, MFC, ATL, ...), and only then, you could read some advanced examples like that.


            TOXCCT >>> GEII power
            [toxcct][VisualCalc]

            A Offline
            A Offline
            AndrewVos
            wrote on last edited by
            #5

            I don't want to learn C++. I was simply asking if someone could point me in the right direction here as to what exactly this code is doing.

            A 1 Reply Last reply
            0
            • A AndrewVos

              I don't want to learn C++. I was simply asking if someone could point me in the right direction here as to what exactly this code is doing.

              A Offline
              A Offline
              AndrewVos
              wrote on last edited by
              #6

              Basically i just want to change those five or six cpDataKeyAttribs... Maybe I should just compile it, know any free C++ compilers?

              T 1 Reply Last reply
              0
              • A AndrewVos

                Basically i just want to change those five or six cpDataKeyAttribs... Maybe I should just compile it, know any free C++ compilers?

                T Offline
                T Offline
                toxcct
                wrote on last edited by
                #7

                search for gcc and g++ (linux based, but maybe ported to windows plateforms)


                TOXCCT >>> GEII power
                [toxcct][VisualCalc]

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups