|
I'd like to know, how I can access an Visual C++ Extensibility object from within a Visual Studio 2003 C++ Addin. F.e., if I have a Project object how can I get the corresponding VCProject object ?
I tried QueryInterface and get_Extender, but both failed.
Eyk
|
|
|
|
|
Hello everyone
what is the difference between strcpy and lstrcpy?
Thanks.
-Freehawk
|
|
|
|
|
<br />
char *strcpy( char *string1, const char *string2 );<br />
<br />
LPTSTR lstrcpy(<br />
LPTSTR lpString1,
LPCTSTR lpString2
);<br />
- strcpy works with standard text. (1 byte per character)
- lstrcpy is portable. lstrcpy will copy standard text if you use standard character settings in your project, and will copy Unicode text if you use Unicode character settings. (2 bytes per character)
The "magic" behind this lies with the LPTSTR/LPCTSTR typedefs. When compiled under standard settings LPTSTR = char*, and therefore:
lstrcpy = char*(char* lpString1, const char* lpString2), which is the same as strcpy.
Using Unicode settings, LPTSTR = wchar_t*, and therefore:
lstrcpy = wchar_t*(wchar_t* lpString1, const wchar_t* lpString2), which is the same as wcscpy.
So if you're using lstrcpy in your project, and decide you want to use the Unicode settings, you don't have to change a thing. If you're using strcpy and decide to go Unicode, you would need to replace all your strcpy calls with wcscpy.
I think there's an article on the site about this, you should check it out.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Thank you very much.
It gave me a clear imagine.
-Freehawk
|
|
|
|
|
Aren't you getting _tcscpy() and lstrcpy() mixed up here? It has been a long time since I've used lstrcpy() so you may well be right.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
_tcscpy should do the same thing as lstrcpy. (text mapping wise) If I remember right, lstrcpy is the Win32 API version, whereas _tcscpy is the C runtime version.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Jack Rabbit wrote:
_tcscpy should do the same thing as lstrcpy.
While the net result may be the same, _tcscpy() resolves to either strcpy() , _mbscpy() , or wcscpy() , which are all part of the RTL. Using lstrcpy() , which is part of the Win32 API, produces smaller code.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have a program getting input from a couple sensors, each on their own seperate thread. I also have a modeless dialog box which is supposed to display this data realtime, as it changes. Currently I am attempting to get a thread to update the dialog at a low thread priority setting. I am getting the data into the program, but is there a simpler means to get the dialog to update its information realtime than having a thread constantly update the data whether it has remained the same or changed.
How do you make user interface threads, I think that is where the problem lies. I have attempted doing so using the examples provided at this web site to no avail.
David
|
|
|
|
|
how about postmessage to the dialog itself? means you have to hand over its hwnd to whoever is getting the data
Bryce
---
To paraphrase Fred Dagg - the views expressed in this post are bloody good ones.
--
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
Our kids book :The Snot Goblin
|
|
|
|
|
I have a number of radio buttons. I want to enter their ID's in a std::map for later use. But I can't figure out how to set the correct button from it's ID. IOW, given a group consisting of 2 radio buttons and their ID's (IDC_R1, IDC_R2), does anyone know how to set which one is picked?
Jack
|
|
|
|
|
CButton * butt = (CButton *) GetDlgItem(IDC_R1);
CButton * head = (CButton *) GetDlgItem(IDC_R2);
Regards,
|
|
|
|
|
Thanks. That's what I was using but when I was doing the SetCheck, I forgot to uncheck the other controls so the program was aborting due to too many controls being enabled. I thought I was calling the control wrong.
Jack
|
|
|
|
|
I used to use the pointer method, and then one day I stumbled upon this function:
UINT IsDlgButtonChecked( int nIDButton ) const;
So, if you want to determine if the IDC_R1 button is checked, simply:
<br />
if (IsDlgButtonChecked(IDC_R1) != 0)<br />
AfxMessageBox("Checked");<br />
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Thanks, I appreciate you mentioning that. But the problem I was having had to do with setting it, not checking if it was set. Turns out I was setting it correctly but I was also not un-setting the other radio buttons. It's working fine now.
Jack
|
|
|
|
|
Check out CheckRadioButton api on msdn.
Thank You
Bo Hunter
|
|
|
|
|
Hi,
I am creating an app that requires a lot of settings and im wondering what would be the best way to structure them. Is the best way just to create a dialog for each of them and hook everything up as a stub and then fill everything else in?
Im just trying to get a feel for how other people design their applications. I find the MFC framework a little constrictive when im trying to pass data around.
Im trying to minimise time in case I later want to use a list view control/tab style e.g. tools->options in FireFox for all settings rather than an a menu option for each dialog. If I just create a dialog
for each settings would it be easy to convert it to a tools->options style dialog later on?
What are peoples thoughts and how do you structure that inital GUI so it is more extendable later on?
|
|
|
|
|
Seperate the GUI out from the rest. Make it really easy for the Human Factors team (if you don't have one, pretend there is one who designs all the screens) to change anything.
That is your program just recognises settings from a simple interface. The setup can be easially changed because the screens know nothing about how the rest of the program works.
|
|
|
|
|
how to play stream audio? someone can help me, thanks
Nho'c Ti`
|
|
|
|
|
would like to learn video game programming, but i don't know where to start. can anyone help me!!!? I do know some c++, but thats it. any help is appreciated.
dee
|
|
|
|
|
you don't need a lot of C++ knowledge to create a great game;but depending on what kind of game you want to do, the level of c++ knowledge will be higher, mostly for optimisations and/or graphics.
What kind of game you what to do ?
the most important thing is to have a great idea or a good story ( if applicable ).
one good site dedicated to game programming is (or was )
http://www.gamedeveloper.com/
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
something along the line of tetris or bejeweled...trying something simple for a mobile device.
dee
|
|
|
|
|
This site is very helpfull thank you. i have been on this site for the pass two hours.
dee
|
|
|
|
|
ok ....herez a cool site.....very informative for beginners
http://www.gametutorials.com[^]
yup.....hope u find it useful.....
happy programmin
cheerz
|
|
|
|
|
Since you are wanting to write for mobile devices. You might want to check out GapiDraw. It will provide you a graphics engine that will run on standard PC (DirectX) and CE enabled devices (GAPI).
http://www.develant.com[^]
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
thanks! i really appreciate the help. can you program in c++ for mobile devices? or is it better to use flash action script or java?
dee
|
|
|
|