|
zulfi123786 wrote: using borland turbo c++5.01
By definition, this means you're not using C++/CLI and are in the wrong forum. The Visual C++ forum is the closest we've got to Borland.
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 )
|
|
|
|
|
Just more proof that the forums aren't clearly/appropriately marked
"Visual C++" should be called "Native/Unmanaged C/C++"
and this forum should be called "Managed C++ and C++/CLI"
-- modified at 11:59 Monday 15th October, 2007
And of course I just noticed this forum says "(Managed)" at the top of its name. :/
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I know this sounds like a stupid question but i can't seem to get a for each loop to compile correctly.
I tried...
for each (IpAddress ^addr in ipAddresses) {
}
and...
IpAddress^ addr = nullptr
for each (addr in ipAddresses) {
}
but none of them compile. I know i could do a for loop but i would rather just do a for each. I searched but i cant seem to find anyone else having this problem. Thanks alot for any help
here are some of the errors:
Error 1 error C2143: syntax error : missing 'in' before '^'
Error 2 error C2065: 'addr' : undeclared identifier
Error 3 error C3192: syntax error : '^' is not a prefix operator (did you mean '*'?)
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
teejayem wrote: here are some of the errors:
And what are the other errors? Sometimes some errors are caused because of the errors that occur before them. I guess these are errors for the first case. Your code should look like this:
<br />
foreach (IpAddress^ addr in ipAddresses)<br />
{<br />
<br />
}
|
|
|
|
|
hey Giorgi thanks for your reply.
these are some of the errors i get.
Error 1 error C2143: syntax error : missing 'in' before '^'
Error 2 error C2065: 'addr' : undeclared identifier
Error 3 error C3192: syntax error : '^' is not a prefix operator (did you mean '*'?)
array<IPAddress^>^ ipAddresses = Dns::GetHostAddresses(Dns::GetHostName());
for each (IpAddress ^addr in ipAddresses) {
}
i don't think it is any other part of the code that is failing because as soon as i comment the for each loop it compiles fine. Thanks,
-- modified at 9:43 Thursday 11th October, 2007
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
array<System::Net::IPAddress^>^ ipAddresses =
System::Net::Dns::GetHostAddresses(System::Net::Dns::GetHostName());
for each(System::Net::IPAddress^ addr in ipAddresses)
System::Console::WriteLine( addr->ToString());
|
|
|
|
|
can anyone code the VRP problem using genetic alogrithms in c++.
i need that to be done as a report along with code to submit for my exam.
kindly help me in this work
|
|
|
|
|
Really....don't cross post.
That means don't post the same question on several discussion boards.
Pick the one that best fits your topic.
Also, this isn't a "we do your homework" site. I bet if you offer lots of money you'll
get a better response.
If you're unable to offer large sums of cash, then show us a little of what you've already
done, along with a description of specific problems you're having, and maybe we'll try to help.
If you choose this route, please post on the correct discussion board.
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thankyou very much for ur great criticism.due of lack of knowledge on that project only im on this website.a simple answer is enough to let me know ur possibility.
have a nice time
|
|
|
|
|
|
|
Hi all,
I am using ipl98 library version 2.20 and I was compile it successful. However, I can only use the static library is created by VC++.net (It can run ok with the example in ipl98 library project.) The dynamic library cannot use it to run the example.
About Borland C++, I also compile successfully but the dynamic library cannot do with the example. After that I compile it to create the static library, this is not successful, the error: library too large, please restart with library page size 32.
My purpose is using ipl98 library version 2.20 in the Borland C++. However, I spent a lot of time but until now I also cannot use it in the Borland C++. If you have any advices, any ideas, or any instructions please show me!
Can we use the static library created by VC++.net to transition dynamic library? Or Can we use the static library in Borland C++? Or you have another ways to solve it.
I hope I will get your feedback as soon as possible.
Best regards!
nothing
|
|
|
|
|
Tien Manh wrote: My purpose is using ipl98 library version 2.20 in the Borland C++.
Unless this version of Borland supports Microsoft .NET libraries, and they are used by this dll, you're in the wrong forum. The Visual C++ forum is the place for non .NET C++ questions, even then, I doubt many people here use Borland.
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,
a simple program of a class (combined) containing a member which is an object of another class (alpha).
When the object of combined class is instantiated, copy constructor for alpha is called twice!!
class alpha<br />
{<br />
int alpha_value;<br />
public:<br />
alpha() { std::cout << "\nCalled constructor for alpha"; }<br />
alpha(const alpha&) { std::cout << "\nCalled copy constructor for alpha";}<br />
};<br />
<br />
<br />
class combined<br />
{<br />
alpha a;<br />
public:<br />
combined() {std::cout << "\nCalled constructor for combined}";}<br />
combined(alpha& a1): a(a1) { std::cout << "\nThree argument Constructor Called for combined"; }<br />
};<br />
<br />
<br />
int main()<br />
{<br />
alpha a;<br />
combined d = combined(a);<br />
return 0;<br />
}
Following is the output:
Called constructor for alpha
Called copy constructor for alpha
Three argument Constructor Called for combined
Called copy constructor for alpha
Manik
|
|
|
|
|
Please don't ask questions unrelated to Managed C++/CLI on this
message board. Use the Visual C++/MFC board instead.
It's only called once for me (VS 2005 SP1).
What if you do this (instead of the extra assignment):
combined d(a);
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
For furture references (solution: )
alpha a; /* Called constructor for alpha */
combined d = combined(a);
First a temporary object combined(a) is created.
For it, first the copy constructor for alpha is called (member objects constructors called first)
=> "Called copy constructor for alpha"
Next, the constructor for temporary combined object is called:
"Three argument Constructor called for combined"
Next, d = temp_object.
Compiler does not find copy constructor for combined class, so its own supplied copy constructor is invoked.
this default copy constructor, copies member by member.
this results in call to copy constructor of alpha
"Called copy constructor for alpha"
|
|
|
|
|
Is there a way for me to set the font color of a Win32 edit box? I know I can set the font type by sending a WM_SETFONT message, but I can't find anything about setting the font color. Any help is appreciated.
|
|
|
|
|
Please don't ask questions unrelated to Managed C++/CLI on this
message board. Use the Visual C++/MFC board instead.
To set the color(s) of edit controls, you can respond to the
WM_CTLCOLOREDIT message in the parent's windowproc and
set the text and background colors.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm trying to make simple class derived from ComboBox that processes some command keys. Here is the code:
<br />
#pragma once<br />
<br />
using namespace System;<br />
using namespace System::Windows::Forms;<br />
<br />
namespace ProjectX {<br />
<br />
public ref class EnterComboBox : public ComboBox {<br />
<br />
public:<br />
<br />
EnterComboBox(void) {<br />
}<br />
<br />
protected:<br />
<br />
virtual void ComboBox::ProcessCmdKey(Message^% msg, Keys^ k) override {<br />
<br />
MessageBox::Show("cmdkey");<br />
<br />
ComboBox::ProcessCmdKey(&msg, k);<br />
}<br />
};<br />
}<br />
The compiler outputs error C3254: 'ProjectX::EnterComboBox' : class contains explicit override 'ProcessCmdKey' but does not derive from an interface that contains the function declaration
I'm confused. There is no such interface. I've searched whole e-books, forums for the code sample (and more common overrides, like OnPaint, OnResize etc.) and there is no answer how the hell override some method from the Control's base class
|
|
|
|
|
You have a mismatch, and it should be:
virtual bool ProcessCmdKey( Message% msg, Keys keyData ) override
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Now it works, thanks. But another few hours have been spoiled on this either.
|
|
|
|
|
Hello,
i recive this warnings: warning C4996: 'wcscpy' was declared deprecated
and if i try to use: #pragma warning(disable:4996)
this dont take a efect?
Is there any other way to disable some warnings?
I dont want to change all this wcscpy's to wcpycpy_s!
thanks for help
termal
|
|
|
|
|
This has nothing to do with C++/CLI, try 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 )
|
|
|
|
|
In what way 'union' differs from 'struct' type?
|
|
|
|
|
This has nothing to do with C++/CLI, try 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 )
|
|
|
|