|
|
Home » Community » Newbie corner » Convert M$VC console app to U++
Convert M$VC console app to U++ [message #38194] |
Wed, 05 December 2012 14:32  |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
I have a small console app done in M$VC.
Can it be converted to U++ ?
Errors with these 5 lines:
#using <System.dll>
using namespace System;
using namespace System::IO::Ports;
using namespace System::Threading;
using namespace System::IO;
#using <System.dll>
managed targeted code requires a '/clr' option
Commenting that line the other 4:
C:\MyApps\Ccheck\Ccheck.cpp(8) : error C2871: 'System' : a namespace with this name does not exist
C:\MyApps\Ccheck\Ccheck.cpp(9) : error C2653: 'System' : is not a class or namespace name
C:\MyApps\Ccheck\Ccheck.cpp(9) : error C2871: 'Ports' : a namespace with this name does not exist
C:\MyApps\Ccheck\Ccheck.cpp(10) : error C2653: 'System' : is not a class or namespace name
C:\MyApps\Ccheck\Ccheck.cpp(10) : error C2871: 'Threading' : a namespace with this name does not exist
C:\MyApps\Ccheck\Ccheck.cpp(11) : error C2653: 'System' : is not a class or namespace name
C:\MyApps\Ccheck\Ccheck.cpp(11) : error C2871: 'IO' : a namespace with this name does not exist
This app just checks the Comm Ports for GPS receivers.
Here is a link to the U++ Ccheck package and also COMcheck_2.exe
<a href="http://www.nlneilson.com/apps/COMcheck_2.zip" target="_blank"></a>
[Updated on: Wed, 05 December 2012 14:42] Report message to a moderator
|
|
|
|
|
|
|
|
Re: Convert M$VC console app to U++ [message #38282 is a reply to message #38196] |
Sun, 09 December 2012 00:14   |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
I tried to add a main top window and an EditField.
Now it gives this error:C:\MyApps\C3\main.cpp(32) : error C2872: 'String' : ambiguous symbol
could be 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::String'
or 'c:\upp\uppsrc\core\String.h(306) : Upp::String'
Another new app was created and the Ccheck.cpp code was pasted in.
There was a similar error with Thread until commented out
// using namespace System::Threading;
System::String^ Com; gets rid of the ambiguous error
Com is local here but may need to convert to Upp::String later.
Get this error now and no idea what is required.
Linking...
MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
C:\upp\out\MyApps\MSC9.Clr.Gui.Mt\C3.exe : fatal error LNK1120: 1 unresolved externals
-
Attachment: C3.zip
(Size: 3.02KB, Downloaded 265 times)
[Updated on: Sun, 09 December 2012 01:38] Report message to a moderator
|
|
|
|
Re: Convert M$VC console app to U++ [message #38295 is a reply to message #38289] |
Sun, 09 December 2012 14:03   |
Sender Ghost
Messages: 301 Registered: November 2008
|
Senior Member |
|
|
Personally, I don't recommend to mix U++ and managed C++ source code in the same U++ package, if you want to debug it from TheIDE.
Instead, you could create separate U++ package with managed C++ source code for which you could create Microsoft Visual C++ project for debugging purposes.
Changed C3.zip archive attached to the message, which includes C3 and C3Managed U++ packages.
-
Attachment: C3.zip
(Size: 4.64KB, Downloaded 276 times)
[Updated on: Sun, 09 December 2012 15:42] Report message to a moderator
|
|
|
Re: Convert M$VC console app to U++ [message #38303 is a reply to message #38295] |
Sun, 09 December 2012 18:36  |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
Thank you very much Sender Ghost.
Changing the code so it works is appreciated.
It works.
When the code is added to a much bigger app that app can be debugged and only if the managed code is called would there be a problem. The managed code can be debugged in M$VC++ if necessary if I understand correctly. No problem as the basic code for GPS has been used in my apps for years without a problem.
It's just that the serial code I have been using works on Win XP but not Win7. The M$VC++ serial/port code works on all without a problem and is much faster and less errors and hang ups..
It will take me some time to understand how your code works.
Again THANK YOU!
|
|
|
Goto Forum:
Current Time: Wed Apr 30 00:29:49 CEST 2025
Total time taken to generate the page: 0.01192 seconds
|
|
|