|
ouch! I'm glad you passed that on as I was debating a new home workstation to go along with Visual Studio 2008 and I couldn't make up my mind if I wanted the Windows 7 Professional with option to revert to XP that some stores offer. I might choose to downgrade Windows 7 to XP Professional since I have a ton of VC++ 2003 code that I honestly don't want to migrate as those programs will just die a natural slow death over time. However, in the meantime, I need to support them and will need Visual Studio 2003 installed.
I have finally got myself free of needing VC++ 6.0 but I must admit to still using it's MSDN more when looking up topics that didn't change much over the years.
thanks again.
|
|
|
|
|
I've been using Win7 for a little over a year and never want to go back to XP. Get yourself a nice VM like VMWare and map the hard drive with your dev sources. This has worked perfectly for me. I think there's a nice free VM (VirtualBox?) but I haven't tried it.
It's funny what you said about MSDN. I couldn't install VS6 on Win7, but I could install MSDN 2003, and I usually have it open on my second monitor.
I also have a macro that I use from within VS2008 that opens the Microsoft MSDN site inside a window in VS2008. Much, much faster than the builtin help.
I have converted 100's of projects from VS2005 to VS2008 with no problems. Just make a backup, and let VS2008 convert them.
|
|
|
|
|
Sure, just don't forget to install SP1, otherwise you'll be cursing the day you read my review of the product.
I use C++ extensively and I compile the same code (huge multi-project applications) on both XP Pro on my work computer and my home Win7 computer. One of my Junior Engineers uses Win Vista to work on the same code. So it does work and Win7 is WAYYYYY better than Vista! ...I do keep multiple OS's around in case I need it and for testing.
|
|
|
|
|
If you are a native code developer, the last "well packaged" version for C++ was VS2005 + SDK2003R2.
You get all what you need for native apps, plus all the native API documentation.
2008 version miss the most of the native documentation, and introduces the WPF (but with an interface that is very low performant, respect to 2005).
2010 has a pretty C++0x standard compiler, but the product around it tends to be a huge bloat.
If you are looking for a standard compiler and a IDE far less "bloated" consider MinGW as a compiler and Codeblock, Codelite or Qt-creator as an IDE.
If you need MFC, ATL etc. or all the .Net stuff, consider SharpDevelop (for C#).
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
I need a ListCtrl like this:
1. similar to CListCtrl with report style.
2. first column (label) is similar to tree item (+button line), parent item has sub-items, when user clicks first column, its sub-items will be expanded to be shown in following lines.
3. sub-items always follow parent item when sorting by any column.
Do you know an existing control like this for downloading and using?
Source code is prefered.
|
|
|
|
|
I haven't seen one exactly like that, but there are some articles here on CP about hybrid CListCtrl+CTreeCtrl. Maybe you can use that as basis for what you need.
|
|
|
|
|
|
I'm starting a mpeg4 video player project. The concept could be easy so as use winmm.dll library in a VB project or VC++, however I need to develop a player more specific and that is the meaning of the my question.
Mpeg defines streams of 188bytes within file, each stream has diferent purpose depending on its ID, e.g. video, audio language1, adio lang 2, subtitle.... I use this mechanism to store information obtained after processing the video. The process add an specific stream with the results (they are x-y coordinates of the position of some objects). Is the easiest way to have synchronized data with the video.
What I want to do now is to develop a video player able to reproduce the modified mpeg adding a layer with the marks defined by x-y coordinates. A similar mechanism as the subtitles.
Which could be the best way to start this project? The APIs that I found open directly the file and reproduce the video as winmm.dll and VLC dlls. The solution seems to be open source like VLC code or OpenCV libraries
Any recomendation for this challenge?
|
|
|
|
|
If your platform is windows, how about DirectShow[^], and DirectShow filters[^] particularry?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
I google that but not get answer, Can anyone help me ?
|
|
|
|
|
Google for gdi+ or gdiplus and its Image or Bitmap class and handle WM_PAINT (OnPaint) in your view. I hope this is enough to get you started.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
You could try CImage[^] with CImage::Load(), and CImage::Draw().
|
|
|
|
|
Here is what i am trying to do: create kind of a "supervisor class". Lets say, we got a class named "Parent", and, a class named "Child". Before initializing a "Child", we need to init "Parent" first. Parent has a boolean variable, which is going to be set to TRUE while initializing Parent class. Parent also has a function and a structure, which (function) should collect integers (into a structure), passed from Child class and then do some manipulations on these ints. So first, we initialize Parent, which sets boolean var to true. Next we initialize Child, which checks if Parent's boolean var is true. If it is, Child calls Parent's "collect" function and passes some random ints to it.. So my first approach was a creation of nested classes (here is some offtopic example):
class xxx
{
protected:
int x;
int y;
private:
public:
int ddd;
class ccc
{
protected:
private:
public:
int sad()
{
printf("%d\r\n", ddd);
}
ccc(){}
~ccc(){}
};
xxx()
{
ddd = 0;
x = 10;
y = 11;
}
~xxx()
{
x = 0;
y = 0;
}
};
In ccc::sad i cannot access var ddd from class xxx. Okay, so i have made it static. Now compiler is not pleased at all:
error LNK2001: unresolved external symbol "public: static int xxx::ddd" (?ddd@xxx@@2HA)
Alright, trying something different (this example is pretty much close to that, what i am about to achieve) :
namespace Some
{
class q
{
public:
typedef struct _H
{
int l[];
}
H;
H *h;
int e;
BOOL g;
int inc_e(int i)
{
e++;
h->l[e] = i;
printf("i = %d\r\n", i);
return 1;
}
int o()
{
printf("%d\r\n", e); return e;
}
q(){ e = 0; g = TRUE; }
~q(){ e = 0; g = FALSE; }
};
class w : q
{
public:
int i;
int inc()
{
if(g)
{
i++;
inc_e(i);
}
return 0;
}
int some()
{
printf("%d\r\n", e); return 0;
}
w(){ i = 0; }
~w(){}
};
}
But that is all wrong again and i dont know again
How to create such relation between two classes, so one can watch over another? I have tried some other ways, some simple things, like:
declare a variable in 1 class, then inherit another class from 1 class, then increment that val in child class. For example we got
int a = 1; in Parent class.
Incrementing this same "a" in a child, which inherits from parent (a++) class and then print out - fine, it increments in child class.
But it stays the same in Parent class (a = 1).
Thanks
011011010110000101100011011010000110100101101110
0110010101110011
|
|
|
|
|
To declare a variable as static, you must define the variable in 1 and only 1 source file.
class xxx {
public:
static int ddd;
};
int xxx::ddd = 0;
This solution only allows a single instance of the class xxx .
To be able to access a variable from another class instance the class pointer is required. You can push this into the child class when it is created.
class xxx {
protected:
int x;
int y;
private:
public:
int ddd;
class ccc {
protected:
private:
xxx *m_pParent;
public:
int sad() {
printf("%d\r\n", m_pParent->ddd);
}
ccc(xxx *pParent) : m_pParent(pParent) {}
~ccc(){}
};
xxx() {
ddd = 0;
x = 10;
y = 11;
}
~xxx() {
x = 0;
y = 0;
}
};
An even better solution would be to declare class ccc a friend of class xxx so so you can make the variable int ddd protected or private.
|
|
|
|
|
Thanks Andrew, you helped me out once again.
011011010110000101100011011010000110100101101110
0110010101110011
|
|
|
|
|
While your inquiry is already marked as solved, I wonder if you are really doing the right thing.
First of all, why use a nested class? I've never ever seen a problem that would require such a construction. For the purpose of reusability and information hiding, defining these two classes seperately would always be the better solution. If there are circular dependencies you can get around them with forward declarations.
Second, if you want to access a variable from another class, the best way is to write an accessor for it, rather than making the variable public.
Third, what you described last, i. e. inheriting your Child class form the Parent class, was wrong for at least two reasons: first, an instance of the Child class is not a Parent, and that would be what inheritance would imply. Second, the Parent instance would become part of every child instance, so you'd have an individual Parent object for each child, and each would only have this particular child that it is part of - that is why you always got a==1 .
Fourth, one of your ideas was to use static variables. But if you do that, you can only ever have one parent object. If that is what you want, and you are sure you will never ever need several different parents, each with their own children, then you can make Parent a singleton class. You could then solve your problem like that:
class Parent {
private:
int sum;
Parent() : sum(0) {}
Parent(const Parent&) {}
Parent& operator=(const Parent&) {}
public:
static Parent* get();
void work(const class Child& child);
int sum() const { return sum; }
};
class Child {
private:
int x;
public:
Child(int a);
int value() const { return x; }
};
#include "Parent.h"
#include "Child.h"
static Parent* theParent = 0;
Parent* Parent::get() {
if (theParent==0)
theParent = new Parent;
return theParent;
}
Parent::work(const Child& child) {
sum += child.value();
}
#include "Child.h"
#include "Parent.h"
Child::Child(int a) : x(a) {
Parent* parent = Parent::get();
parent->work(*this);
}
#include "Child.h"
#include "Parent.h"
void test() {
Child abe(3), bert(4), chris(5);
printf("sum=%d\r\n", Parent::get()->sum()};
}
This implementation may also use the Child class without ever referring to the Parent class, and vice versa, i. e. you could produce children in one module and query the Parent in another, and you'd still get correct results.
[edit]Added missing implementation for work[/edit]
modified on Monday, February 7, 2011 8:55 AM
|
|
|
|
|
Hi all,
i m using EditBox with multiline option.
i want to use text formating option like Bold,Italic,Underline etc,please tell me how can i use it in EditBox
if possible please explain me with example.
please help me for this.
thanks in advance.
|
|
|
|
|
you need to use a rich edit control, which is an extension to the edit control. This is the control that you get in wordpad.
If you are using MFC there is a class CRichEdit[^].
This can mostly be used like a standard edit control, however yo set or get the text you need to use streaming functions otherwise the markup will show as plain text.
see CRichEditCtrl::StreamIn[^] for setting the text and CRichEditCtrl::StreamOut[^] for reading text with its formatting tags
An alternate would be a html control. There are quite a few articles on codeproject with samples.
|
|
|
|
|
C language program.
Project launched three stepper motor, uln2803, parallel port.
|
|
|
|
|
|
|
Hi
I need help...
I have an array of string private variable List<String^>^ CalculateGreeks_; having property for get and set List<String^>^ CalculateGreeks() in a class CArgsRequestCredential,
I want to put these variables
PV,Delta,Vega
in my local object
<b>ReqCredObj_ = gcnew Args::CArgsRequestCredential();</b>
first i need to split strings saving each string in a variable and then storing variables in the list..
my code is
<b>List<String^>^ CalculateGreeks1 = gcnew List<String^>();
for(int i = 0 ; i <= LocalArray->GetUpperBound(0);i++)
{
//
//CalculateGreeks1->Add(ii);
String^ Test = Convert::ToString(LocalArray->GetValue(i,0));
array <String ^>^ strings = Test->Split(',');
//ii = gcnew List<String^>^ CalculateGreeks_();
//ii->CalculateGreeks = Convert::ToString(strings);
// CalculateGreeks1->Add(strings);
// ReqCredObj_->CalculateGreeks = Convert::ToString(LocalArray->GetValue(0,1));
}
</b>
but my logic is not giving correct values
kindly help
|
|
|
|
|
This has already been posted to the Managed forum.
I must get a clever new signature for 2011.
|
|
|
|
|
around 100,000 items are added to a CListCtrl.
before adding, I call ShowWindow(SW_HIDE), this function reduces nearly 1/6 time used.
LockWindowUpdate() and ValidateRect() do not reduce time at all.
Do you have idea to add huge items to CListCtrl faster?
|
|
|
|
|
1. Call SetRedraw(FALSE) before adding
2. For best possible speed use virtual listctrl
|
|
|
|
|