|
Sauce! wrote: I'm under the impression it means working with the .net framework?
Correct.
Sauce! wrote: So am I meant to be using the standard template library in a native c++ project or not?
Yes. What I can't figure out is why you're getting an error that mentions
STL/CLR (which is for managed .NET code) if you're not compiling code managed.
Can you post some sample code using an STL list class that
fails?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
"can you post some sample code using an stl list class that fails?"
#include list
NOTE: I left out the <> tags around list on purpose as the forums were interpreting it as a html list tag.
lol seriously I just opened up a new project in visual studio, chose the "empty project" option, added an empty "main.cpp" and typed that one line and voila! I get the same bloody error!
So something is very wrong. :S happens in both release and debug mode.
Just to check, I created a second empty project, but chose "CLR empty project" instead, pasted the same code into the empty "main.cpp" file, and compiled. I got the following errors:
Error 1 error C2039: 'input_iterator_tag' : is not a member of 'std' C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\cliext\xutility 295
Error 2 error C2039: 'output_iterator_tag' : is not a member of 'std' C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\cliext\xutility 302
Error 3 error C2039: 'forward_iterator_tag' : is not a member of 'std' C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\cliext\xutility 309
Error 4 error C2039: 'bidirectional_iterator_tag' : is not a member of 'std' C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\cliext\xutility 316
Error 5 error C2039: 'random_access_iterator_tag' : is not a member of 'std' C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\cliext\xutility 323
Error 6 error C2039: '_Int_iterator_tag' : is not a member of 'std' C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\cliext\xutility 330
This is quite strange...
|
|
|
|
|
Is the STL even included with the express edition of VS?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes, it is... *hmmm*
Further testing reveals that this occurs with the vector template class as well. I'd say it's safe to say that any of the STL classes would have the same problem.
I came across something strange in the project's property pages;
http://img135.imageshack.us/my.php?image=64369996db3.jpg[^]
EDIT: Nevermind, this option became greyed out when I removed the /clr switch. I'm still getting compile errors telling me I must compile with /clr though :S
DOObLEY EDOOT:
FINALLY!
I found the culprit. In my project settings "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\cliext" had somehow made it's way into the include directories. I removed it and now it's compiling fine :] How did it get in there? Probably something to do with my own stupidity :P
Third edit:
Apparently I NEED that include directory or I miss out on all the windows libraries wtf?
modified on Wednesday, September 10, 2008 12:13 AM
|
|
|
|
|
|
You must declare extern the g_Info in the MyInfoArrayClass.h header, under the declaration of the class (or add a forward declaration of your class above the const extern CMyInfoArrayClass g_Info;).
|
|
|
|
|
Hello all,
I am using Extended MAPI to retrieve Outlook Contact information. I am able to get most of the fields.
But i am not able to get below list to fields for Contact Item.
1. IM Address
2. Picture of the Contact
3. Business Card information
4. Country for Phone numbers
Is there any body who can help me out on this?
Thanks and Regards,
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
I everyone.
I'm trying to implement Hierarchy in a school project.
Here's the design:
Class A has 2 child classes B and C.
Class A
{
protected:
string date;
string hour;
string type;
public:
(...)
}
Class B : public A
{
protected:
string outflow
public:
(...)
}
Class C : public A
{
protected:
string inflow
string store
public:
(...)
}
To build a new B object I do somethinh like:
A *a; <br />
a = new B(date, hour, type, outflow)
At this point I think everything is working...
My question is: when I want to add an object to a list what do I do?
Do I have to create 2 lists? One for B and one for C?
I created just one for type A, but the problem is that if I create a B object I won't be able to add the "outflow" in the list.
Thanks!
"Failure is always an option."
|
|
|
|
|
u should add in list refrence of B stored in a (that is of type A)
|
|
|
|
|
Hi,
How you are calling like this?
a = new B(date, hour, type, outflow);
There is no any constructor in the class...
The price of anything is the amount of life you exchange for it.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
Hi.
That was the problem.. now i use another constructor and I solve my problem.
B * b = new B (date, hour, type, outflow); .
Thanks for your help.
Cheers!
"Failure is always an option."
|
|
|
|
|
FrankMookie wrote: Do I have to create 2 lists? One for B and one for C?
That's were polymorphism comes in handy: you just create a list which contains pointers to A objects. As B objects and C objects are also A objects, you can add pointers to B and C objects to your list.
Of course, you probably would like to differenciate them in a certain way (suppose that you want to print different information for B and for C), then this specialization can be done throuhg virtual functions. You define a virtual Print function in A and redefine for B and for C. Now, you can walk over your list and call the print function, which will be redirected to the correct B or C function depending of the type of your class.
|
|
|
|
|
The *.exe is built with VC in my computer,it can work with the database on the server in my computer,but when copy it to the other computer,it doesn't work.The DLL which it need is already copied with the *.exe.When click the *.exe in the other computer,nothing occurs.What should I do?
|
|
|
|
|
aygrhnwms304 wrote: nothing occurs
Nothing at all?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
When I doubleclick the *.exe,Nothing occurs,yes,nothing,and no mistake,only no sense.
|
|
|
|
|
Whats your Operating system and computer that you run your program?
|
|
|
|
|
The OS is WinXP SP2,the version of the VC is the Visual C++ 6.0.
|
|
|
|
|
For VC6, there're several things you need to take into account. First thing is to always distribute a release version of your software. Then you need to make sure to distribute the dll's that your program depends on (you can use a tool called Dependency Walker to verify which dll's you need to distribute with your app).
Anyway, I don't think this is the problem (you would have got an error message). This typically happens when your application is using an ActiveX control that is not registered on the target machine. Are you using any specific ActiveX control ? If yes, make sure to distribute it with your app and to register it on the target machine.
|
|
|
|
|
Thank you.
Yes,just as you said,I used the ActiveX control as:DataGrid and Adodc.But I don't know how to distribute it with my app and how to register on the target machine.What should I do?
|
|
|
|
|
I think the easiest way is to use InnoSetup[^]. This is an installer with which you are able to register ActiveX controls during the installation.
|
|
|
|
|
Hi,
You may be having the MFC DLLs to support the EXE file.
This is because of the Operating system you are using.
The price of anything is the amount of life you exchange for it.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
Thank you.
I am just looking for the DLLs.Do you have the more useful method?
|
|
|
|
|
Use Dependency Walker & scan the executable.This will find out in case if you are missing any needed DLLs.
Regards,
Rane
|
|
|
|
|
I Need to access a File, where only One instance of an App has Read/Write Access, and where all other instances have read access only.
I First try to Open as Follows:-
m_hFile=CreateFile(FileName,GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ,NULL,OPEN_EXISTING,
FILE_FLAG_WRITE_THROUGH,NULL);
and designate some Internal State as MASTER.(i.e.: It can Change the File)
if I get a Share Violation, I try:-
m_hFile=CreateFile(FileName,GENERIC_READ,
FILE_SHARE_READ,NULL,OPEN_EXISTING,
FILE_FLAG_RANDOM_ACCESS,NULL);
and Designate some Internal State as SLAVE. (it can only Monitor the File)
GetLastError reports a Share Violation when I try to open a second Instance, even though I only try to open it for reading.
What am I doing wrong.
Regards,
Bram van Kampen
|
|
|
|
|
According to the table here[^], if you first open the file
using
GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ
then subsequent opens need to use
GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|