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

Managed C++/CLI

 
GeneralRe: Passing a C# string to C++/CLI does not show up from a CPP program Pin
Richard MacCutchan29-Mar-13 23:00
mveRichard MacCutchan29-Mar-13 23:00 
AnswerRe: Passing a C# string to C++/CLI does not show up from a CPP program Pin
jschell30-Mar-13 13:33
jschell30-Mar-13 13:33 
QuestionDidn't Understand to logic of calculation of this program.? Pin
Taqi_Shah11-Mar-13 7:26
Taqi_Shah11-Mar-13 7:26 
AnswerRe: Didn't Understand to logic of calculation of this program.? Pin
NotPolitcallyCorrect11-Mar-13 7:55
NotPolitcallyCorrect11-Mar-13 7:55 
SuggestionRe: Didn't Understand to logic of calculation of this program.? Pin
MicroVirus13-Mar-13 12:16
MicroVirus13-Mar-13 12:16 
QuestionNeed Urgent Help!! Pin
Member 933160011-Mar-13 2:18
Member 933160011-Mar-13 2:18 
AnswerRe: Need Urgent Help!! Pin
Marco Bertschi14-Mar-13 10:36
protectorMarco Bertschi14-Mar-13 10:36 
Questionhow to call vcvarsall.bat with Process::Start method? Pin
aupres8-Mar-13 23:43
aupres8-Mar-13 23:43 
I try to invoke oracle pro*c in C++/CLI project. This is my sample code.

#include "stdafx.h"

using namespace System;
using namespace System::IO;
using namespace System::Diagnostics;


void call_Process (ProcessStartInfo^ info) {

try {

Process^ exeP = Process::Start(info);
StreamReader^ reader = exeP->StandardOutput;
String^ result = reader->ReadToEnd();

Console::Write(result);
Console::ReadLine();
}
catch(Exception^ e) {
Console::WriteLine(e->Message);
Console::ReadLine();
}
}

int main(array<system::string ^=""> ^args)
{
ProcessStartInfo^ pStartInfo = gcnew ProcessStartInfo();

pStartInfo->UseShellExecute = false;
pStartInfo->RedirectStandardOutput = true;
pStartInfo->WindowStyle = ProcessWindowStyle::Hidden;

pStartInfo->FileName = "\"C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\vcvarsall.bat\"";
pStartInfo->Arguments = "x64";

call_Process(pStartInfo);

pStartInfo->FileName = "proc.exe";
pStartInfo->Arguments = "oracle_connect.pc";

call_Process(pStartInfo);

pStartInfo->FileName = "\"C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\bin\\amd64\\cl.exe\"";
String^ arg1 = " /I C:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\precomp\\public";
String^ arg2 = " /link C:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\precomp\\LIB\\ORASQL11.LIB";
pStartInfo->Arguments = arg1 + " oracle_connect.c" + arg2;

call_Process(pStartInfo); // throws exception.

pStartInfo->FileName = "oracle_connect.exe";

call_Process(pStartInfo);

return 0;
}

When I type in ,call vcvarsall.bat in command prompt window myself and run this codes, it works. No exception. But when I run this code in another command prompt window without calling vcvarsall.bat, it throws exception. Calling vcvarsall.bat with Process::Start method doesn't work!

Pls, advise me how to call vcvarsall.bat with Process::Start method. Thanks in advance.
Best Regards!
Joseph Hwang

AnswerRe: how to call vcvarsall.bat with Process::Start method? Pin
NotPolitcallyCorrect9-Mar-13 3:06
NotPolitcallyCorrect9-Mar-13 3:06 
GeneralRe: how to call vcvarsall.bat with Process::Start method? Pin
aupres9-Mar-13 13:09
aupres9-Mar-13 13:09 
AnswerRe: how to call vcvarsall.bat with Process::Start method? Pin
Richard MacCutchan9-Mar-13 22:46
mveRichard MacCutchan9-Mar-13 22:46 
Questioncandidate function not accessible Pin
bonosa1-Mar-13 17:35
bonosa1-Mar-13 17:35 
AnswerRe: candidate function not accessible Pin
Richard MacCutchan2-Mar-13 0:01
mveRichard MacCutchan2-Mar-13 0:01 
GeneralRe: candidate function not accessible Pin
bonosa2-Mar-13 7:59
bonosa2-Mar-13 7:59 
GeneralRe: candidate function not accessible Pin
Richard MacCutchan2-Mar-13 9:13
mveRichard MacCutchan2-Mar-13 9:13 
Questionsqrt() function strange behavouir Pin
Amrit Agr28-Feb-13 23:44
Amrit Agr28-Feb-13 23:44 
AnswerRe: sqrt() function strange behavouir Pin
Richard MacCutchan1-Mar-13 0:56
mveRichard MacCutchan1-Mar-13 0:56 
Questionbatch files Pin
Dirquez Marquez20-Feb-13 22:42
Dirquez Marquez20-Feb-13 22:42 
AnswerRe: batch files Pin
Richard MacCutchan20-Feb-13 22:57
mveRichard MacCutchan20-Feb-13 22:57 
GeneralRe: batch files Pin
Dirquez Marquez20-Feb-13 23:11
Dirquez Marquez20-Feb-13 23:11 
GeneralRe: batch files Pin
Richard MacCutchan20-Feb-13 23:53
mveRichard MacCutchan20-Feb-13 23:53 
GeneralRe: batch files Pin
Dirquez Marquez21-Feb-13 20:24
Dirquez Marquez21-Feb-13 20:24 
GeneralRe: batch files Pin
Richard MacCutchan21-Feb-13 22:36
mveRichard MacCutchan21-Feb-13 22:36 
GeneralRe: batch files Pin
Dirquez Marquez22-Feb-13 2:58
Dirquez Marquez22-Feb-13 2:58 
QuestionWhat is the CLI/C++ equivalent to the C# using statement Pin
SujayG14-Feb-13 21:54
SujayG14-Feb-13 21:54 

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.