|
Probably arises from this: Do not initialize unnecessarily[^]
However, it also explicitly states: "This rule ignores Managed C++ assemblies."
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
How can I get the DNS IP address that the local client is using?
Like to find a way using c++ and not MFC
thanX
|
|
|
|
|
Hi,
I am trying to wrap my C++ objects in a managed wrapper. I have...
public ref class MCamera
{
private:
NW::Camera* m_camera;
public:
MCamera(MNW::Vector3 in_source, MNW::Vector3 in_target, float in_near, float in_far, int in_outputWidth, int in_outputHeight);
~MCamera();
IntPtr GetCameraPtr();
};
and I'm putting a breakpoint on the code for the destructor but it never gets called. I've enabled unmanaged debugging and other breakpoints work, but it seems this never gets called. Does anyone know why the destructor is not getting called, even when the application is closed?
Thanks!
|
|
|
|
|
|
I HAVE TO write a programm that can erease all data from hard drive
that no one can recover it again.There are planty of algorithms that can do
that and I wanna use them in my programm.I have to write it for my exam pro
ject at university. Any help?? PLIZ...sorry for my English couse i`m not Pol
ish.
|
|
|
|
|
zetkonrad wrote: I HAVE TO write a programm that can erease all data from hard drive
that no one can recover it again.
And it needs to be in managed C++ ?
zetkonrad wrote: There are planty of algorithms that can do that and I wanna use them in my programm
OK, if you know the algorithms, why not use them ?
zetkonrad wrote: I have to write it for my exam project at university
OK, good luck doing your project. If you get stuck while working on it ( as oppossed to before you do any work ), by all means, ask specific questions in the correct forum, and we would love to help you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi there,
I need to build an optimized circular buffer of variabe length messages in C++. The elements are std::string types and I can dedicate a fixed amount of space to this log, in the sense that I can preallocate a memory block of fixed size and work in there. Can anybody indicate me some examples or techniques in C++ (in fact it should run under Linux) to do this ?
Thanks for your help
Marco
marcof
|
|
|
|
|
this is a managed C++ forum, try the Visual C++ forum.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi all,
I am beginner in C++.Just want to know whether we can use only c++ to preodeuce a program.
|
|
|
|
|
You can use any language you like, there are hundreds.
Darka [ Xanya]
"I am not a slave to a god that doesn't exist."
|
|
|
|
|
This is the managed C++ forum. I think you wanted the Visual C++ forum.
You can write a program using only C++ if you want to. But, as someone said, you can use lots of other languages, too. Realistically, the languages most used on a PC are C, C++, C#, VB6 and VB.NET.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Could anyone please, answer this question for me
Is it necessary to create a constructor when you are dealing with things like mathematical formulae that involves using classes?
Thanks for your prompt response.
Regards,
SKG!
skg
|
|
|
|
|
I doubt this is a managed C++ question.
What makes you think it would be necessary ? You get a default constructor for free, you can hide that by making it private, and you can add any sort of constructor you want. If you want to pass anything to the constructor, you need to write one. If you have any pointers or variables that need to be initialised ( which seems likely ) then you need a constructor to do that. But the fact that you're doing mathematical operations is of itself irrelevant, what matters is the needs of the specific class.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I added a UserControl -derived custom control to the my application's project. Is there a possibility for this control to show up in the Toolbox? I would like to make it available for multiple forms in the same project.
When I try to import the MyApp.exe into the Toolbox (via Choose Items...), it says:
Attempt to load an unverifiable executable with fixups (IAT with more than 2 sections or a TLS section.) (Exception from HRESULT: 0x80131019)
I suspect I will need to move the control code into the DLL, am I right? Or maybe there is some trick to keep it in the main image?
|
|
|
|
|
My company is moving from Native C++ to .Net C++. We are not switching out all our code. New developments will be done in CLR and C#.
I want to perform my new development as a CLR managed Class Library. (I have several requirements that force me not to use an unmanaged Class Library.) HOWEVER, my software lead is worried that my managed Class Library .dll will be used by our competition.
My question is, “Is he right?” Can my code be stolen and used since the .dll will need to be released with the main application?
Thanks
Glenn
|
|
|
|
|
earlgraham wrote: My question is, “Is he right?” Can my code be stolen and used since the .dll will need to be released with the main application?
Any dll can be used by your opposition. Just as you can p/invoke to call Win32 APIs in C#, or use LoadLibrary to use an API that you don't have the headers for, the only issue is discovery of the methods available from a dll, unless you have some sort of protection in place ( such as passing a token which acts as a password ).
.NET code can, by definition, be decompiled, which increases your exposure for sure. There are measures you can take, such as obsfucation, but you can't stop it. And, of course, decompilation means that any security measures you take can be circumvented.
Having said that, if they use your dll directly, you'd find out about it. If they stole your code, that would be harder, but if you write good, small methods, obsfucated code may be painful to use in that way.
The real question is, how far do you have to go to stop it being worth their while, how unique/difficult/valuable is the code in question ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks. I was afraid if this. It would have helped a lot if I could have worked it out.
Thanks again
Glenn
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
Sorry - it's the one big issue with .NET, obsfucation does help, but the really solid libraries in this regard also cost a bomb.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi all,
In VS2005, I'm trying to debug a C++ dll, called from a tiny VB test app - but when I 'Go' (F5), my breakpoints are disabled - the Output window tells me No symbols loaded for my Interop.fubar.dll (where fubar is my dll name) -
I've built the dll with Debug options - Is there something else I have to tell VS2005 to load its symbols??
thanx!
~ Mike
|
|
|
|
|
Hello,
Im not sure about Vb but in a c# project you need tick the "Enable unmanaged code debugging" option in the debug section of the project properties. Im sure its something similar
|
|
|
|
|
This did it - thanx muchly!
~ Mike
|
|
|
|
|
The codes that I have written so far is below:
// Simulation of the Dynamics of a 2-Link Pan-Tilt Robotic Manipulator
/* This programme calculates the Velocity, Acceleration and the angles of inclination
of the two links of the Spherical Pointing Motor, which is essentially a Two-Link Robotic
Manipulator*/
//#include <basis.h>
//#include <assert.h>
//#include <string.h>
//#include <iostream.h>
//#include <iomanip.h>
//#include <fstream.h>
// Precompiler Directives
#include <math.h>
#include <stdlib.h>
// Constants Declaration
#define n (int) 2
#define m1 (float) 0.05
#define m2 (float) 0.03
#define r1 (float) 0.04
#define r2 (float) 0.06
#define ra (float) 0.04
#define rb (float) 0.06
#define l (float) 0.05
#define d (float) 0.02
#define acc_due_gravity (float) 9.81
class AngVel1
{
public:
};
class AngAccln1
{
public:
};
class AngVel2
{
public:
};
class AngAccln2
{
public:
}
/*
n = Number of Links = 2
m1 = Mass of the First Link (The Annulus)
m2 = Mass of the Second Link
r1 = Inner Radius of Link 1 (The Annulus)
r2 = Outer Radius of Link 1 (The Annulus)
ra = Outer Radius of the Annulus
rb = Inner Radius of the Annulus
l = Half the Lenght of Link 1
d = Displacement from the Centre of Mass
g = Acceleration due to gravity = 9.81
t = time in seconds
*/
// Declaration of variables (Robot Parameters)
float t;
// Prototypes
float TorqueVal(float t);
double Runge_Kutta ();
double AngVel1 (double om1){
return om1;
}
double AngAccln1 (double t, double om1, double tetha1, double tetha2){
t = 0.1;
return (tau1 - 2*m2(r2*r2/4 -h2*h2/3 -d*d) * om1*om2*sintetha2*costetha2 - m2*g*d*costetha1*costetha2)/
om1*(m1(ra*ra + rb*rb)/4 + m1(h1*h1)/3 + m2((r2*r2)(1+sinsqtetha2)/4 + m2*h2*h2*cossqtetha2/3 + m2*d*d*cossqtetha2);
}
double AngVel2 (double om2){
return om2;
}
double AngAccln2 (double t, double om1, double om2, double tetha1, double tetha2){
t=0.4;
return (tau2 + (m2(r2*r2/4 -h2*h2/3 -d*d)*om1*om1*sintetha2*costetha2) - m2*g*d*sintetha1*sintetha2)/
om2*m2(r2*r2/4 + h2*h2/3 + d*d;
double RK(double y){
double k1,k2,k3,k4;
k1=h*fn(y);
k2=h*fn(y+(k1/2.0));
k3=h*fn(y+(k2/2.0));
k4=h*fn(y+k3);
return y+(k1/6.0)+(k2/3.0)+(k3/3.0)+(k4/6.0);
}
// The Main Routine
int main()
{
// Torque Function
float TorqueVal1(float t)
{
t = 0.1;
return t;
}
// Runge-Kutta Function
double RK(double y){
double k1,k2,k3,k4;
k1=h*fn(y);
k2=h*fn(y+(k1/2.0));
k3=h*fn(y+(k2/2.0));
k4=h*fn(y+k3);
return y+(k1/6.0)+(k2/3.0)+(k3/3.0)+(k4/6.0);
}
double RK(double l){
double v1,v2,v3,v4;
v1=h*fn(l);
v2=h*fn(l+(k1/2.0));
v3=h*fn(l+(k2/2.0));
v4=h*fn(l+k3);
return l+(v1/6.0)+(v2/3.0)+(v3/3.0)+(v4/6.0);
}
}
i am attempting to simulate the dynamics of a 2-link pan-tilt robot. Two second order ODE were generated. As a requirement of the Runge-Kutta, each of the two second-order ODE was converted to 2 first order ODE thereby making four equations in all.
I was not using a class before and I just started packing the four equation into classes.
For further explanation or clarification, please, mail me to olaskg@yahoo.ie.
Thank you.
skg
|
|
|
|
|
1 - check the Ignore HTML tags when you post code
2 - when posting C++ code, don't use the managed C++ forum, use the visual c++ one
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hello,
I am trying to import a function from fortran and using it in a windows form.
I export the function like always:
MODULE FORTRANMOD<br />
PUBLIC DllFortranTest<br />
CONTAINS<br />
INTEGER FUNCTION DllFortranTest<br />
!DEC$ ATTRIBUTES DLLEXPORT::DllFortranTest<br />
...<br />
END FUNCTION DllFortranTest<br />
<br />
END MODULE FORTRANMOD
and I import the funcion in C like always also
__declspec (dllimport) int FORTRANMOD_mp_DLLFORTRANTEST();
But when I'm going to use it:
int i = FORTRANMOD_mp_DLLFORTRANTEST();
I get the following errors linking:
1>FortranForm1.obj : error LNK2031: unable to generate p/invoke for "extern "C" int __clrcall FORTRANMOD_mp_DLLFORTRANTEST(void)" (?FORTRANMOD_mp_DLLFORTRANTEST@@$$J0YMHXZ); calling convention missing in metadata
1>FortranForm1.obj : error LNK2028: unresolved token (0A000006) "extern "C" int __clrcall FORTRANMOD_mp_DLLFORTRANTEST(void)" (?FORTRANMOD_mp_DLLFORTRANTEST@@$$J0YMHXZ) referenced in function "private: void __clrcall ConFortran::Form1::ComunicacionFortran(void)" (?ComunicacionFortran@Form1@ConFortran@@$$FA$AAMXXZ)
1>FortranForm1.obj : error LNK2019: unresolved external symbol "extern "C" int __clrcall FORTRANMOD_mp_DLLFORTRANTEST(void)" (?FORTRANMOD_mp_DLLFORTRANTEST@@$$J0YMHXZ) referenced in function "private: void __clrcall ConFortran::Form1::ComunicacionFortran(void)" (?ComunicacionFortran@Form1@ConFortran@@$$FA$AAMXXZ)
I have also try to use:
using namespace System::Runtime::InteropServices;
and
[DllImport("dllfortranTest.dll")]<br />
static int DllFortranTest();
But I get the exception:
An unhandled exception of type 'System.EntryPointNotFoundException' occurred in ConFortran.exe<br />
<br />
Additional information: Unable to find an entry point named 'DllFortranTest' in DLL 'dllfortranTest.dll'.
Can somebody help me about the importation way of work???
Best regards
-- modified at 7:08 Wednesday 18th October, 2006
|
|
|
|
|
Hi guys
I have been working on a project for several months now and it is almost finished all i need is some kind of security so that only the people that buy my software will be able to run it although when they first run it, it will display a key(which is their hardware drive serials, encrypted though) and then they will need to send that code to me so that i decrypt the data and send them a key that will work(any kind of key, for ex. when they send their key to me then i will use another proggy that i make and use that proggy to maybe add something to their serial like a few digits or a code at the end of their serial then send it back to them) what i need to know though is how to encrypt their hardware drive serial then make an algorith that can recognize the modified serial(that i will send to them once they send their serial to me) and make the program start up. I also need some kind of limit maker so that someone can only use it for a limited amount of time(1 year lets say) then after the time has expired it will display a message box saying they have to renew their serial.
Soething of this kind would be really good.
So could someone please direct me to such a tut or maybe reply with some useful info?
Thanks in advance
Cyclone
|
|
|
|