Click here to Skip to main content
12,063,909 members (60,194 online)

Managed C++/CLI

 
GeneralRe: Passing a C# string to C++/CLI does not show up from a CPP program Pin
Richard MacCutchan27-Mar-13 4:58
mvpRichard MacCutchan27-Mar-13 4:58 
GeneralRe: Passing a C# string to C++/CLI does not show up from a CPP program Pin
sujayg27-Mar-13 5:11
membersujayg27-Mar-13 5:11 
GeneralRe: Passing a C# string to C++/CLI does not show up from a CPP program Pin
Richard MacCutchan27-Mar-13 5:19
mvpRichard MacCutchan27-Mar-13 5:19 
GeneralRe: Passing a C# string to C++/CLI does not show up from a CPP program Pin
sujayg27-Mar-13 5:52
membersujayg27-Mar-13 5:52 
GeneralRe: Passing a C# string to C++/CLI does not show up from a CPP program Pin
Richard MacCutchan27-Mar-13 6:03
mvpRichard MacCutchan27-Mar-13 6:03 
GeneralRe: Passing a C# string to C++/CLI does not show up from a CPP program Pin
sujayg29-Mar-13 20:09
membersujayg29-Mar-13 20:09 
GeneralRe: Passing a C# string to C++/CLI does not show up from a CPP program Pin
Richard MacCutchan30-Mar-13 0:00
mvpRichard MacCutchan30-Mar-13 0:00 
AnswerRe: Passing a C# string to C++/CLI does not show up from a CPP program Pin
jschell30-Mar-13 14:33
memberjschell30-Mar-13 14:33 
QuestionDidn't Understand to logic of calculation of this program.? Pin
Taqi_Shah11-Mar-13 8:26
memberTaqi_Shah11-Mar-13 8:26 
AnswerRe: Didn't Understand to logic of calculation of this program.? Pin
ThePhantomUpvoter11-Mar-13 8:55
memberThePhantomUpvoter11-Mar-13 8:55 
SuggestionRe: Didn't Understand to logic of calculation of this program.? Pin
MicroVirus13-Mar-13 13:16
memberMicroVirus13-Mar-13 13:16 
QuestionNeed Urgent Help!! Pin
Member 933160011-Mar-13 3:18
memberMember 933160011-Mar-13 3:18 
AnswerRe: Need Urgent Help!! Pin
Marco Bertschi14-Mar-13 11:36
memberMarco Bertschi14-Mar-13 11:36 
Questionhow to call vcvarsall.bat with Process::Start method? Pin
aupres9-Mar-13 0:43
memberaupres9-Mar-13 0: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 ^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
ThePhantomUpvoter9-Mar-13 4:06
memberThePhantomUpvoter9-Mar-13 4:06 
GeneralRe: how to call vcvarsall.bat with Process::Start method? Pin
aupres9-Mar-13 14:09
memberaupres9-Mar-13 14:09 
AnswerRe: how to call vcvarsall.bat with Process::Start method? Pin
Richard MacCutchan9-Mar-13 23:46
mvpRichard MacCutchan9-Mar-13 23:46 
Questioncandidate function not accessible Pin
bonosa1-Mar-13 18:35
memberbonosa1-Mar-13 18:35 
AnswerRe: candidate function not accessible Pin
Richard MacCutchan2-Mar-13 1:01
mvpRichard MacCutchan2-Mar-13 1:01 
GeneralRe: candidate function not accessible Pin
bonosa2-Mar-13 8:59
memberbonosa2-Mar-13 8:59 
GeneralRe: candidate function not accessible Pin
Richard MacCutchan2-Mar-13 10:13
mvpRichard MacCutchan2-Mar-13 10:13 
Questionsqrt() function strange behavouir Pin
Amrit Agr1-Mar-13 0:44
memberAmrit Agr1-Mar-13 0:44 
AnswerRe: sqrt() function strange behavouir Pin
Richard MacCutchan1-Mar-13 1:56
mvpRichard MacCutchan1-Mar-13 1:56 
Questionbatch files Pin
Member 981569020-Feb-13 23:42
memberMember 981569020-Feb-13 23:42 
AnswerRe: batch files Pin
Richard MacCutchan20-Feb-13 23:57
mvpRichard MacCutchan20-Feb-13 23:57 
GeneralRe: batch files Pin
Member 981569021-Feb-13 0:11
memberMember 981569021-Feb-13 0:11 
GeneralRe: batch files Pin
Richard MacCutchan21-Feb-13 0:53
mvpRichard MacCutchan21-Feb-13 0:53 
GeneralRe: batch files Pin
Dirquez Marquez21-Feb-13 21:24
memberDirquez Marquez21-Feb-13 21:24 
GeneralRe: batch files Pin
Richard MacCutchan21-Feb-13 23:36
mvpRichard MacCutchan21-Feb-13 23:36 
GeneralRe: batch files Pin
Dirquez Marquez22-Feb-13 3:58
memberDirquez Marquez22-Feb-13 3:58 
QuestionWhat is the CLI/C++ equivalent to the C# using statement Pin
sujayg14-Feb-13 22:54
membersujayg14-Feb-13 22:54 
AnswerRe: What is the CLI/C++ equivalent to the C# using statement Pin
John Schroedl15-Feb-13 4:27
memberJohn Schroedl15-Feb-13 4:27 
QuestionStructures with using bit fields Pin
Amrit Agr29-Jan-13 2:34
memberAmrit Agr29-Jan-13 2:34 
AnswerRe: Structures with using bit fields Pin
Richard MacCutchan29-Jan-13 4:38
mvpRichard MacCutchan29-Jan-13 4:38 
GeneralRe: Structures with using bit fields Pin
Amrit Agr17-Feb-13 23:06
memberAmrit Agr17-Feb-13 23:06 
Questionsopen() function in filehandling - "C" Pin
Amrit Agr28-Jan-13 1:56
memberAmrit Agr28-Jan-13 1:56 
AnswerRe: sopen() function in filehandling - "C" Pin
John Schroedl28-Jan-13 4:37
memberJohn Schroedl28-Jan-13 4:37 
AnswerRe: sopen() function in filehandling - "C" Pin
ramrooney27-Mar-13 8:36
memberramrooney27-Mar-13 8:36 
QuestionHow to call a static libray in a dll? Pin
LongFangFang21-Jan-13 20:38
memberLongFangFang21-Jan-13 20:38 
AnswerRe: How to call a static libray in a dll? Pin
Richard MacCutchan21-Jan-13 23:32
mvpRichard MacCutchan21-Jan-13 23:32 
Questionfrom unmanaged c++ to managed: passing int& parameter Pin
acastrucc19-Dec-12 5:30
memberacastrucc19-Dec-12 5:30 
QuestionCompilation Problem Pin
tcnm12-Dec-12 10:18
membertcnm12-Dec-12 10:18 
QuestionRe: Compilation Problem Pin
Richard MacCutchan12-Dec-12 23:56
mvpRichard MacCutchan12-Dec-12 23:56 
Answer-Re: Compilation Problem Pin
tcnm14-Dec-12 7:42
membertcnm14-Dec-12 7:42 
GeneralRe: -Re: Compilation Problem Pin
Richard MacCutchan14-Dec-12 22:43
mvpRichard MacCutchan14-Dec-12 22:43 
QuestionWhy c is so important? Pin
riceshoots10-Dec-12 5:47
memberriceshoots10-Dec-12 5:47 
AnswerRe: Why c is so important? Pin
Richard MacCutchan10-Dec-12 6:52
mvpRichard MacCutchan10-Dec-12 6:52 
QuestionPlease vote for C++/CLI debug visualizer support Pin
John Schroedl7-Dec-12 5:25
memberJohn Schroedl7-Dec-12 5:25 
QuestionHow to use NTGraph3D Activex Control in Visual Studio 2010. Pin
DhrumilS23-Nov-12 1:47
memberDhrumilS23-Nov-12 1:47 
AnswerRe: How to use NTGraph3D Activex Control in Visual Studio 2010. Pin
Richard MacCutchan23-Nov-12 2:44
mvpRichard MacCutchan23-Nov-12 2:44 

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.


Advertise | Privacy | Mobile
Web03 | 2.8.160204.4 | Last Updated 7 Jan 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid