Problem Orbiter doesnt like TextXY?

Alexw95

Addon Developer
Addon Developer
Joined
May 28, 2010
Messages
262
Reaction score
0
Points
16
Location
Vancouver BC
hi i am useing the library MFDlib.lib and i went to output text and open freezes as soon as i open up the mfd i was making any ideas?
 
How do you call the function? In which context?
 
TextXY(hDC, 5, 0, "Hi", cw, ch);

---------- Post added at 06:57 PM ---------- Previous post was at 06:57 PM ----------

would it be because i did not declare the function at the top of my source
 
TextXY(hDC, 5, 0, "Hi", cw, ch);

No, it is because you use a non-standard function. I can't tell you what is wrong in the function TextXY.

Do you use MFDLib? That needs to be updated for the new API if you use it.

---------- Post added at 09:27 PM ---------- Previous post was at 09:22 PM ----------

Downloaded the library and found the cause: PEBCAK.

Did you have ANY serious C++ experience when you started this project? You need to be able to read C++ sources for knowing what the functions do and how to use them and you obviously have no clue what you do.
 
No, it is because you use a non-standard function. I can't tell you what is wrong in the function TextXY.

Do you use MFDLib? That needs to be updated for the new API if you use it.

---------- Post added at 09:27 PM ---------- Previous post was at 09:22 PM ----------

Downloaded the library and found the cause: PEBCAK.

Did you have ANY serious C++ experience when you started this project? You need to be able to read C++ sources for knowing what the functions do and how to use them and you obviously have no clue what you do.
mu c+++ is very limited. i am getting my dad to help me as he codes c++ and java for a living so he is helpimg me most of the time but when he is not home.. i get lost i only learnt c++ 4 days ago so far i think i am doing well but definitly this mfd thing is way to hard for me i think once i make one i will get it and be able to make more complicated ones.. could you post and link for pebcak

---------- Post added at 07:32 PM ---------- Previous post was at 07:31 PM ----------

yes i do use mfdlib
 
mu c+++ is very limited. i am getting my dad to help me as he codes c++ and java for a living so he is helpimg me most of the time but when he is not home.. i get lost i only learnt c++ 4 days ago so far i think i am doing well but definitly this mfd thing is way to hard for me i think once i make one i will get it and be able to make more complicated ones.. could you post and link for pebcak

Look at the header file and read the interface definition.

Code:
extern CDECL POINT TextXY(const HDC hDC, const int x, const int y, const char *s, ...);

Notice something?

What is cw and ch?
 
Since your father writes C++ for a living I'm sure he has a C++ book laying around somewhere. I recommend reading the C++ book and studying the example code in it so you can learn what you're doing; until then, C++ errors will remain a mystery for you.
 
Since your father writes C++ for a living I'm sure he has a C++ book laying around somewhere. I recommend reading the C++ book and studying the example code in it so you can learn what you're doing; until then, C++ errors will remain a mystery for you.

yea he does but he is at school today and he took it that was the book i used to learn most of the basics
 
I noticed a tiny bug in the MFDlib: It uses CDECL macro, but this one is not defined for recent compilers by default. So the functions will use possibly a wrong calling convention.
 
thanks for ur help il try seee if my dad canfix the bugs in it
 
thanks for ur help il try seee if my dad canfix the bugs in it

Don't show him MFDlib, that is not the trouble maker, show him your code, you use the variable parameters incorrectly
 
Don't show him MFDlib, that is not the trouble maker, show him your code, you use the variable parameters incorrectly
yea now that i think of it other mfd with textxy work in orbiter so il get him to check it
 
mu c+++ is very limited. i am getting my dad to help me as he codes c++ and java for a living so he is helpimg me most of the time but when he is not home.. i get lost i only learnt c++ 4 days ago so far i think i am doing well but definitly this mfd thing is way to hard for me i think once i make one i will get it and be able to make more complicated ones.. could you post and link for pebcak
He would probably be more helpful for you than we are, why don't you ask him to help you with problems instead of making a new thread for every new issue you run into?
 
He would probably be more helpful for you than we are, why don't you ask him to help you with problems instead of making a new thread for every new issue you run into?

because he is not home until night and then he can only help me for a little bit because he is in school getting his masters degree in software develupment otherwise yea he is a big help but so are you guys
 
because he is not home until night and then he can only help me for a little bit because he is in school getting his masters degree in software develupment otherwise yea he is a big help but so are you guys
I think it would be best if you were to have a single thread in which you could get help getting from start to finish on your addon, rather than creating a new thread for every little problem you run into. Four of the last five threads in the OrbiterSDK sub-forum were created by you about similar problems in the same project.

That way, people who wanted to help you would only have one thread to follow/keep track of, and it would be simpler/easier for everyone to track things.
 
Back
Top