|
|
Thanks for the link. I have created the manged DLL , without errors. I want to call this DLL from native C++ applicaton . Please help me with a step by step process how can I do it .
|
|
|
|
|
sujayg wrote: Please help me with a step by step process how can I do it . Sorry, I don't have one, you will have to figure it out from the documentation and articles on the subject. I still do not understand what you are trying to achieve here, calling managed code from unmanaged is not such a simple matter.
Use the best guess
|
|
|
|
|
It isn't clear if there is a real business problem here but mixed mode programming can often be tricky.
So it is easier to just not do it.
Instead
1. Create a executable of the targeted functionality.
2. Provide an management API for that: sockets, files or std io.
3. Use the client application to manage a "process" to run the above executable.
4. The client application uses the management api to produce the desired functionality.
The advantage to this is that both pieces, with care, can be tested independently and debugged independently as well. And the target functionality cannot take done the client application should it fail in a catastrophic way.
|
|
|
|
|
when <b>1</b> is given as input following program shows <b>b</b> as output why is that so I know that 1 given to char is manipulated differently but how it's being manipulated please explain.
#include <conio.h>
#include <iostream>
using namespace std;
int main()
{
char ch;
cout<<"enter ch ";
cin>>ch;
ch=ch*2;
cout<<ch;
getch();
return 0;
}
|
|
|
|
|
Taqi_Shah wrote: 1
Taqi_Shah wrote: ch=ch*2;
1 on the ASCII chart is 49
49 * 2 = 98
98 on the ASCII chart is b
|
|
|
|
|
|
Please refer to
http://www.codeproject.com/Articles/14462/Build-your-own-cryptographically-safe-server-clien
Can anyone tell me how to show final encrypted message at both sender and receiving end(client and server)?
please help me,i am not good at coding in vc++!!
Thanks in advance!!
|
|
|
|
|
Member 9331600 wrote: http://www.codeproject.com/Articles/14462/Build-your-own-cryptographically-safe-server-clien
You have already asked the question there. I kindly ask you to not create cross-posts. If the author is still active on CP he will see your question there and answer it. If not you can delete the post in the comments there and ask your question in the Q&A section.
|
|
|
|
|
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
|
|
|
|
|
aupres wrote: it throws exception
And what exception is it that it is throwing?
|
|
|
|
|
The source can't include stdio.h file. When vcvarsall.bat executed in command prompt window in advanced and environment set, #include stdio.h throws no exception.
Joseph Hwang
|
|
|
|
|
You cannot execute these processes independently in this way. vcvarsall.bat needs to be called in the same environment that the compiler will be called. You need to create a new batch file that contains all the commands that you wish to run, and execute that batch file.
Use the best guess
|
|
|
|
|
already tried #pragma make public (mynativestruct)
Here is my c++-cli code
ClassLibraryAT::Class1^ matClass = gcnew ClassLibraryAT::Class1() ;
matClass->M_AT(&cparams,&input,&numcontacts,&contact,&ecdata);
the 'input' struct in the argument list is comprised of ints doubles, stuff like that. Not a managed struct. It's saying the candidate function M_AT is not accessible. How do I resolve this? thanks, sb
|
|
|
|
|
bonosa wrote: It's saying the candidate function M_AT is not accessible. How do I resolve this? Make sure that M_AT is a public method.
Use the best guess
|
|
|
|
|
thanks Richard. It is a public method and shows up in the intellisense.
|
|
|
|
|
I'm afraid that tells us nothing; try looking at the actual class definition or documentation.
Use the best guess
|
|
|
|
|
hi Developers,
I am trying to get the result of this code
printf( "sqrt(36.0) = %f", sqrt(36.0) );
The mystry is that, If i have include math.h file, than I am getting proper result, bu I haven't, I am getting the result 0.000000
can you please help me out
Thanks
Amrit Agrawal
|
|
|
|
|
I just tried without including math.h and it works fine. Try seeing what the actual definition of sqrt is when you have not included the header.
Use the best guess
|
|
|
|
|
Hello y'all...I am want to use IO stream redirection to reuse my previous program to calculate and equation from batch file...Can U help me on how am I to use this io stream to reuse my program
|
|
|
|
|
Your question is not very clear, please explain your problem in more detail.
|
|
|
|
|
I developed a program to convert celcius to kelvin and one to convert kelvin to Fahrenheit...now what I want to do is convert celcius to Fahrenheit reusing my programs with IO stream redirection,with input and output on batch files...clear?
|
|
|
|
|
Why not just do everything in one single program using a class to do the conversions?
|
|
|
|
|
aint gonna get an exception error thrown at me for trying different methods am I?but thanks anyway
|
|
|
|
|
Dirquez Marquez wrote: aint gonna get an exception error thrown at me for trying different methods am I?
|
|
|
|