Click here to Skip to main content
15,848,407 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Error in RtlZeroMemory Pin
Erudite_Eric5-Dec-11 7:43
Erudite_Eric5-Dec-11 7:43 
QuestionArray Problem. Pin
janaswamy uday2-Dec-11 18:28
janaswamy uday2-Dec-11 18:28 
AnswerRe: Array Problem. Pin
«_Superman_»2-Dec-11 19:22
professional«_Superman_»2-Dec-11 19:22 
AnswerRe: Array Problem. Pin
Richard MacCutchan3-Dec-11 0:14
mveRichard MacCutchan3-Dec-11 0:14 
GeneralRe: Array Problem. Pin
janaswamy uday3-Dec-11 1:18
janaswamy uday3-Dec-11 1:18 
GeneralRe: Array Problem. Pin
Richard MacCutchan3-Dec-11 1:25
mveRichard MacCutchan3-Dec-11 1:25 
AnswerRe: Array Problem. Pin
Addy Tas4-Dec-11 11:08
Addy Tas4-Dec-11 11:08 
Questiongetline Pin
jkirkerx2-Dec-11 12:21
professionaljkirkerx2-Dec-11 12:21 
I can't seem to get the getline, to read a line of text from an open file.
I loaded these .h references

#include "stdafx.h"
#include <stdlib.h>
#include <stdio.h>

#include <atlstr.h>
#include <string.h>
#include <tchar.h>

#pragma warning(disable:4786)
#include <iostream>
#include <fstream>
#include <string>

#include <Commctrl.h>
#include <Windows.h>


C#
// Load the SQL Server Commands
    std::ofstream sqlDBFile;
    sqlDBFile.open (szFilePath);

    // if the file stream opened
    if (sqlDBFile.is_open() ) {

        // While file stream is in memory
        while (sqlDBFile.good() ) {
            // Make a temp sql command buffer
            WCHAR pzSQLCommand[512];

            while (sqlDBFile.good() ) {
                // read the line of text
                WCHAR *szTempLine = NULL;
                getline(sqlDBFile, &szTempLine, '\n');

                // if text != GO, add to buffer
                if ((wcsncmp( szTempLine, L"GO", wcslen(L"GO") )) == 0) {
                    break;
                }
                else {
                    // if text = GO, terminate the buffer and execute the buffered command
                    wcsncat_s(pzSQLCommand, wcslen(pzSQLCommand), szTempLine, wcslen(szTempLine) );
                    pzSQLCommand[wcslen(pzSQLCommand) + 1] = L'\0';
                    hr = pICommandText->SetCommandText( DBGUID_DBSQL, pzSQLCommand );
                    hr = pICommandText->QueryInterface( IID_ICommandProperties, ( void ** ) &pICommandProperties );
                    hr = pICommandText->Execute( NULL, IID_IRowset, NULL, &cRowsAffected, ( IUnknown ** ) &pIRowset );

                }
            }
        }

        // close the sql command file
        sqlDBFile.close();
    }

AnswerRe: getline Pin
Chris Losinger2-Dec-11 12:45
professionalChris Losinger2-Dec-11 12:45 
GeneralRe: getline Pin
jkirkerx2-Dec-11 13:19
professionaljkirkerx2-Dec-11 13:19 
AnswerI'm stuck, not sure which direction to go Pin
jkirkerx2-Dec-11 20:16
professionaljkirkerx2-Dec-11 20:16 
GeneralRe: I'm stuck, not sure which direction to go Pin
Richard MacCutchan3-Dec-11 1:03
mveRichard MacCutchan3-Dec-11 1:03 
GeneralRe: I'm stuck, not sure which direction to go Pin
jkirkerx3-Dec-11 9:00
professionaljkirkerx3-Dec-11 9:00 
GeneralNextline Pin
jkirkerx3-Dec-11 9:26
professionaljkirkerx3-Dec-11 9:26 
GeneralRe: Nextline Pin
Richard MacCutchan3-Dec-11 10:13
mveRichard MacCutchan3-Dec-11 10:13 
Questioni can't load dll builded in debug unicode,what's difference between 'debug' and 'debug unicode'? Pin
Member 77984732-Dec-11 6:06
Member 77984732-Dec-11 6:06 
AnswerRe: i can't load dll builded in debug unicode,what's difference between 'debug' and 'debug unicode'? Pin
JackDingler2-Dec-11 6:19
JackDingler2-Dec-11 6:19 
AnswerRe: i can't load dll builded in debug unicode,what's difference between 'debug' and 'debug unicode'? Pin
Erudite_Eric2-Dec-11 6:44
Erudite_Eric2-Dec-11 6:44 
AnswerRe: i can't load dll builded in debug unicode,what's difference between 'debug' and 'debug unicode'? Pin
Richard MacCutchan2-Dec-11 7:20
mveRichard MacCutchan2-Dec-11 7:20 
Questionclass object as parameter of Template Function Pin
002comp2-Dec-11 1:29
002comp2-Dec-11 1:29 
QuestionRe: class object as parameter of Template Function Pin
CPallini2-Dec-11 1:43
mveCPallini2-Dec-11 1:43 
AnswerRe: class object as parameter of Template Function Pin
002comp2-Dec-11 1:50
002comp2-Dec-11 1:50 
QuestionRe: class object as parameter of Template Function Pin
CPallini2-Dec-11 1:53
mveCPallini2-Dec-11 1:53 
AnswerRe: class object as parameter of Template Function Pin
Chris Losinger2-Dec-11 2:29
professionalChris Losinger2-Dec-11 2:29 
GeneralRe: class object as parameter of Template Function Pin
CPallini2-Dec-11 2:32
mveCPallini2-Dec-11 2:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.