|
Hello,
I am starting to develop application in Visual C++ .Net (Visual C++ 8.0).
I made a little project and now I want to make an executable file which it could be copied in a different computer or folder without install it or without copy any DLL, I want to copy just the executable.
I was trying to configure the project option but I failed.
When I worked with Visual Studio 6.0 (Visual C++) I could set the link option like static so I could copy the exe file in different folders or computers
I need your help trying to solve this issue.
Juan
|
|
|
|
|
working with managed or unmanaged code ?
|
|
|
|
|
What do you mean with manage or unmanage code?
I just have one
#define _CRT_SECURE_NO_DEPRECATE
|
|
|
|
|
i mean, you use MFC, Win32 or such libraries which generate natice code (directly for the target microprocessor), or using managed code, which is actually an intermediate language for the .NET framework...
|
|
|
|
|
jucanpo wrote: copied in a different computer or folder without install it or without copy any DLL, I want to copy just the executable.
They hide that information in the Documentation[^]
"Alot of the people on this forum are incredibly stupid, thinking that the internet is real" Score: 1.0 in the Soap Box
led mike
|
|
|
|
|
I've been trying to figure out what's the problem here. A simple GDI+ code to draw a pie.
GraphicsPath m_Paths;
Rect rc0(0, 0, 191, 191); // Give it a rectangle size of 191x191
m_Paths.AddPie(rc0, 180, 90); // Draw the pie at angle 180 with a sweep angle 90.
m_Paths.Flatten(NULL, 0.03f);
// Now if you draw the pie, there's a problem, it won't draw the verticle line at the end of the pie.
Pen myPen((ARGB) Color::Black, 1.0f);
Graphics g(pDC->GetSafeHdc());
g.DrawPath(&myPen, & m_Paths);
// If I don't use the Flatten or change it to
m_Paths.Flatten(NULL, 0.02f);
// or
m_Paths.Flatten(NULL, 0.04f);
// Both of these works. Just not the 0.03f.
What's the problem?
|
|
|
|
|
It looks like a bug. I am able to reproduce the same problem. I also checked the status returned from this call:
Status ret = m_Paths.Flatten(NULL, 0.03f);
and ret is OK.
Best,
Jun
|
|
|
|
|
The weird thing is making the pen width large works. Changing the pen style to dash and everything else works. Only the solid line doesn't.
|
|
|
|
|
Yeh... I didn't play further, but it doesn't work in all cases. To me, there is no reason why it should work on 0.02f and 0.04f, but not in 0.03f.
Best,
Jun
|
|
|
|
|
we have an older application that we would like to extend with managed code (written in c#). The extension was planned to be through a dll written in C++ that would call managed part - as proposed in the following article: http://www.codeproject.com/dotnet/bridge.asp
problem is that when I write a simple non-managed app in VC2005, I can call managed part without any problem, but when I try to call it from the same application compiled with VC6, it simply breaks.
here is the C# assembly code:
namespace ClassLibrary1
{
public class Class1
{
public static int ShowDialog(string sText, string sCaption)
{
System.Windows.Forms.MessageBox.Show(sText, sCaption);
return 0;
}
}
}
here is the wrapper C++ dll
using namespace System;
using namespace ClassLibrary1;
using namespace System::Windows::Forms;
extern "C" __declspec(dllexport) int __cdecl callDotNet(char *text, char *caption)
{
String ^sText = gcnew String(text);
String ^sCaption = gcnew String(caption);
// MessageBox::Show("about to enter Class1");
Class1::ShowDialog(sText, sCaption);
return 0;
}
and here is the simple console app that calls a DLL that calls C# code:
extern "C" __declspec(dllexport) int __cdecl callDotNet(char *text, char *caption);
int main(int argc, char* argv[])
{
callDotNet("sample text", "sample caption");
return 0;
}
This works if it is compiled in VS2005 but breaks when compiled in VC6 (unhandled exception in console2.exe (KERNEL32.DLL): 0xE0434F4D:(no name).)
Unfortunately it is not possible to recompile the old application with VC2005 since it is pretty old application with a lots of code written in cobol.
This may be a newbie question or has been discussed before, but I searched the message boards and could't find anything similar. I am not sure at all that it is possible to connect unmanaged code with managed code this way. Am I on the right track? Tnx in advance
Dragan Matic
|
|
|
|
|
Dragan Matic wrote: non-managed app in VC2005
VC6 has no support for the .NET platform (managed code), you must use later compiler.Dragan Matic wrote: it is pretty old application with a lots of code written in cobol.
And you compile Cobal with VC6?
"Alot of the people on this forum are incredibly stupid, thinking that the internet is real" Score: 1.0 in the Soap Box
led mike
|
|
|
|
|
led mike wrote: VC6 has no support for the .NET platform (managed code), you must use later compiler.
I know that, but it was my understanding that functions prefixed with extern "C" will be visible (and callable) as simple C functions. I expected to be able to call them as any other dll that exports some functions and structures.
led mike wrote: And you compile Cobal with VC6?
No, actually the application we have is an old cobol application now largely extended and partly replaced with code written in VC6. Cobol can call VC6 dlls, so I thought it could also call dlls written in VS2005 - as long as the functions are exported with extern "C" prefixes. When I didn't succeed in that, I tried to call a dll from program written with VC6 only to find that is not possible, too.
|
|
|
|
|
Dragan Matic wrote: No, actually the application we have is an old cobol application now largely extended and partly replaced with code written in VC6.
So you mean with VC6 DLL's? You might have a library problem. A C/C++ DLL requires support of the CRT libraries at a miniumum and VS2003 and 2005 had new CRT versions.
"Alot of the people on this forum are incredibly stupid, thinking that the internet is real" Score: 1.0 in the Soap Box
led mike
|
|
|
|
|
Hi,
Can anybody help me to get Icon details like its name, target path, working directory whenever it is double-clicked to run the application. This is be using Windows API or in C#.
I have already used IShellLink Interface but its been hard-coded for icon name. Suppose the user changes desktop icon name then also coding should be able to change its working directory. This can be done if I can check the existence of the icon.
Regards.
|
|
|
|
|
I noticed you are crossposting.
This question already got answered on the C# forum.
C# Forum post[^]
WMLast modified: maandag 4 september 2006 10:26:15 --
|
|
|
|
|
this is the problem;
Write a program in C that finds randomly generates an n x n adjacency matrix. Have your program print the adjacency matrix, the number of edges, the number of loops, and the degree of each vertex.
|
|
|
|
|
This is the managed C++ forum. Please post it in Visual C++/MFC instead.
Best,
Jun
|
|
|
|
|
yeah and tell 'em do do their own homework
bryce
|
|
|
|
|
I've been working on a memory usage logging system, and came upon this strange preprocessor bug appearing while using __VA_ARGS__ in a specific way.
This is the source that should but doesn't compile on VC++ 8.0 (included is also a hacky workaround):
<br />
#include <new.h><br />
<br />
template<class T> void * internal_alloc( int locationID, int lineNumber, const char * pFileName )<br />
{<br />
return 0;
}<br />
<br />
#define internal_new( __obj_type, ... ) new( (internal_alloc<__obj_type>(__COUNTER__, __LINE__, __FILE__)) ) __obj_type( __VA_ARGS__ )<br />
<br />
void main()<br />
{<br />
int * pTest1 = internal_new( int );
int * pTest2 = internal_new( int, 1 );
<br />
<br />
}<br />
It looks like the __VA_ARGS__ solver removes the wrong comma in 'no arguments' scenario
I wonder how it works on some other compiler?
|
|
|
|
|
Eek, now I see that I accidentally posted to 'managed c++' instead of 'Visual C++ / MFC.
|
|
|
|
|
Hi,
I was using gmtime() on WinCE with Dinkumware libraries. It returned local time instead of UTC. Although I can convert it to UTC by calling GetTimeZoneInformation, still wondering why that is, and if there's any other function can be called?
Thanks!
d8
|
|
|
|
|
Hello,
I am new to C++/CLI programming, and I can't figure out why the following code can't be compiled :
<br />
ref class MyClass<br />
{<br />
};<br />
<br />
int main ( void )<br />
{<br />
MyClass instance1;<br />
System::String instance2;
<br />
return 0;<br />
}<br />
The compiler outputs an error when i try to allocate a String object as an automatic variable : "C3149: 'System::String' : cannot use this type here without a top-level '^'."
As the problem doesn't appear with my home-made ref class, my actual question is : is there a way to prevent a class from being instantiated as an automatic variable ?
Regards,
Julien
|
|
|
|
|
juju_hli wrote: As the problem doesn't appear with my home-made ref class, my actual question is : is there a way to prevent a class from being instantiated as an automatic variable ?
String, array, and delegate objects cannot be declared using stack semantics (it's a compiler enforced restriction).
|
|
|
|
|
Thank you for this quick reply
|
|
|
|
|
i have recovered all messages from a dbx file.
i want to put back into a dbx file throght programming not to drag drop.
Parshant
|
|
|
|