|
Hi everybody, I'm a student, and I'm triying to create the tree command like int DOS, to print all the directories and files of my hard disk, but I can't .I must use "findfirst" and "findnext" function in Turbo C++ (3.0).
Please, help me!!! doh:
|
|
|
|
|
Well, I think I'd be right in saying that Turbo C++ does not support managed C++. You should find a forum that supports your compiler ( although from memory, firdfirst and findnext are Windows API functions, which means it shouldn't matter ). Your solution will be recursive, it will call itself whenever it finds a folder to move into.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I've created MFC Application using Visual Studio 2003, then change the project settings
to use Managed Extensions as follows:
1. Configuration Properties->General->use Managed Extension : Yes
2. C/C++->General->Debug Information Format : Program Database (/Zi)
3. C/C++->Code Generation->Enable Minimal Build : No
4. C/C++->Basic Run-Time Check : Default
then in the CMyClassDlg.cpp did the following:
#using <mscorlib.dll>
#using <system.dll>
using namespace System;
#using <system.xml.dll>
#using <system.data.dll>
and in the OnInitDialog() did :
XmlDocument *xmlDoc = new XmlDocument();
//Just this to try
and compile this error message appeared:
(105): error C3828: 'System::Xml::XmlDocument': placement arguments not allowed while creating instances of managed classes
I dont know why this error generated ,though I did the same thing in my ISAPI Filter DLL project and used XmlDocument
and SqlClient effectively.
why this happening in MFC application .
Any Idea? Regards.
|
|
|
|
|
this the directive the check box for using < as HTML was not checked
#using <mscorlib.dll>
#using <System.dll>
using namespace System;
#using <System.Xml.dll>
#using <System.Data.dll>
|
|
|
|
|
Hi!
I need to get the names and parameters of the functions out of an compiled dll.
thanks in advance
thomas
|
|
|
|
|
You should be able to read the library with Visual Studio.NET or the IL Disassembler. (I'm assuming that it was compiled with a .NET compiler.)
|
|
|
|
|
I've asked this question a while back and couldn't seem to get a straight answer. I want to make a MFC project using managed extensions. If I have a CFormView based form as my main window, can I add a windows form to my project and show it modal/modeless from an event in my main form (like pressing a button)? I've added a windows form to my project, but now I don't know how to make it display. Does anyone have any suggestions? Any help is appreciated. Thanks
while(true)
{
TryToLearn("C++,MFC");
}
My articles[^]
bdiamond
|
|
|
|
|
I've migrated an existing function from a mex file (previously used with Matlab) into a .c file and incorporated it into an existing MFC application (I compile it with the rest of the files, not as a separate library).
For some reason, that specific function runs much slower than it does when I run the similar mex version from Matlab. It has 7 nested 'for' loops which access different locations in an ~10300 long float array.
Is there a way to optimize the running time?
|
|
|
|
|
maybe if you put the code here i can help you, anyway 7 nested loops sounds very huge, i think that mathlab does a optimization maybe or a prebuffer...
|
|
|
|
|
I am porting my application which is developed in VC++ 6.0 to VC++ 7.0.
I got ambigous error when I am using
CString cstrTemp += "A";
I think CString class is modified in .net and It won't accept "+=" operator. What is the other alternative.
Thanks in advance.
|
|
|
|
|
Anonymous wrote:
CString cstrTemp += "A";
cstrTemp = "A" + what ? Get rid of the +, and use it only when the string you're trying to add to already exists.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thanks.
Sorry for that error.
It is like this
CString strTemp = "Class";
strTemp += "A";
let me know how to solve this.
|
|
|
|
|
What's wrong with strTemp = strTemp + "A"; ?
Although I'll admit, it's a bit weird. What's the text of the error ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Should be:
CString str("A");
str += "B";
|
|
|
|
|
I have an unmanaged DLL,I want to convert this to a Managed code so that C# and VB can access the resulting managed DLL, we decided to use Managed Extensions for C++(MC++)
As i am facing difficulties in analyzing the concepts hidden with in MC++,i want to know as
1.how to take the existing unmanaged code and compile it to managed code, (with the /clr compiler switch and It Just Works (IJW) )
2.Also to write managed wrappers around unmanaged functions.
After going through articles this is what i have understood, but absolutely don't know whether it is right or wrong??
To create a blank solution in Visual Studio and add the following projects
1) Unmanaged (old dll)
2) Managed (dll written using MC++)
3) and finally the C# project which accesses this Managed project
If this is correct, then is it possible for me to
1) directly take my old MFC DLL and open it in Visual Studio
2) should i add the .cpp and .h files from old dll to the managed project
3) should the import library of old dll be added to linker dependancies in the managed project
if all the above mentioned steps are wrong then what are the detailed steps i am supposed to follow.Anybody please help me
thanks in advance
|
|
|
|
|
I'm not sure about with a dll, but for a regular project, I just made a copy of my project's entire folder (just for backup purposes) and opened the .dsw file from .Net. I think it tries to convert everything as best as it can, but I think you have to use pragma_push and pragma_pop macros for MessageBox() and new (and probably a few more that I may not have had in my program).
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
Hi,
I'm writing a designer for a component, this designer is written in managed c++ and it is linked to a native dll, when i try to inherit from this component to use the designer the visual studio designer view, show this error:
The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: Class1 --- The base class 'GuiSystem.MGUIDialog' could not be loaded. Ensure the assembly has been referenced and compiled.
i think that this error because it can't find the designer dll the designer dll is linked to but i don't know how can i make it search for it in the correct path (the native dll is linked to other native dlls and they are all in the same folder with the manged designer dll).
thx
|
|
|
|
|
hi
I think it needs to reference the lib file for this dll. In that case you need to specify it in the Properties|Linker|Input|Additional dependencies for the project.
The dll needs to be in the debug/release folder, but this should get export automatically if the dependency for the projects are set correctly.
Hope this helps, but I could be wrong.
|
|
|
|
|
I'm trying to manipulate a string in a function and return the result in two subsequent arguements in the same call. Here is one version I've tried using de-referenced pointers.
In MFC I passed the 2nd and 3rd arguements in as references to the original CStrings and that worked fine.
The same approach does not work and regardless of how I do it, verb and arg in the calling function (decodeLine(..)) remain unchanged.
UInt32 verbArguement(String * line, String ** pVerb, String ** pArg)
{ // splits verb(args) into verb and (args)
int bracketPos;
String * verb = *pVerb;
String * arg = *pArg;
// pull off the word preceeding the (
bracketPos = line->IndexOf('(', 0);
if (bracketPos >= 0)
{
verb = line->Substring(0,bracketPos);
arg = line->Substring(bracketPos); // here verb == "hint" and arg == "(2,P)"
return 1;
}
else
{
fileReaderException * e = new fileReaderException(fileReaderException::ERR_NON_FILE);
throw e;
}
return 0;
}
// strLine == S"hint(2,P)"
Int32 decodeLine(String * strLine)
{
String * verb;
String * arg;
if (verbArguement(strLine, &verb, &arg))
{
// at this point verb == null and arg == null
}
}
It seems that Microsoft has done a cheap and dirty on the implementation of String, effectively making all methods constructors and letting the garbage collector clean up the mess. That is why the pass by reference approach did not work. It also seems that the semantics of pointers and de-referencing has also changed. I'm pretty sure that the above code would work in standard C++.
Does anyone have a solution?
|
|
|
|
|
|
I think it causes something to only be included once.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
also, I think it can only be used with certain versions of C++. I think it's better to use the
#ifndef SOMEVERYLONGSTRINGTHATSHOULDNOTBEASILYDUPLICATED
#define SOMEVERYLONGSTRINGTHATSHOULDNOTBEASILYDUPLICATED</code>
<code>#endif
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
can a binary tree be used to implement a parser for SQL statments??
if not, does anyone have any other ideas??
Thank you
|
|
|
|
|
Dear all,
I cannot quite understand the logic behind the notion of operator overloading.
I understand that creating a class, is like creating a new type, therefore we can overload some operators to work with that new type. For example:
Ratio& Ratio::operator=(const Ratio& r)
{
num = r.num;
den = r.den;
return *this;
} This example is absolutely comprehensible but I cannot understand how I have to think, visualize the things in order to implement operator overloading in the *, *= operator, or in the == for instance.
Consider the Ratio class as the following:
class Ratio
{
friend Ratio& operator*(const Ratio& x, const Ratio y);
public:
Ratio(int =0, int =1);
Ratio& operator=(const Ratio&);
Ratio& operator*=(const Ratio&);
private:
int num, den;
};
Here is the understanding problem:
Ratio operator*(const Ratio& x, const Ratio& y)
{
Ratio z(x.num*y.num, x.den*y.den);
return z;
}
Is this the only way to overload that operator in this example? How one has to think in order to writew the above code? What are the steps involved in order to write the above two lines of code? And secondly in the first example (operator=) the return type is a reference to the Ratio but in the second is not a reference. Why is not a reference. When should we use a reference and when not?
Please bare in mind that I understand the use of friend functions.
Thanks in advance for the help,
grscot
|
|
|
|
|
you have to consider what it means to multiply the two things together, and then impliment this in code. It's as simple as that.
BTW, you're posting in the managed C++ forum - why ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|