|
Thanks for reply
|
|
|
|
|
Can you guys give me the basic simple code you need for a simple shape to move or rotate? I asked my teacher to help me because I want to get into c++ but he won't and I just don't get the book explanations. All I need is a basic short code that will work and make a shape rotate and understand how it all works and I can work with what the book tells me. Thanks SO MUCH.
|
|
|
|
|
We need way more information to answer this question. C++ has no built in graphics so what platform are you using? MFC, WIN32 API, DirectX ...
Are the shapes 2d or 3d?
Also this is the forum for managed C++ which is probably not what you want.
John
|
|
|
|
|
Hi all,
I've just started to do some programming in MC++. I'm trying to use the string class, but I'm running into a problem whenever I try to concat strings. I'm using the + operator, but I always get "error C2845: '+' : cannot perform pointer arithmetic on __gc pointer 'System::String __gc *'. Now to the best of my knowledge (which is little in MC++) you have to declare variables as pointers when using reference types.
Is it possible to use the + operator to concat strings or must you use the Concat function?
As well how do you subscribe to an event? I've tried this code:
m_time->Elapsed += new ElapsedEventHandler (OnTimer); but receive "error C3350: 'System::Timers::ElapsedEventHandler' : a delegate constructor expects two arguments. This is how I did it in C# so I'm not sure what I'm missing here.
One last question: What's the equivalent of null ? I've tried using null in this way m_szUser != null , but receive an error that "null" is an undeclared identifier
Any and all help is very much appreciated.
- monrobot13
|
|
|
|
|
HOW TO TURN $6 INTO $6,000!!!!!!
READING THIS COULD CHANGE YOUR LIFE!
I found this on a bulletin board and decided to try it. A
little
while back, I was browsing through newsgroups, just like you
are now,
and came across an article similar to this that said you
could make
thousands of dollars within weeks with only an initial
investment of
$6.00! So I thought, Yeah right, this must be a scam,but
like most of us, I was curious, so I kept reading. Anyway, it
said
that you send $1.00 to each of the 6 names and address stated
in the
article. You then place your own name and address in the
bottom of
the list at #6, and post the article in at least 200
newsgroups.
(There are thousands) No catch, that was it. So after
thinking it
over, and talking to a few people first, I thought about
trying it. I
figured: what have I got to lose except 6 stamps and $6.00,
right? Then I invested the measly $6.00. Well GUESS WHAT!!...
within 7 days, I started getting money in the mail! I was
shocked! I
figured it would end soon, but the money just kept coming in.
In my
first week, I made about $25.00. By the end of the second
week I had
made a total of over $1,000.00! In the third week I had over
$10,000.00 and it's still growing. This is now my fourth week
and I
have made a total of just over $42,000.00 and it's still
coming in
rapidly. It's certainly worth $6.00, and 6 stamps, I have
spent more
than that on the lottery!! Let me tell you how this works and
most
importantly, why it works....Also, make sure you print a copy
of this
article NOW, so you can get the information off of it as you
need it.
I promise you that if you follow the directions exactly, that
you
will start making more money than you thought possible by
doing
something so easy!
Suggestion: Read this entire message carefully! (print it out
or
download it.) Follow the simple directions and watch the
money come in!
It's easy. It's legal. And, your investment is only $6.00
(Plus postage)
IMPORTANT: This is not a rip-off; it is not indecent; it is
not
illegal; and it is virtually no risk - it really works!!!!
If all of the following instructions are adhered to, you will
receive
extraordinary dividends.
PLEASE NOTE:
Please follow these directions EXACTLY, and $50,000 or more
can be
yours in 20 to 60 days. This program remains successful
because of
the honesty and integrity of the participants. Please
continue its
success by carefully adhering to the instructions.
You will now become part of the Mail Order business. In this
business
your product is not solid and tangible, it's a service. You
are in
the business of developing Mailing Lists. Many large
corporations are
happy to pay big bucks for quality lists. However, the money
made
from the mailing lists is secondary to the income which is
made from
people like you and me asking to be included in that list.
Here are the 4 easy steps to success:
STEP 1: Get 6 separate pieces of paper and write the
following on
each piece of paper;PLEASE PUT ME ON YOUR MAILING LIST. Now
get 6 US $1.00 bills and place ONE inside EACH of the 6
pieces of
paper so the bill will not be seen through the envelope (to
prevent
thievery). Next, place one paper in each of the 6 envelopes
and seal
them. You should now have 6 sealed envelopes, each with a
piece of
paper stating the above phrase, your name and address, and a
$1.00
bill. What you are doing is creating a service. THIS IS
ABSOLUTELY
LEGAL! You are requesting a legitimate service and you are
paying for
it! Like most of us I was a little skeptical and a little
worried
about the legal aspects of it all. So I checked it out with
the U.S.
Post Office (1-800-725-2161) and they confirmed that it is
indeed
legal! Mail the 6 envelopes to the following addresses:
1. Richard Horman- 1731 Frost Ave. Maplewood, MN 55109
2. Carlos De La Torre- 1969 West Dr. Vista, CA 92083
3. W. Green- P.O. Box 239 Apopka, FL 32704
4. B. Ledford- 3011 Boulevard PL Indianapolis, IN 46208
5. Ky Campbell- 5807 Shetland Way Waterford MI 48327
6. Kelly Foster- 2814 Pine St. Bethel Park, PA 15102
STEP 2: Now take the #1 name off the list that you see above,
move
the other names up (6 becomes 5, 5 becomes 4, etc...) and add
YOUR
Name as number 6 on the list.
STEP 3: Change anything you need to, but try to keep this
article as
close to original as possible. Now, post your amended article
to at
least 200 newsgroups. (I think there are close to 24,000
groups) All
you need is 200, but remember, the more you post, the more
money you make!
This is perfectly legal! If you have any doubts, refer to
Title 18
Sec. 1302 & 1341 of the Postal lottery laws.
Keep a copy of these steps for yourself and, whenever you
need money,
you can use it again, and again.
PLEASE REMEMBER that this program remains successful because
of the
honesty and integrity of the participants and by their
carefully
adhering to the directions. Look at it this way. If you are of
integrity, the program will continue and the money that so
many
others have received will come your way.
NOTE: You may want to retain every name and address sent to
you,
either on a computer or hard copy and keep the notes people
send you.
This VERIFIES that you are truly providing a service. (Also,
it might
be a good idea to wrap the $1 bill in dark paper to reduce
the risk of mail theft.)
So, as each post is downloaded and the directions carefully
followed,
six members will be reimbursed for their participation as a
List
Developer with one dollar each. Your name will move up the
list
geometrically so that when your name reaches the #1 position
you will
be receiving thousands of dollars in CASH!!! What an
opportunity for
only $6.00 ($1.00 for each of the first six people listed
above) Send
it now, add your own name to the list and you're in business!
---DIRECTIONS ----- FOR HOW TO POST TO NEWSGROUPS------------
Step 1) You do not need to re-type this entire letter to do
your own
posting. Simply put your cursor at the beginning of this
letter and
drag your cursor to the bottom of this doent, and
select 'copy'
from the edit menu. This will copy the entire letter into the
computer's memory.
Step 2) Open a blank 'notepad' file and place your cursor at
the top
of the blank page. From the 'edit' menu select 'paste'. This
will
paste a copy of the letter into notepad so that you can add
your name
to the list.
Step 3) Save your new notepad file as a .txt file. If
you want to do your postings in different settings, you'll
always
have this file to go back to.
Step 4) Use Netscape or Internet explorer and try searching
for
various newsgroups (on-line forums, message boards, chat
sites,
discussions.)
Step 5) Visit these message boards and post this article as a
new
message by highlighting the text of this letter and selecting
paste
from the edit menu. Fill in the Subject, this will be the
header that
everyone sees as they scroll through the list of postings in a
particular group, click the post message button. You're done
with
your first one! Congratulations...THAT'S IT! All you have to
do is
jump to different newsgroups and post away, after you get the
hang of
it, it will take about 30 seconds for each newsgroup!
**REMEMBER, THE MORE NEWSGROUPS YOU POST IN, THE MORE MONEY
YOU WILL MAKE!! BUT YOU HAVE TO POST A
MINIMUM OF 200**
That's it! You will begin receiving money from around the
world within days! You may eventually want to rent a P.O.Box
due to the large amount of mail you
will receive. If
you wish to stay anonymous, you can invent a name to use, as
long as
the postman will deliver it.
**JUST MAKE SURE ALL THE ADDRESSES ARE CORRECT.**
Now the WHY part:
Out of 200 postings, say I receive only 5 replies (a very low
example). So then I made $5.00 with my name at #6 on the
letter. Now, each of the 5 persons
who just sent me $1.00 make the MINIMUM 200
postings, each with my name at #5 and only 5 persons respond
to each
of the original 5, that is another $25.00 for me, now those
25 each
make 200 MINIMUM posts with my name at #4 and only 5 replies
each, I
will bring in an additional $125.00! Now, those 125 persons
turn
around and post the MINIMUM 200 with my name at #3 and only
receive 5
replies each, I will make an additional $626.00! OK, now here
is the
fun part, each of those 625 persons post a MINIMUM 200
letters with
my name at #2 and they each only receive 5 replies, that just
made me
$3,125.00!!! Those 3,125 persons will all deliver this
message to 200
newsgroups with my name at #1 and if still 5 persons per 200
newsgroups react I will receive $15,625,00! With an original
investment of only $6.00! AMAZING! When your name is no
longer on the
list, you just take the latest posting in the newsgroups, and
send
out another $6.00 to names on the list, putting your name at
number 6
again. And start posting again. The thing to remember is: do
you
realize that thousands of people all over the world are
joining the
internet and reading these articles everyday?, JUST LIKE YOU
are
now!! So, can you afford $6.00 and see if it really works?? I
think
so... People have said, "e;what if the plan is played out and
no
one sends you the money? So what! What are the chances of that
happening when there are tons of new honest users and new
honest
people who are joining the internet and newsgroups everyday
and are
willing to give it a try? Estimates are at 20,000 to 50,000
new
users, every day, with thousands of those joining the actual
internet.
Remember: play FAIRLY and HONESTLY and this will really
work.
|
|
|
|
|
Thanks, but that wasn't really the kind of help I was looking for.
- monrobot13
|
|
|
|
|
NULL question:
1. Use zero instead of NULL: m_szUser != 0
2. Or, include the header file 'tchar.h' which defines 'NULL'.
Event question:
__delegate void SaySomethingHandler(String *message);
__gc class EventSource
{
public :
__event SaySomethingHandler* OnSayingSomething;
Void SayHello(Void)
{
OnSayingSomething(S"Hello!");
}
};
__gc class EventReceiver
{
public :
Void Hello(String *message)
{
Console::WriteLine(S"Event Receiver: {0}", message);
}
};
int _tmain(void)
{
EventSource *evtsrc = new EventSource();
EventReceiver *evtrcv = new EventReceiver;
evtsrc->OnSayingSomething +=
new SaySomethingHandler(evtrcv, &EventReceiver::Hello);
evtsrc->SayHello(S"Hello!");
return 0;
}
String Concatenation:
// The '+' operator does not work with strings.
// Use 'String::Concat'
String *fname = S"John";
String *lname = S"Smith";
String *name = String::Concat(lname, S",", fname);
|
|
|
|
|
Thanks for the response. I'd actually started using Concat, but it's nice to know that I did the right thing.
- monrobot13
|
|
|
|
|
I write a class derived form CDialog class under managed C++, the compiling is passed but it doesn't run the code is :
private: System::Void button1_Click(System::Object * sender,
System::EventArgs * e)
{
CDisplay dddd ; ////CDisplay derived from CDialog class
dddd.DoModal();
}
why?
|
|
|
|
|
meet a debug asserting failed at dddd.DoModal();
|
|
|
|
|
What are the chances that an application written by mixing managed and unmanaged C++ being ported to a different platform like Mono. The application is developed using /CLR option and has some portions written in managed C++ which uses functionality in .net. Can this application be ported to *nix platforms using Mono.
I understand that Mono has some bindings with WineLib which means that all win32 api's would work, but does that mean that the above app will work.
I'm confused with the above scenario, any insights are welcome
thanks in advance
Cheers,
Kannan
|
|
|
|
|
I'm re-writing a DLL in managed C++ which holds multiple vectors (arrays) of floating point data (Single's). In 6.0 with MFC I used to do this:
class CCommonDataFile : public CObject
{
....
private:
CTypedPtrArray<cptrarray, float*=""> m_dataColumnArray;
....
}
so I'd have an array of pointers to float (float vectors) and would just allocate a block of memory on the heap for them and read in data from a file. To access the 3rd number in the second column, I would do this:
CCommonDataFile * cdf = new CCommonDataFile();
...
float fVar = *(cdf->m_dataColumnArray[2] + 3);
I'm really puzzled with Managed arrays in C++. How can I get the same effect? Which is to say, how can I store float vectors in an array? Is there some way to create, say, a managed array of managed arrays of Singles?? Or a managed array of pointers to managed arrays of Singles? It seemed so much simpler in the old C++. Any suggestions would really be appreciated.
Thanks,
Mark.
Mark Malin
(00==[||]==00)
|
|
|
|
|
|
Thanks. Very helpful link
Mark.
Mark Malin
(00==[||]==00)
|
|
|
|
|
Hi,
I wrote down a post some weeks ago but I can't find it so I'm sorry of having opened another one. The problem is that I'm trying to exctrat some information (like codec name, lenght, width, ecc. ecc.) from an avi files. Actually I can do everything but the codec information. After having read from www.fourcc.org and some from msdn.com (http://msdn.microsoft.com/library/default.asp?url=/library/EN-US/multimed/mmstr_1xf6.asp)
, I've understood that I have to use vfw32.h library. I can exctrat only the information that an avi's codec is:
Stream Info:
Type Codec
vids divx
How can I match the information divx to the exact versione?? Moreover, How can i distinguish from divx an xvid?? Do I have to create a structure with all the existent codec inside??
Well, it's all ... I wanna thank you everyone is going to answer me.
Francesco
|
|
|
|
|
You need to map the FourCC code (the vids divx bit) to a playback codec capable of playing it. Look on doom9.org[^] for a possible list.
<a TITLE="See my user info" href=http:
|
|
|
|
|
uhm, maybe it wasn't specified...I don't want to play a divx or an avi file, I just want to save some information about it (like lenght, width, codec) ... What do u mean in the sentence: You need to map the FourCC code (the vids divx bit)
???
thx
|
|
|
|
|
I suggest then you look at either VirtualDubs or Emule's source code as both of them displays that info to the user. Cant be that hard
<a TITLE="See my user info" href=http:
|
|
|
|
|
Just started with .net and i seem to be to dumb to figure out how to convert a string to integer. Hepl pls. thx
|
|
|
|
|
Look at the System::Convert class and it's ToInt32 methods...
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
Hi!
I'm writing a Managed C++ class library to be used by a C# client, and I have a method which prototype should look like that from C#:
MyClass.Method(string Param1, out int Param2);
Problem is, I do not clearly understand how to declare an "out" parameter in Managed C++. I tried a pointer-on-int, as I used to do in COM with the [out] attribute, but it doesn't work (IntelliSense on the C# side wants an int* too!)
I could use a reference of course, like that:
public __gc class MyClass
{
public:
void Method(System::String __gc *Param1, int &Param2) {... }
}
Not sure it works though and then the C# prototype would probably become "ref int Param2".
Is there any clever solution to this?
R/
|
|
|
|
|
ralfoide wrote:
public __gc class MyClass
{
public:
void Method(System::String __gc *Param1, int &Param2) {... }
}
The purpose of a ref parameter in C# is where the callee function assigns the value, which is exactly what your void Method(System::String __gc *Param1, int &Param2) function allows to happen to Param2 .
-Nick Parker
|
|
|
|
|
I beg to differ, but my understanding is that a "ref" is used when the called function will modify the value. An "out" seems preferable if the called function is just returning parameters.
My sample prototype was of course simplified. My function returns several parameters, and rather than returning a struct I prefer to use out parameters.
Example of C# prototype I want:
MyClass.MyMethod(string inValue, out int Param1, out int Param2, out int Param3);
So far I got it to work using "ref" if I declare the Param1..3 above using int __gc * in MC++:
This MC++ real prototype in the class library:
MyClass::MyMethod(System::String __gc* inValue, int __gc* Param1, int __gc* Param2, int __gc* Param3);
is seen like this from the C# client:
MyClass.MyMethod(string inValue, ref int Param1, ref int Param2, ref int Param3);
Ideally I'd like out parameters. If not possible, well too bad
R/
|
|
|
|
|
|
Not sure if this will help much, but I think that ref and out perform pretty much the same job, they just set a different kind of contract.
When using out you are effectively saying that the method is responsible for initialising and setting the contents, whereas with ref the calling code is responsible.
What happens if you try and use the out keyword from the C# code? Does the compiler throw up an error?
--
Paul
"Put the key of despair into the lock of apathy. Turn the knob of mediocrity slowly and open the gates of despondency - welcome to a day in the average office."
- David Brent, from "The Office"
MS Messenger: paul@oobaloo.co.uk
|
|
|
|
|