Click here to Skip to main content
15,904,416 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionT-SQL using Sql server Pin
maheesh22-Jan-09 2:29
maheesh22-Jan-09 2:29 
AnswerRe: T-SQL using Sql server Pin
led mike22-Jan-09 4:35
led mike22-Jan-09 4:35 
QuestionAbout T-SQL Pin
maheesh22-Jan-09 2:28
maheesh22-Jan-09 2:28 
Questioncan play video file in visual c++ window form? [modified] Pin
sai5621-Jan-09 3:01
sai5621-Jan-09 3:01 
AnswerRe: can play video file in visual c++ window form? Pin
Mark Salsbery21-Jan-09 5:38
Mark Salsbery21-Jan-09 5:38 
GeneralRe: can play video file in visual c++ window form? Pin
sai5626-Jan-09 22:58
sai5626-Jan-09 22:58 
GeneralRe: can play video file in visual c++ window form? Pin
Mark Salsbery27-Jan-09 5:55
Mark Salsbery27-Jan-09 5:55 
QuestionStreamWriter and char array [modified] Pin
staticv20-Jan-09 5:32
staticv20-Jan-09 5:32 
#include "stdafx.h"

using namespace System;
using namespace System::Net;
using namespace System::Net::Sockets;
using namespace System::IO;
using namespace System::Text;

void main(void)
{
	Stream^ fS = gcnew FileStream("D:\\TextOut.txt", FileMode::Create, FileAccess::Write);

	StreamWriter^ sWriter = gcnew StreamWriter(fS);

	Console::WriteLine("Encoding type : " + sWriter->Encoding->ToString());

	Console::WriteLine("Format Provider : " + sWriter->FormatProvider->ToString());

	sWriter->WriteLine("Today is {0}", DateTime::Today.DayOfWeek);
	sWriter->WriteLine("Today we will mostly be using StreamWriter");

	for (int i = 0; i < 5; i++)
		sWriter->WriteLine("Value {0}, its square is {1}", i, i * i);

	sWriter->Write("Arrays can be written : ");
	// here if I declare the array as 'array<char>', then comes an error
	array<system::char xmlns:system="#unknown">^ myArray = gcnew array<system::char>(5) { 'a', 'r', 'r', 'a', 'y' };

	sWriter->Write(myArray);
	sWriter->WriteLine("\r\nAnd parts of arrays can be written too");
	// the error comes up here
	sWriter->Write(myArray, 0, 3);

	sWriter->Close();
	fS->Close();
}</system::char></system::char></char>


The error is
error C2664: 'void System::IO::TextWriter::Write(cli::array<type,dimension> ^,int,int)' :
 cannot convert parameter 1 from 'cli::array<type> ^' to 'cli::array<type,dimension> ^'.</type>



If I declare the array as array<char>, I get errors. But when I declare it as Char, there isn't any error.

And there is one more thing,

the Write() method for StreamWriter have only four overloads (the IntelliSense only shows four), but in MSDN it shows more than it 17... Why whats wrong here?


For instance, there is a Write() StreamWriter.Write Method (System.IO) method that takes a Boolean parameter, but when I write the following statement it generates an error
sWriter->Write(true);

Writes a  Laugh | :laugh:

Top Web Hosting Providers[^]

Do, or do not. There is no 'try'.

modified on Tuesday, January 20, 2009 11:45 AM

AnswerRe: StreamWriter and char array Pin
led mike20-Jan-09 6:04
led mike20-Jan-09 6:04 
AnswerRe: StreamWriter and char array Pin
George L. Jackson21-Jan-09 7:26
George L. Jackson21-Jan-09 7:26 
QuestionSql server 2005 connection through VC++ Pin
maheesh19-Jan-09 17:38
maheesh19-Jan-09 17:38 
AnswerRe: Sql server 2005 connection through VC++ Pin
N a v a n e e t h19-Jan-09 22:03
N a v a n e e t h19-Jan-09 22:03 
GeneralRe: Sql server 2005 connection through VC++ Pin
maheesh22-Jan-09 2:26
maheesh22-Jan-09 2:26 
QuestionHow to open ms excel 2007 file in VC++ Pin
maheesh19-Jan-09 0:17
maheesh19-Jan-09 0:17 
AnswerRe: How to open ms excel 2007 file in VC++ Pin
staticv19-Jan-09 4:46
staticv19-Jan-09 4:46 
Questionwinsock not sending udp packet form multithreaded app.. Pin
IKoB18-Jan-09 11:49
IKoB18-Jan-09 11:49 
AnswerRe: winsock not sending udp packet form multithreaded app.. Pin
Christian Graus18-Jan-09 13:22
protectorChristian Graus18-Jan-09 13:22 
GeneralRe: winsock not sending udp packet form multithreaded app.. Pin
IKoB19-Jan-09 0:00
IKoB19-Jan-09 0:00 
GeneralRe: winsock not sending udp packet form multithreaded app.. Pin
N a v a n e e t h19-Jan-09 22:02
N a v a n e e t h19-Jan-09 22:02 
GeneralRe: winsock not sending udp packet form multithreaded app.. Pin
Mark Salsbery20-Jan-09 5:14
Mark Salsbery20-Jan-09 5:14 
QuestionProgramming over internet Pin
dSolariuM18-Jan-09 2:54
dSolariuM18-Jan-09 2:54 
Questionnetwork programming Pin
staticv16-Jan-09 8:07
staticv16-Jan-09 8:07 
AnswerRe: network programming Pin
N a v a n e e t h16-Jan-09 15:47
N a v a n e e t h16-Jan-09 15:47 
GeneralRe: network programming Pin
staticv16-Jan-09 20:23
staticv16-Jan-09 20:23 
GeneralRe: network programming Pin
Tony Pottier17-Feb-09 4:31
Tony Pottier17-Feb-09 4:31 

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.