I've been handed a Byte[] that contains a file. I need to pass this to another method that is expecting two parameters, a char* to the beginning of the file and a char* to the end of the file.
I'm assuming I need to pin the array first so it doesn't get collected. I don't imagine I can then just cast the first and last elements, rig...
I'm new to MC++ and have basically no idea what's going on yet.
In trying to get this working i've determined many things that don't work, i'm just looking for one of the ways that will work.
I have a mc++ class as follows that seems to have to be a "ref" class to allow me to see any methods/properties.
public ref class EmCeePlusPlus
{...
NUnit is failing in C++/CLI with a System.IO.FileNotFoundException.
I have tried my own freshly-created project, the C++/CLI sample included with NUnit and the one from CodeProject How to use NUnit to test native C++ code using Visual Studio 2008sp1 with NUnit 2.5.5 as well as 2.4.8. I installed 2.4.8 just on C:\ in case there was somet...
Hi,
I've got a fairly specific problem i've been struggling with for a couple of days.
I'm using a native C++, one of the methods takes a ptr to a struct containing fixed size char arrays.
e.g.
struct userData {
char data1[10];
char data2[10];
};
method:
short AddItem(long id, userData* data);
I'm trying to call to c...
There's another question similar to mine, but I wanted to gather some specifics:
I want to create a DLL that is called from unmanaged code. When the unmanaged functions are called in the DLL, I want to collect information and show it in a kind of form.
What I'd like to do is, when DllMain() is called, and the reason is DLL_PROCESS_A...
Since I upgraded my project to visual studio 2010 project format, my C++/CLI project is targeted to .net framework 4.0.
It is easy to switch the framework version to another version from a C# project, but I have no clue how to do this in a C++/CLI project, I see no setting for this in the project property pages.
...
So I have a regex expression to parse certain parts of a file name. I'm trying to store each part in its own vector until I use it later, but it won't let me. One error I get when I try making a vector of System::String^ is that error C3698: 'System::String ^' : cannot use this type as argument of 'new' Then, when I try just making a vec...
Using C++/CLI and Windows Forms, I'm trying to make a simple scrollable list of labelled text controls as a way of displaying some data fields. I'm having trouble making a TableLayoutPanel scrollable - every combination of properties I've tried seems to result in some really peculiar side effects.
So I have two questions:
Is this the ...
I'm attempting to call a method written in C++/CLI from C#. The C++/CLI code is used to update a TIMESTAMP column in an Oracle database, given a record ID and the System::DateTime object which is the .NET compatible data type for Oracle's TIMESTAMP type.
The method I am calling has the following prototype:
bool ChangeJobUpdateDate (int...
I don't know if I have done anything wrong, but when I try to write code there are no intellisense popups indicating options or errors.
I am creating a CLR/CLI type of project with Microsoft's Visual C++ 2010.
...
Hello:
Without using p/invoke, from a C++/CLI I have succeeded in integrating various methods of a DLL library from a third party built in C.
One of these methods retrieves information from a database and stores it in different structures. The C++/CLI program I wrote reads those structures and stores them in a List<>, which is then ret...
Here is what I'm trying:
typedef cli::array<int> intarray;
int main(){
intarray ^ints = gcnew intarray { 0, 1, 2, 3 };
intarray::Reverse(ints); // C2825, C2039, C3149
return 0;
}
Compilation resulted in the following errors:
.\ints.cpp(46) : error C2825: 'intarray': must be a class or namespace when followed by '::'
...
Hello,
I need to extract the types from PE files.
e.g if whole class exported , I should have all exported methods(whole signature including return type) and their types(i.e class as Type) OR IF whole class not exported but just functions exported, I should be able to get class as Type of those methods and all exported methods of that c...
I have a loop that takes file name from a listbox, performs a system() call, then moves that filename to another listbox. Problem is, it doesn't move the filenames over one at a time, but waits until the entire loop is finished and moves them all at once. What would I do to get it to perform how I want it to?
the loop:
for each( String...
For a large application written in C++ using Visual Studio 6, what is the best way to move into the modern era?
I'd like to take an incremental approach where we slowly move portions of the code and write new features into C# for example and compile that into a library or dll that can be referenced from the legacy application.
Is thi...
Continuing from this question
With each system call, the function constructs a set of parameters and sends them off to another program that is just console-based. Is there a way I can make it so that no console window pops up for each call?
I've done a search but the ones that aren't a linker issue just aren't working for me. For insta...
must you convert from strings to double? if so. how?
Are there functions for trig that will accept textbox string data as is?
Is there a way to pull the data from the textbox as a numeric value, not as a string?
...
Hi all,
my first question here, so please don't be to harsh if something went wrong :)
I'm currently a CS student (from Germany, if this info is of any use ;) ) and we got a, free selectable, programming assignment, which we have to write in a C++/CLI Windows Forms Application.
My team, two others and me, decided to go for a network-co...
I'm Windows developer, I'm using Microsoft visual studio 2008 SP1. My developer machine is 64 bit.
The software I'm currently working on is managed .exe written in C#. Unfortunately, I was unable to solve the whole problem solely in C#. That's why I also developed a small managed DLL in C++/CLI. Both projects are in the same solution.
...
I need to write a Util function (in my c++cli app) that converts a String to a Double or Float or Int.
template<typename T>
static T MyConvert(String^ str) {
return static_cast<T>(System::Convert::ToDouble(str));
}
Is this safe?
Can it somehow convert 2 to 1.999 and then to 1 if I call MyConvert<int>("2") ?
I was wondering why th...