|
BeerFizz,
Sorry, I didn't respond, holiday vacation.
On reading your second message, I too am mystified.
If you compiled your code with the /clr compiler option, then you have created a managed application. If you pasted the DLL into your project directory, the compiler should be referencing it and your Intellisense would be showing you the way.
Did you open the DLL with the IL Disassembler? This is a terrific utility, and it will give you access to all metadata (which is exactly what your compiler does), and you can read through the entire DLL. The DLLs often have a namespace associated with the types defined in the library, and you will have to add a 'using namespace whatever' directive in your code.
Then you merely instantiate the objects you need using the new operator, assigning this to a pointer in your own code. To then call functions and data members of the object, you use the pointer-to-member operator (->).
Once you have instantiated an object, Intellisense should show you all the data and function members available.
It's supposed to be pretty simple.
|
|
|
|
|
The following code compiles fine with Linux g++ compiler but in Visual .Net
generates errors: C2057: expected constant expression
void Sample2(int lenght)
{
char tab[lenght+1]; //C2057
}
void Sample(int lenght)
{
const int size = lenght+1;
char tab[size]; //C2057 ???
}
Is it imposible to declare arrays in function without using new opperator?
Toximus
|
|
|
|
|
I thought you need to use new. You certainly should be asking in the C++ forum.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
There are four guys trying to get home at night and in order to do so, they MUST cross a bridge. It's very dark and there is only one torch available. The bridge can ONLY support "TWO" person at a time. Now, a bomb has been set on the bridge which will explode in 18 mins. Due to the fact that each person's travelling speeds are different, therefore some will obviously take longer to cross than others.
The time that each person takes are as followed:
A = 1 min
B = 2 min
C = 5 min
D = 10 min
Torch = 1 Qty
Here's how it works: If D & A goes first, it'll require 10 mins for them to cross the bridge together. By the time A gets back with the torch to B&C...11 mins will be passed already.
The total time required is : 17 mins
the solution to it is:
A and B first - 2 minutes (max 2 )
A runs back with torch = 3 minutes
C and D Next = 13 minutes ( max 10 )
B comes back with the torch = 15 minutes ( max 5 )
A and B again = 17 minutes
Can anyone tell me the code to this problem in turbo c or vc urgent please. many many thanks in advance.
Babur Khan
|
|
|
|
|
If you tell me the email of your teacher, I'll forward your question there.
|
|
|
|
|
hi everyone
can n e one send me a simple code of creating a server (creating socket, binding, listening, accepting connection ). i need the statements that do it. it wouldn't be hard for guys around here. Code should be in VC .NET
thanx in advance.
Rashid
|
|
|
|
|
When a user types in a sentance, and i want to seperate each word, how do i do i do that. I need to get each word seperatly.
|
|
|
|
|
Frustration!
I am trying to assign the value of a character array ( of type char my_array[99];) to a combo box but am just getting cryptic messages about boxing and __gc / __value.
I know that this should be very simple, I have found many examples using comboBox1->Items->Add(S"some text") but cannot seem to get it to use the contents of my variables
I am using Visual C++ .net
Please help, not much hair left!
-- This is a re-posting, Incorectly posted on the C++ board
|
|
|
|
|
This is really, like you guessed, a simple thing.
You're using Visual C++ .NET, probably to compile a Managed Application, and you've declared a simple char [] array to use with .NET objects and methods.
We all make a similar mistake when first writing a managed app: the char [] is a user-defined type. It is not a CLR type. This means that your char [] is an unmanaged type, and as a consequence, all .NET (I'm oversimplifying here) types and their methods will find this type incompatible, and the compiler will produce error messages.
The cryptic __gc message just tells you to use the "__gc" keyword (this is a Microsoft-specific language keyword) that indicates that the type following is a managed type (garbage collected).
Read this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmxspec/html/vcManagedExtensionsSpec_4_5.asp[^]
You might find this CodeProject article even more helpful:
http://www.codeproject.com/managedcpp/csarrays01.asp[^]
|
|
|
|
|
Thanks for this (I think!)
I have 'hacked' a work around.
I have used an invisible text box
Added my array contents to this
Then used the contents of the text box
I think this is very messy but at least it works
If anyone is interested I will post the work around
Merry Christmas
|
|
|
|
|
Please can some tell me what are the header files required to write a basic C++ and Oracle programme. A sample code would help a lot.
Every is Illusion
|
|
|
|
|
What does this have to do with MC++ ?
There are no headers, you just need a driver for Oracle and ADO.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Anyone know how I would do this? I would think it's something like...
<br />
int myNum = 7424;<br />
String * myNumAsHex = Convert::ToString(myNum, "X");<br />
That doesn't work of course because I think you need to use the IFormatProvider class but I can't seem to use it correctly, any ideas?
|
|
|
|
|
I think you can finish it as the following:
int nNum = 7424;
char szNum[20];
sprintf(szNum, "%x", nNum);
Coding,I love it! MM,I Love it 2!!
|
|
|
|
|
itoa() with radix parameter set 16 will convert to HEX string
See details of itoa()
|
|
|
|
|
Thanks for your suggestions, is there a way to use the .NET framework to do this? Or must I use native code?
|
|
|
|
|
are you sure, you CANT do it , the way you mentioned??
I did something like
byte b = 44;
string str = b.TosTring("X");
and it worked....
|
|
|
|
|
I figured it out, you need to use the Int32 class, AFAIK byte is a value type in MC++ so it couln't have the ToString associated with it.
So it's
<br />
Int32 test = 5432;<br />
String * testStr = test.ToString("X");<br />
|
|
|
|
|
What? Value types derive from System.ValueType which in turn derives from System.Object, so they do have ToString() defined.
Regards
Senthil
|
|
|
|
|
C++/CLI will give C++ programmers first-class access to the CLI platform. Standardizing C++/CLI ensure that the code written by C++ programmers will be portable across the tools offered by multiple vendors.
http://www.orkut.com/Community.aspx?cmm=921513
|
|
|
|
|
Hi fellow developers,
I am new to C++.Net. I move my VC6 projects to C++.Net and one of the project behave a little bit strange. When I invoke the Add Member Variable Wizard for a control in a dialog box, the Control ID is blank and disabled. I suspect some setting has caused this to happened.
Does anybody have any information to fix this problem ?
Thanks for any information.
|
|
|
|
|
Hello,
I'm request some help. See subject.
-=Munchausen=-
http://www.geocities.com/madhousebbs (mostly hungarian, sorry)
|
|
|
|
|
Could someone please give me and example of RegDeleteKey
|
|
|
|
|
|
OK guys well im sorta finished with my final project but i cant get it to work CORRECTLY. The program is to have a menu and ask the user to choose betweetn add, subtract, mult and divide. when they choose whatever one it will ask them a simple question. and if they get the correct answer or wrong answer it will ask them again if they want another problem. If they choose yes then it will give em another problem but if they choose no it will go back to the menu. I cant seem when they enter no it keeps say "enter another seed vaule" I want it to go back to the menu. Well here is the code. O and if they enter anything besides Y or N i need it to say sorry that is an incorrect choice. Here is the code:
#include <iostream>
#include <iomanip>
#include <cstdlib>
using namespace std;
int main()
{
int choice; float num1, num2, answer, correct;
char again;
unsigned seed;
do
{
cout << "\n\t\tSimple Math Tutor Menu\n\n";
cout << "1. Addition\n";
cout << "2. Subtraction\n";
cout << "3. Division\n";
cout << "4. Multiplication\n";
cout << "5. Quit The Program\n\n";
cout << "Please enter a choice: ";
cin >> choice;
if (choice <1 || choice >5)
{
cout << "Sorry that is an incorrect choice!"<<endl;
cout="" <<="" "please="" enter="" another="" choice="" "<<endl;
="" cin="">> choice;
}
cout<<"Enter a seed value: ";
cin>>seed;
srand(seed);
num1 = 1 + rand() % 10;
num2 = 1 + rand() % 10;
switch (choice)
{
case 1 : do
{
cout << "What is the sum of "<< num1 << " and " << num2 <<endl;
cin="">> answer;
correct = num1 + num2;
if ( answer == correct)
{
cout << "Congratulations you are correct!" <<endl;
}
="" else
="" {=""
="" cout="" <<="" "sorry="" that="" was="" incorrect"="" <<endl;
="" "the="" correct="" answer="" was:="" "="" "would="" you="" like="" to="" do="" another="" problem="" (y="" n)?="" ";
="" cin="">> again;
cout<<"\nEnter another seed value: ";
cin>>seed;
num1 = 1 + rand() % 10;
num2 = 1 + rand() % 10;
}while (again=='y' || again=='Y');
if (again != 'y' || again !='Y')
cout << "Sorry That is an incorrect choice" <
|
|
|
|