|
venetus wrote: I'm using Borland C++ 5.5.1
Then you can't possibly be using C++/CLI. You could try the visual C++ forum, but a Borland forum would be more sensible, if there is one.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
As I can see there is no problem with multithreading, but with the functions You've used. Compiler doesn't know these functions. Have you included <process.h> ??
|
|
|
|
|
i just copy and pasted the example...
what do you think i have to include???
|
|
|
|
|
i've just compile the example with Dev and it worked. But i don't know why it doesn't work with Borland compiler...
Any hint?
|
|
|
|
|
Which example? There are 3 examples
|
|
|
|
|
this one "Download demo project in C - 3 Kb"
bye
|
|
|
|
|
I've tried it with Builder 6.0 and it's worked fine.
Probably you haven't checked the Multi Threaded check box in File\new\other...\console wizard dialog. Make sure it's checked.
|
|
|
|
|
this is STILL the wrong forum to be talking about this.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
i would add a dll in my project but i don't know how i can introduce him, iam viewing a reference but i can't add him, i work with Visual Studio 2005 please help me.
Thank you very mutch.
|
|
|
|
|
What is the DLL written in ? You can add references to COM dlls and .NET dlls ( assuming your question is in the right forum and you are using C++/CLI ), I don't think you can import plain dlls, you can p/invoke them ( again, if you really are using C++/CLI ).
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
hey guys,
few days ago somebody ask me that where it is mandatory to define copy constructor i.e without making an explicit call we can not solve our problem..
so i need to know what would be that condition as i am also searching for the same from 2-3 days ...
if anybody can help me in getting the answer i'll greateful to him/her..
Thank you
Regards,
Pankaj Sachdeva
|
|
|
|
|
pan_angel wrote: where it is mandatory to define copy construc
It is not mandateroy to define copy c'to. But, it is required to define in cases where, one of member variable is pointer and uses dynamic memory allocation.
class A
{
char *m_pName;
int m_nid;
public:
A(char *pName,int nId)
{
m_pName = new char [strlen(pName)+1] ;
strcpy(m_pName,pName);
nid = nId;
}
~A()
{
delete []m_pName;
m_pName = NULL;
}
};
int main()
{
A aObj("Prasad",1);
A aObj1 = aObj;
}
So should modify your defintion to,
class A
{
char *m_pName;
int m_nid;
public:
A(char *pName,int nId)
{
m_pName = new char [strlen(pName)+1] ;
strcpy(m_pName,pName);
m_nid = nId;
}
A(A& aObj)
{
int nMemoryToAlloacate = strlen(aObj's char pointer);
m_pName = new char [nMemoryToAlloacate + 1] ;
strcpy(m_pName,aObj's char pointer);
m_nid = aObj's m_nid ;
}
~A()
{
delete []m_pName;
m_pName = NULL;
}
};
|
|
|
|
|
Objects can be passed to functions by value or by reference. If they are passed by value, a copy of each object is passed to the function. The default method for creating the copy is memberwise copy (shallow copy). This can be modified by supplying a user-defined copy constructor.
|
|
|
|
|
This is not a C++/CLI question, it should have been asked in the Visual C++ forum. You need a copy constructor when you have a pointer, or whenever you have an object which would automatically only provide a shallow copy, and a deep copy is required.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Hello,
I'm trying to create a Observer functionallity between a unmanaged C++ and a managed C++ Class. My managed C++-Class will be used as a Wrapper Class to connect the unmanaged Code to a C# Class. Now I have a Interface Class in my unmaganed Code and wanted to heritate my Wrapper-Class from it. But there ist the Problem. Its not possible to heritate a managed class from a unmanaged class.
The aim is, that my unmanaged Code has to call a method in managed Code.
Can someone help me to find an other solution?
Thanks
|
|
|
|
|
I did a similar thing with containment. The manaed object contains the unmanaged object and exposes all the same methods but with dot net data types. Each method converts data types of params if nessasary and cals the method on the unmanaged object. See this wonderfull article[^] for a smart pointer template you can use to manage the lifetime of unamanged objects
System.IO.Path.IsPathRooted() does not behave as I would expect
|
|
|
|
|
Thanks for your advice. The smart pointer template works great.
|
|
|
|
|
I am trying to build MagickNet (http://midimick.com/magicknet/) and I am not very familiar with c++ but I got pretty far. I am using VS2005 Express and the Platform SDK 2003 R2 is loaded an configured. I downloaded the source for this project and the source for the ImageMagic and GhostScript code to satisify any requirements that MagickNet needed.
I started this project by clicking on File -> New -> Project from existing code. I hacked away until I could right click on each cpp file and compile it with out errors. I have my configuration for a release build. I don't care for the debug because I only need the release version.
However when I try to build the project I get the following error:
------ Build started: Project: MagickNet, Configuration: Release Win32 ------
Compiling...
Stdafx.cpp
MagickOptions.cpp
MagickNet.cpp
MagickImages.cpp
MagickImage.cpp
MagickGeometry.cpp
MagickColor.cpp
AssemblyInfo.cpp
Linking...
LINK : fatal error LNK1104: cannot open file '.\Release\AssemblyInfo.obj'
Build log was saved at "file://c:\Documents and Settings\cjohnson\My Documents\Visual Studio 2005\Projects\MagickNet\Release\BuildLog.htm"
MagickNet - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I don't know much about VC++ but it seems like it is not creating the object files. If you need more info I can post off of my command parameters from VS2005 c++ express edition.
Can anyone help me please?
Thanks
|
|
|
|
|
I suspect that ImageMagic is not a .NET program, and you are therefore in the wrong forum. You are using Visual C++, right ? There's a Visual C++ forum. This one is for C++/CLI.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Thanks Christian. I've just posted this in the c++ forum. I am using vc++ but I am building it for a c#/asp.net website. I guess I should have put the horse before the cart.
Thanks,
Craig
|
|
|
|
|
|
Hi,
I was wondering what is the maximum limit (size) of an RWCString. I believe, it used to be 64K with 16 bit plateforms. Is there any limitations in 32 bit and 64 bit plateforms? Will appreciate if you could provide me this info.
THanks
|
|
|
|
|
What is an RWCString ? Are you sure this is a C++/CLI question ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
This questions pertains the the Rogue Wave C++ library (tools.h++). Should I be posting this in another section?
Thanks
|
|
|
|
|
OK, then it belongs in the Visual C++ forum, or, better, a forum dedicated to that library.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|