|
|
Thanks for your quick replies. I will work on the solutions presented. The articles on writing GPS apps seems to be in visual basic, not c++, but I think I may be able to convert the code. As with most things, what seems to be easy is hard and hard is easy. Thanks. I'll post the completed code if I get it running.
|
|
|
|
|
All the best
|
|
|
|
|
Jimmie Sypolt wrote: I'm using the following code...
Which looks like Managed C++. Correct?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi, how can I write the code for the constructor and destructor of this class
class ThreeD{
public:
ThreeD(int=5, int=5, int=5);
~ ThreeD( );
private:
int *** data;
int l, w, d; };
thank you
modified on Thursday, March 25, 2010 10:50 PM
|
|
|
|
|
Actually, I think the design of your class "ThreeD" is terrible.
If you are sure to implement it, the follow is for you.
class ThreeD
{
public:
ThreeD(int _l=5, int _w=5, int _d=5)
: l(_l), w(_w), d(_d)
{
data = new int**[l];
for (int i=0; i<l; ++i)
{
data[i] = new int*[w];
for (int j=0; j<w; ++j)
{
data[i][j] = new int[d];
memset(data[i][j], 0, d*sizeof(int));
}
}
}
~ThreeD()
{
for (int i=0; i<l; ++i)
{
for (int j=0; j<w; ++j)
{
delete [] (data[i][j]);
}
delete [] (data[i]);
}
delete [] data;
}
private:
int*** data;
int l, w, d;
};
|
|
|
|
|
zakria81 wrote: Hi, how can I write the code for the constructor and destructor of this class
Your question is vague at best. Given what little you've provided, you can implement them any way you wish. Have a look at the "How to ask a question" thread on the first page of this forum.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I'm almost brand new to C++ so I'm hoping someone can help me out. I'm creating a Windows Form application, and I want to display the current time in place of some static text I was using as one of my Label controls. I've spent some time poking around and I think I'm missing something basic.
I was trying something like this:
this->label1->Text = System::DateTime::Now;
and something a little more complexe like this:
this->label1->Text = (System::DateTime::Now.ToString("T"));
But no matter how I manipulate the line, either the code editor or the design editor within Visual Basic Studio barks at me.
So can someone help me out here and let me know what I'm missing? My goal is to just have something like "5:11:45 PM" show as my Label control when the form is displayed.
Thanks!
|
|
|
|
|
Doesn't a label control have member Caption rather than Text ?
|
|
|
|
|
I believe the original post is using Windows Forms in which the label control has Text property instead of Caption property.
|
|
|
|
|
Hi Lucidation,
I think, u are now in the wrong place.
|
|
|
|
|
You mentioned "Visual Basic Studio", but your code seems to be C++.
What was the message that the "code editor" or the "design editor" showed? Please provide the message here so we can have a better understanding of the problem.
|
|
|
|
|
ask this question in Managed C++/CLI forums
|
|
|
|
|
I posted my question in the other forum (adding some additional info as suggested). Thanks!
|
|
|
|
|
Sqlcmd isn't available. MFC application.
The user tells the application that the server he wants to install the database and tables are on a different machine. So I have a script which I could load into memory and run. It would be nice to call sqlcmd -S ... -i filename however it isn't available.
Any thoughts??
Thanks!
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
Are you using a DSN? I know those can refer to remote machines.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
It's a DSNless connection.
I'm thinking of installing sqlcmd on the users machine. Just seems like overkill! Wish CDatabase::ExecuteSQL handled a file.
Thanks,
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
I am trying to create an ActiveX control that contains another ActiveX control. I have succeeded up to the point where the included control is displayed on my control when I put my control onto a test project's dialog box.
The contained control is an element of a property page. I wanted to add a variable to the property page so that I could manipulate the contained control. (To start, I wanted to resize it when the container is resized.) I have another control developed in Visual C++ 6.0 that contains the same control that my new project is trying to contain. In VC6, when I created a variable for the contained control, the Class Wizard recognized that the contained control needed a large number of interfaces and classes, and it created a hundred or so files to define them. But in VS 2008, when I tried to add a variable to refer to my contained control, I got a single class definition for my control, but none of the interfaces or classes that control needs. Why not? What do I have to do to get VS 2008 to build the complete control and everything it needs?
As a simpler test, I created a dialog-based MFC application project and put my contained control directly onto its dialog. When I right-clicked on the control and selected Add Variable, I noticed that the drop-down list contained all of the interfaces that the contained control would need. But I selected the top entry in the list, which was "control". After clicking OK, VS 2008 generated a single class for me, named CActiveGanttVCCtrl1. I tried building the project and got a large number of errors. The file ActiveGanttVCCtrl1.h contained the following:
IclsTasks * GetTasks()
{
IclsTasks * result;
GetProperty(0x1, VT_DISPATCH, (void*)&result);
return result;
}
void SetTasks(IclsTasks * propVal)
{
SetProperty(0x1, VT_DISPATCH, propVal);
}
The compiler claims that the IclsTasks interface (and many others) is not defined. Yes, that's true. VS 2008 didn't automatically generate it. Why not? What do I have to do to get it to be generated for me?
Thank you very much!
RobR
|
|
|
|
|
Hello,
Is there any way of tracking what elements were moved where during a vector sort?
Thanks,
|
|
|
|
|
Create a map (or something like that) of items vs. index before the sort, and create a map of items vs. index after the soft and compare both maps.
I'm certain there are more smarter ways of doing it.
Watched code never compiles.
|
|
|
|
|
how about creating a clone of the vector before sorting it, then compare the clone with the sorted vector, one element at a time?
|
|
|
|
|
yep, you see, smarter than me.
Watched code never compiles.
|
|
|
|
|
Not sure about smarter, my approach just is simpler, more straightforward. Keep it simple!
|
|
|
|
|
I show a progress meter for searching through files in directory, but while the meter is updating, I get the round donut wheel mouse. How do I make the cursor look normal while the meter is updating?
modified on Thursday, March 25, 2010 12:51 PM
|
|
|
|
|
Probably you should perform your search in a worker thread.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|