|
if you are talking about ATL com, yes.
Then you need to take care of data been exchanged between VB and COM.
I dont remember where, but somewhere I have read on how to write a COM object in VC for VB.
-prakash
|
|
|
|
|
I'm having to develop an application that keeps track of horses with their winnings and other such information dealing with horse races. We only have to track 3 horses, but what if there were 100 horses, which it'll have to do eventually? I don't want to have to type HorseName.ShowStatistics that many times. Is there a way to loop through the horse objects and run that specific objects method within the loop? How would I go about doing that?
Thanks
|
|
|
|
|
Horses oHorses[100];
or Horses *pHoress = new Horses[100]
<<Initialise the horses members>>
for(i=0;i<100;i++)
{
pHorses[i]->ShowStat();
}
-prakash
-- modified at 21:41 Thursday 6th October, 2005
|
|
|
|
|
To complete previous response, you can use the vector from the STL. This will allow you to have an array of objects (Horses in your case) where you can dynamically add and remove elements.
|
|
|
|
|
I compile the following C++ code VS.NET2003 IDE and the compiler enter an infinit/endless compiling process, What's wrong within it?
The code is given as following:
//The testtempl.h
#ifndef __TESTTEMPL_H__
#define __TESTTEMPL_H__
#include <stdlib.h>
#include <stdio.h>
#include <vector>
template<int n> class MyTempl
{
public:
std::vector<int> m_array;
public:
MyTempl()
{
m_array.assign(n, n);
}
int Summation()
{
int rn = 0;
for(int i = 0; i < (int)m_array.size(); i++)
rn += m_array[i];
return rn;
}
int Foo()
{
if(n <= 1)
return 1;
else
{
int r = 0;
MyTempl<n-1> mtempl;
r = mtempl.Foo()*Summation();
return r;
}
}
};
typedef MyTempl<4> My4Foo;
#endif
//The testtempl.cpp file
#include "testtempl.h"
int main(int argc, char* argv[])
{
My4Foo myfoo;
int i = myfoo.Foo();
printf("foo value: %u\n", i);
return 0;
}
-- modified at 19:25 Thursday 6th October, 2005
|
|
|
|
|
First of all, check 'do not treat < as html' below, so we can SEE the code
I think this line
MyTempl<n-1> mtempl;
means that every time the compiler creates a template class, it needs to create a new one, recursively forever. Hence the error.
Christian Graus - Microsoft MVP - C++
-- modified at 18:51 Thursday 6th October, 2005
|
|
|
|
|
I haven't tested it, but I think one way to avoid the problem while maintaining the recursive nature of the solution would be to do as follows:
In the class declaration, declare only the prototype for the Foo method:
int Foo();
Then, provide a general implementation for Foo():
template<int n>
int MyTempl::Foo()
{
int r = 0;
MyTempl<n-1> mtempl;
r = mtempl.Foo()*Summation();
return r;
}
Finally, provide an explicit implementation for the 1 case, so as to end the recursion:
template<1>
int MyTempl::Foo()
{
return 1;
}
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Kinda offtopic question;
Whenever I startup Windows Media Center, the actual program, not the OS, Visual C++ starts up and starts debugging. Everytime (I think its called ehShell.exe), the debugger starts up. Its slowing down the computer significantly. Is there anyway to stop this from doing it? Thanks alot
Dave
|
|
|
|
|
Anyone know of a good book covering Boost?
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.
|
|
|
|
|
There are books on some Boost libraries, like Graph, and metaprogramming, but AFAIK, no book covers "all Boost".
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
|
hi guyz
i am a complete begginer in programming stuff and it seems like i am stuck in a very bad situation, tht i have to do a project in c "motion capturing and detection"
now cause i ama compplete begginer....
i need ur help in these... plz help me by sending any good information or algorithm related this topic...
plzz i need ur help
u can also email me.
sH*t haPPeNs
|
|
|
|
|
It's a pity. So many interests, but no idea...
|
|
|
|
|
You little scumbag! I got your name, I got your ass! You will not laugh, you will not cry, you will learn by the numbers, I will teach you! Now get up off your face! Col.Walter.E.Kurtz you better unfuck yourself before I unscrew your head and sh*t down your neck!
Now choke yourself.
|
|
|
|
|
I've seen horrors... horrors that you've seen. But you have no right to call me a murderer. You have a right to kill me. You have a right to do that... but you have no right to judge me.
Horror and moral terror are your friends. If they are not then they are enemies to be feared.
|
|
|
|
|
Col.Walter.E.Kurtz, you climb obstacles like old people f***.
Now choke yourself.
|
|
|
|
|
I watched a snail crawl along the edge of a straight razor. That's my dream. That's my nightmare. Crawling, slithering, along the edge of a straight... razor... and surviving.
Horror and moral terror are your friends. If they are not then they are enemies to be feared.
|
|
|
|
|
I'll bet you're the kind of guy that would f*** a person in the ass and not even have the goddam common courtesy to give him a reach-around. I'll be watching you.
Now choke yourself.
|
|
|
|
|
You're an errand boy, sent by grocery clerks, to collect a bill.
Horror and moral terror are your friends. If they are not then they are enemies to be feared.
|
|
|
|
|
I am Gunnery Sergeant Hartman, your senior drill instructor. From now on you will speak only when spoken to, and the first and last word out of your filthy sewer will be sir.
Now choke yourself.
|
|
|
|
|
Gunnery Sergeant Hartman wrote:
I am Gunnery Sergeant Hartman, your senior drill instructor. From now on you will speak only when spoken to, and the first and last word out of your filthy sewer will be sir.
Is this your play ground..? Shut Up and get to your work (what ever you do).... disrespectful and rude language is not allowed here.. for any so called reason...?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
-- modified at 0:31 Friday 7th October, 2005
|
|
|
|
|
There are some examples of video capture here[^] as to the detection is this motion or shape? This is more specialist so maybe searching MDSN will help. If not, a careful Google search is next.
Elaine
The tigress is here
|
|
|
|
|
hi..
I'm using MySQL and c++.
I used CDatabase and CRecordSet to access database.
I am trying to get the columns names from the given tables.
I look at the sql code and found
--> show columns from tableName; gives all the column names, type (int or memo..etc) etc.
----------------------------
column1 | column2 | column3 |
----------------------------
data1 | data2 | data3 |
----------------------------
In c++ using CRecordSet .. how am I going to get column names?
which are column1, column2, column3.
|
|
|
|
|
CRecordset has a GetODBCFieldInfo function that you can use to get the information on the fields such as the name of the field (column).
If a wizard fails to cast an enchantment correctly, is that a mis-spelling?
Never argue with an idiot. They will drag you down to their level where they are an expert.
|
|
|
|
|