|
What you have suggested can be sone using VC++. We are working in C graphics on Dos operating system.
|
|
|
|
|
And what compiler do you use?
nave
|
|
|
|
|
|
sakssp wrote: We are using TurboC++
Ops, I have only a little experience working in turbo c graphic. I guess you might be using the
initgraph() to intialize the graphic screen isn't it? At the time when I worked in TC++, the graphic driver that came with the TC allowed me to set only a maximum 640X480 resolution. I think now they will be providing some new drivers. Get it and copy it to your TC\BGI folder also specify this file in the initgraph function.
nave
|
|
|
|
|
|
sakssp wrote: We are working in C graphics on Dos operating system.
Then why did you ask a "through C++" question in the VC++ forum?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
sakssp wrote: How to set 1024x768 display resolution using C++ on MS-DOS?
try mode 13h... or it's better you shift to Windowsprogramming.. graphics programming is pretty much easier in windows programming..
|
|
|
|
|
Hi
I am a beginner visual c++ programmer and I have a difficulty.
There are two buttons on a dialog box and both of them will create a new dialog box.In the new dialog box I should know which button is pushed to create this dialog box.I tried CButton::GetState() method but it did not solve the problem because I think this method is for radio buttons.So how can I know which button was pushed.
Thanks
|
|
|
|
|
in the resource editor, open your dialog template, and double click on the button which is supposed to open another dialog. it will ask you to give a name to the event handler being created. press enter, and place your code there...
also, maybe this[^] could help.
|
|
|
|
|
when a button is pushed OnBnClicked(button name)() function will be executed and you will know which button is pressed. put message box in each of the button clicked functions with different message
|
|
|
|
|
But can I use the event in a different dialog box from the dialog box which the event is created.Because I want to know in the second dialog box that which button is pushed in the first dialog box.
|
|
|
|
|
can you show me the code whr u are calling the new dialog(or creating a dialog)
|
|
|
|
|
thanks
I solved the problem from another way.
|
|
|
|
|
iayd wrote: In the new dialog box I should know which button is pushed...
So why not just pass some sort of identifier to the new dialog's constructor?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I am implementing a CString object and I want to convert a string in CString to char buffer.
S.Yamini
|
|
|
|
|
CString str;
Use str.GetBuffer() and str.ReleaseBuffer()
|
|
|
|
|
I dont how to convert from CString to char buffer but you can get a char by using variablename.GetAt(int CharAt) function
|
|
|
|
|
CString str = "hello world";
char pszStr[50] = {0};
::strcpy(pszStr, <code>(LPCSTR)</code>str);
never use GetBuffer, until you need to modify directly the internal CString buffer. the CString class provides some useful cast operators, such as the one quoted here
|
|
|
|
|
I believe the more correct cast would be LPCTSTR.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: I believe the more correct cast would be LPCTSTR
not quite.
LPCTSTR is when dealing with TCHAR. here, i woluntarily used char, because i didn't want to enter unicode types considerations (and i didn't know the equivalent strcpy() function )
|
|
|
|
|
toxcct wrote: (and i didn't know the equivalent strcpy() function )
wcscpy() , or _tcscpy() if you are supporting both.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
toxcct wrote: LPCTSTR is when dealing with TCHAR
If you're using CString then you're using TCHAR.
For CString, LPCTSTR is appropriate.
For CStringA. LPCSTR would be ok.
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
No cast is needed in this situation, the following code works identically:
CString str = "hello world";
char pszStr[50] = {0};
::strcpy(pszStr, str);
Casts which are not needed – especially when they are C-style casts – are a pet hate of mine. Note the whole LPCTSTR vs LPCSTR is no longer an issue as such.
Steve
|
|
|
|
|
yaminisridaran wrote:
I am implementing a CString object and I want to convert a string in CString to char buffer.
CString str;
char* pBuffer= (LPSTR)(LPCTSTR)str;
|
|
|
|
|
link
in this code how can one call the button clicked function on pressing enter. i have tried adding virtual void OnOK(); but still the enter key doesn't execute the button function but now the dialog is not closing.
I have used a CxSkinbutton class which creates button with different skins. do i need to add a function in that class to capture the enter key
vimarsh
-- modified at 4:39 Wednesday 4th April, 2007
|
|
|
|