|
Yes, these controls are added in the OnInitDialog(). It is not these other dialogs that have a problem with displaying properly. That only occurs with the Keypad dialog, and the Keypad dialog is not created (derived) from the IosDialog. It is derived from the common CDialog. The class definition is shown below:
<br />
class CKeypad : public CDialog<br />
{<br />
public:<br />
CKeypad(CWnd* pParent, const WinInfoStruct); <br />
~CKeypad();<br />
<br />
bool Get_Integer(CString Label, int Min, int Max, int *result=0);<br />
bool Get_Float(CString Label, float Min, float Max, float *result=0);<br />
bool Get_Latitude(CString Label, LAT_DEGREES *result=0);<br />
bool Get_Longitude(CString Label, LON_DEGREES *result=0);<br />
bool Get_Angle(CString Label, DEGREES *result=0);<br />
bool Get_Day(CString Label, int Min, int Max, int *result=0);<br />
bool Get_Month(CString Label, int Min, int Max, int *result=0);<br />
bool Get_Time (CString Label, TimeFormats Format, SECONDS Min,<br />
SECONDS Max, SECONDS *result=0);<br />
bool Get_BaroPress (CString Label, float Min, float Max, float *result=0);<br />
enum { IDD = IDD_KEYPAD };<br />
<br />
private:
<br />
enum CONSTANTS { NUM_BUTTONS = 14 };<br />
<br />
WinInfoStruct winInfo;<br />
CSuperFrame superFrame;<br />
CSuperButton m_EntryBtn[NUM_BUTTONS];<br />
CSuperButton m_Backspace;<br />
CSuperButton m_Enter;<br />
CSuperButton m_Cancel;<br />
CSuperButton m_sbNorth;<br />
CSuperButton m_sbSouth;<br />
CSuperButton m_sbEast;<br />
CSuperButton m_sbWest;<br />
CEntryBuffer m_EntryBuffer;<br />
CString m_Title;<br />
CString m_ErrorBuffer;<br />
bool settingLat;<br />
bool m_bShowDirections;<br />
CRect titleRect;<br />
<br />
const static UINT btnId[NUM_BUTTONS];<br />
<br />
private:
<br />
void ProcessCharacter(char C);<br />
void UpdateDisplay(bool New_Title);<br />
<br />
<br />
protected:<br />
virtual void DoDataExchange(CDataExchange* pDX);
<br />
protected:<br />
afx_msg void OnBn1();<br />
afx_msg void OnBn2();<br />
afx_msg void OnBn3();<br />
afx_msg void OnBn4();<br />
afx_msg void OnBn5();<br />
afx_msg void OnBn6();<br />
afx_msg void OnBn7();<br />
afx_msg void OnBn8();<br />
afx_msg void OnBn9();<br />
afx_msg void OnBn0();<br />
afx_msg void OnBn00();<br />
afx_msg void OnBn000();<br />
afx_msg void OnBnDec();<br />
afx_msg void OnBnNeg();<br />
afx_msg void OnBnEnter();<br />
afx_msg void OnBnBs();<br />
afx_msg void OnBnEast();<br />
afx_msg void OnBnNorth();<br />
afx_msg void OnBnSouth();<br />
afx_msg void OnBnWest();<br />
virtual BOOL OnInitDialog();<br />
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);<br />
afx_msg void OnPaint();<br />
virtual void OnCancel();<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
<br />
<br />
#pragma pack(pop)<br />
<br />
#endif // !defined(AFX_KEYPAD_H__A3105D12_254A_11D2_804C_00104B2D1F4C__INCLUDED_)<br />
I use the GetInteger() function to get the UserID and PIN numbers.
John P.
|
|
|
|
|
So what was the previous mention of CLogin for? Is that somehow related to CKeypad ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Keypad is called to enter the UserID and PIN for the login, and Keypad is called from within CLogin,
CKeypad kp(mainFramePtr->wndPtr, winInfo);<br />
<br />
if (kp.Get_Integer("Enter ID Number", 0, 99999, &intValue))<br />
John P.
|
|
|
|
|
When I use Image::GetThumbnailImage to get a thumbnail from a PNG file, the background color becomes black, it's white in the original one. And no such a problem about JPG/BMP files.
How to solve it?
Thanks a lot.
|
|
|
|
|
followait wrote: it's white in the original one
Is it white or transparent?
You may need to create your own thumbnail image by creating
a Bitmap of the appropriate pixel format and using a Graphics
object created from that Bitmap, use DrawImage() to draw the
source image on the thumbnail image.
BTW - GDI+ will not preserve transparency if you save the thumbnail
image to a png file. I think only 32-bit ARGB TIFF files preserve
transparency.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Hi,
I'm having a problem with the caret in my windowless control (created in part with the CFlashWnd object in an article by Makarov Igor.) If I click in a text region on my control, the caret does not appear. However, if I open any other application's window or click on the desktop (anything to shift the focus from my app to another), the caret suddenly appears in the windowless text region.
Has anyone seen this behavior? How can I fix this problem?
Thanks,
Brian
|
|
|
|
|
Hi there,
I am new to C++. My job is to recompile a c++ project from VC 6 and Ultimate Grid (Version from 1999?) to VC 2005 and Ultimate Grid 7.2
when compiling, I get the following Linker errors:
<code>
1>UGCBType.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: static bool __cdecl UGXPThemes::DrawBackground(struct HWND__ *,struct HDC__ *,enum UGXPCellType,enum UGXPThemeState,struct tagRECT const *,struct tagRECT const *)" (?DrawBackground@UGXPThemes@@SA_NPAUHWND__@@PAUHDC__@@W4UGXPCellType@@W4UGXPThemeState@@PBUtagRECT@@4@Z)" in Funktion ""public: virtual void __thiscall CUGCheckBoxType::OnDraw(class CDC *,struct tagRECT *,int,long,class CUGCell *,int,int)" (?OnDraw@CUGCheckBoxType@@UAEXPAVCDC@@PAUtagRECT@@HJPAVCUGCell@@HH@Z)".
1>UGCelTyp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: static bool __cdecl UGXPThemes::DrawBackground(struct HWND__ *,struct HDC__ *,enum UGXPCellType,enum UGXPThemeState,struct tagRECT const *,struct tagRECT const *)" (?DrawBackground@UGXPThemes@@SA_NPAUHWND__@@PAUHDC__@@W4UGXPCellType@@W4UGXPThemeState@@PBUtagRECT@@4@Z)".
1>UGCtrl.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: static bool __cdecl UGXPThemes::DrawBackground(struct HWND__ *,struct HDC__ *,enum UGXPCellType,enum UGXPThemeState,struct tagRECT const *,struct tagRECT const *)" (?DrawBackground@UGXPThemes@@SA_NPAUHWND__@@PAUHDC__@@W4UGXPCellType@@W4UGXPThemeState@@PBUtagRECT@@4@Z)".
1>UGDLType.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: static bool __cdecl UGXPThemes::DrawBackground(struct HWND__ *,struct HDC__ *,enum UGXPCellType,enum UGXPThemeState,struct tagRECT const *,struct tagRECT const *)" (?DrawBackground@UGXPThemes@@SA_NPAUHWND__@@PAUHDC__@@W4UGXPCellType@@W4UGXPThemeState@@PBUtagRECT@@4@Z)".
</code>
Any ideas?
THx for any help!
horatio
|
|
|
|
|
horatio wrote: I am new to C++. My job is to recompile a c++ project from VC 6 and Ultimate Grid (Version from 1999?) to VC 2005 and Ultimate Grid 7.2
That is exactly how I started out as a C++ beginner.
led mike
|
|
|
|
|
Did you forget to link a required lib?
Du kommst aus den USA aber dein Compiler liefert deutsche Fehlermeldungen?
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Hi Everyone,
I have created one application for compiling and executing a 'C' source file. In my application i have created one button for compiling as well as executing (This single button will do both compilation and execution operations). I want to create one more button for stoping (terminating / killing the process) the compilation or execution process(i don't know while clicking this button whether my application is in compilation or execution phase).
Please suggest me how can i handle this or what code i have to write for this new button ???
Thanks in advance
Sanjeeva Kumar.
|
|
|
|
|
Did you really make a C compiler? That's amazing!!!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Don't be so flippant, it's probably urgent.
led mike
|
|
|
|
|
led mike wrote: it's probably urgent
Sure - that beast is probably leaking memory, and he has only so many minutes left to stop it!
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
You're right. But I was quite impressed by the new compiler-without-linker technology.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
That is IT! I can NOT read your posts while drinking coffee.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
What does your button-click handler look like?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sanjeeva Kumar K wrote: (i don't know while clicking this button whether my application is in compilation or execution phase
weird ...
You should know, because you start your "execution" after the compilation is done.
When the compilation is running, set a flag, when it's finish set another flag, when the execution start, set another flag.
so, when you click on your "termination/killing" button, you just have to check the flag to know if you need to stop the compilation or
kill the process.
|
|
|
|
|
On the handler of the first button you can set a global variable (declared in theApp or inside the class where you are working (possibly the same dialog)) to true, and then once you press the second button you can check the state of that variable. Of course you should revert the state of that variable to false once the compiler has finished it's work...
Somehow I have a feeling that the question (how to know if you have pressed a button) and the job done (a compiler) are no matching very well...
|
|
|
|
|
I am using one boolean variable(Initially it is false). In the code of second button i am initializing this variable to true. In the first button code, after finishing every phase(i.e, after compilation, linking and execution) i am checking whether this boolean variable is true or false. If this boolean variable is true then i am returning the control(return statement).
Now the problem is when my application is executing the code behind the first button i am unable to click the second button.
what code i should write for clicking the second button, when first button is performing its operation ???
Thanks in advance
Sanjeeva Kumar.
|
|
|
|
|
Sanjeeva Kumar K wrote: when my application is executing the code behind the first button i am unable to click the second button.
Haven't you read on multiple threads and synchronization techniques? If not, probably it's time to read on those topics. And I think you're going too far without knowing the basics.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I suppose that what is happening here is that you should be using a multi threaded application to do that... if your main thread gets blocked because you are processing the compilation... then the program won't answer to anything until it has finished...
You should read about a "worker thread" and the synchronization objects that are available.
Hope this helps...
PS: Are you sure that you have made a compiler?
|
|
|
|
|
Joan Murt wrote: Somehow I have a feeling that the question (how to know if you have pressed a button) and the job done (a compiler) are no matching very well...
If he knows how to program a compiler, he should have known how to do flow-control though.
Maxwell Chen
|
|
|
|
|
By using GCC compiler i am compiling, linking and executing the 'C' source file.
My application selects a 'C' source file and by using GCC compiler i am compiling, linking and executing it.
|
|
|
|
|