|
|
Hi,
I have a dll written in C# that works well when i use it in .net environment. i need to load it from unmanaged code. according to MSDN documents i have used "REGASM /tlb.... " and "GACUTIL /i ..." for calling managed code from unmanaged code. it worked in some of my samples. but unfortunately i have an odd problem now.
i have created an OCX control in VB (not vb.net) an i called some functions of my managed DLL. when the managed function is called, it doesn't works completely well. i mean some of processes in managed code work well but some others don't work well. for example where i use RASCryptoServiceProvider Class it fails. the odd thing is that this dll works perfect when i call it from .net environment.
it has taken a lot of time from me. do you have any advice? HELP!
thanks
ps: there is no data passed between managed and unmanaged code then i thins it is not a subject of marshaling
|
|
|
|
|
This is the managed C++ board. You may want to post this question on the Visual Basic board[^].
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
hi again,
i want to transfer my code from console to form application.
for console:
void main(int argc, char *argv[])
{
//variables here...
}
for form:
btnConnect_Click(System::Object^ sender, System::EventArgs^ e)
{
}
//how to put in the code of argc and argv[]
******************************
to know
everything
is to know
yourself...
|
|
|
|
|
The arguments are passed in to your main method, if they are passed in at all. I thought they were, they sure are long gone by the time you get to a button event.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Hi all,
I have read the article on MSDN about Redistributing Visual C++ Files, but was left wondering whether there isn't another way of compiling ones application (fiddling in the project properties or something) so that it can run on another computer (without having to run any of the Microsoft Visual C++ 2005 Redistributable Packages) ??
Many Thanks
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Sure, try Googling: Fiddle with Project Properties
Seriously though, you can't avoid installing the C Runtime library but most of the others (MFC, ATL, etc.) can be statically linked by "fiddling".
|
|
|
|
|
You can link statically to the dlls, which makes your app bigger, as it will copy them into your exe.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi everyone,
i have a problem, i want to convert string to character array. heres is the scenario:
char *echostring;
char ip[RCVBUFSIZE]; //32
ip =txtIpAdd->Text; //textbox
echostring = ip //<--- cause an error,it says, cannot
convert string to char[32]
thanks in advance,
jeof
******************************
to know
everything
is to know
yourself...
|
|
|
|
|
This normally works for me
char* echostring = (char*)Marshal::StringToHGlobalAnsi(ip).ToPointer();
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
you would have to point to ip[0] or &ip
echostring = ip[0];// << this will make it be the address of the first position[0] of the string same as &ip.
by the way this is for C++.
|
|
|
|
|
echostring = ip;
is fine.
The error is here:
ip = txtIpAdd->Text; //textbox
You can't do that
As programm3r mentioned, something like this should work:
char *echostring;
char ip[RCVBUFSIZE]; //32
const char *chars = (const char *)(void *)Marshal::StringToHGlobalAnsi(txtIpAdd->Text);
strncpy(ip, chars, RCVBUFSIZE);
Marshal::FreeHGlobal(System::IntPtr((void*)chars));
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hello,
I converted VS2003 code to VS2005 (C++, C#).
I try to use DLLs which use: System::Runtime::InteropServices.
Do you know if it is OK? I got runtime error...
Thanks!
|
|
|
|
|
Tal S. wrote: Do you know if it is OK? I got runtime error...
You're not giving us much to work with
I'm going to guess it's not ok, since you get a runtime error.
Does debugging yield any clues?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hello, I work with visual studio 2005, VC++ Managed, I want to carry out a reading of a document .TXT, and to post it in a list view or other, I want by exemle to post that the 10 line 1st. Thank you enormously.
|
|
|
|
|
Have a look at StreamReader class
|
|
|
|
|
Where is the StreamReader class,
Thank you verry mutch.
|
|
|
|
|
In the System.IO namespace
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
|
Firstly, this is incorrect forum. You should have posted this here: http://www.codeproject.com/script/comments/forums.asp?forumid=1647
Secondly, here is answer to your question:
GetProcAddress()[^]
|
|
|
|
|
hi friend i want souece code of polynomial program (add,multipy,..two polynomial) and also need the source code of aoe network in graphs and source code of winner tree program please help me as soon as possible.
Sincerely yours
|
|
|
|
|
My contract rate is > $100 an hour. Alternatively, you can do your own homework, and then I'll help for free, when you ask specific questions that show you've done somethig yourself.
I suspect you meant to post this in the Visual C++ forum.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I am using sendASPI32Command for writing data to CD. But for a particular size of data sendASPI32Command returns SS_ASPI_IS_BUSY error. The error occurs when writes the last track data.
Could u pls tell in which condition this case occurs.Please help..........
Ajay
AJay
|
|
|
|
|
Have you tried MSDN ? This doesn't look like a C++/CLI question to me, have you tried the visual C++ forum ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|