|
What about documentation [^]?
Could you please post the failing code?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
i m developing an application for Pocket PC.
now i want to execute on pocket pc.
Please tell me how can make setup of my application and produce cab file.
please expalin me with any example if possible.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
|
whats the advantage of inheritence over template...
vikas da
|
|
|
|
|
tasumisra wrote: whats the advantage of inheritence over template...
That you haven't to use a template.
On the serious side: They are quite different language constructs, with different purposes, usually you cannot use template instead of inheritance or viceversa.
Final note: a good OOP book may help.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
It's a bit like asking what's the advantage of micro-wave over televsion
It's two different things used for two different purposes, there's no advantage of one over the other one (otherwise, why keep both of them? )
|
|
|
|
|
Thanks guys .. i let the guy know who asked me the question .. actually i thouht there might be some relation beyond my knowledge .. that why i asked here ..
actually he was more concerned about reusability of a function to use either from template or from inheritemce...?
vikas da
|
|
|
|
|
googling around i found some extension to the default datetimepicker to make backcolor suitable...what i have till now is:
namespace primoAlpha {
using namespace System;
using namespace System::Drawing;
using namespace System::Windows::Forms;
using namespace System::Security::Permissions;
public ref class extendedDateTimePicker : DateTimePicker
{
private:
Color _BackColor;
public:
property Color BackColor
{
virtual Color get() override {
return _BackColor;
}
virtual void set(Color value) override {
_BackColor = value;
Invalidate();
}
}
protected:
[SecurityPermission(SecurityAction::Demand, Flags=SecurityPermissionFlag::UnmanagedCode)]
virtual void WndProc( Message% m ) override
{
if ( m.Msg == (int) 0x0014 ) {
Graphics ^g = Graphics::FromHdc(m.WParam);
g->FillRectangle(gcnew SolidBrush(_BackColor),
ClientRectangle);
g->ReleaseHdc();
return;
}
WndProc(m);
}
};
}
the code compile with no error but when i run it gives me an
"An unhandled exception of type 'System.StackOverflowException' occurred in primoAlpha.exe"
any help is really apprecieted, i'm a noob in c++
modified on Monday, September 28, 2009 4:12 AM
|
|
|
|
|
You should post the question in the more appropriate Managed C++ / CLI [^] forum.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
So I am working on an app, and it requires tons of Variable Declarations, which I dont want them all in my main.cpp view port, it would be too crowded, is there a way to store them in a different file as a list and call them when I need to, for a user to input or to read static vars? This also goes for VB too. I.E:
Main.cpp
--------
int _tmain(){
cout << "Name: "; cin >> userName;
}
external file
--------
string userName;
string userName1;
string userName2;
|
|
|
|
|
You can put all the variable declarations in a header file and #include it in the main.cpp file.
But, if you #include this header in multiple cpp files you will get a multiple declaration linker error.
In such cases, declare all variables in a separate .cpp file.
To use these variables in some other .cpp file like main.cpp, declare the same variables as extern in the main.cpp file.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
so its safe to put a struct() in a header and it will store information to the decl vars in the structure from the main.cpp?
|
|
|
|
|
Yes, you can do that, for instance, in decl.h :
std::string username;
...
and then in main.cpp :
#include "decl.h"
You may also, if it makes sense, make the variables member of a class (or of a namespace).
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Herboren wrote: sweet
home Alabama?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I made this codes on OnPaint() function:
CPaintDC dc(pdlg);
CFont font;
font.CreateFont(
24,
0,
0,
0,
FW_HEAVY,
true,
true,
0,
DEFAULT_CHARSET,
OUT_DEVICE_PRECIS,
CLIP_DEFAULT_PRECIS,
PROOF_QUALITY ,
FF_SCRIPT ,
"Times New Roman");
dc.TextOut(15, 100, "welcome", 7);
dc.SelectObject(&font);
font.DeleteObject();
Text is appear on dialog form, but it is still on regular style and using arial font type.
Whereas, I have set that font to Italic-underline style. I also changed font facename to Times New Roman and Verdana, but there is no differences when it show on dialog form.
What's wrong with my codes? Is there any missing code?
Help me please...
Thanks and Regards,
modified on Monday, September 28, 2009 2:56 AM
|
|
|
|
|
Try putting the line dc.SelectObject before the line dc.TextOut .
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
thank you <<_Superman_>>...
My problem is solved...
Thanks a lot..
|
|
|
|
|
Your problem may be solved, but you may have made another one.
You are keeping the return value of SelectObject, and Selecting it back in later on aren't you?
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi all,
Please help me, how to change color and font of push button in visual C++ 6.0?
Any reference that I can learn?
I used dialog based project.
thanks and regards,
|
|
|
|
|
|
I have tried using this codes:
HBRUSH CGambarDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if( pWnd->GetDlgCtrlID() == IDC_BUTTON1 )
{
pDC->SetBkColor( RGB( 255, 0, 0 ));
pDC->SetBkMode( TRANSPARENT );
}
return hbr;
}
but, nothing changes happened...
that codes is not correct?
|
|
|
|
|
If you read the remarks section of the document, it says that button with certain styles always use the default colors. In such cases, you would need an owner draw button.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thank you for your answers.
Sorry if I confiscating your time. But, I still confuse.
I have read the documents and link to using button on MSDN when I clicked owner-drawn button.
Is it right that these changes possible to do if I use it on Win32App project, not a MFCApp(.exe)?
I have no idea, where I should used this message (WM_CTLCOLORBTN) in Dialog Based Project.
I looked for WM_CTLCOLOR on parent window, I just found OnCtlColor(^).
Please give me explanations.
Thanks a lot.
|
|
|
|
|
Eka Candra wrote: Is it right that these changes possible to do if I use it on Win32App project, not a MFCApp(.exe)?
Of course.
Eka Candra wrote: I looked for WM_CTLCOLOR on parent window, I just found OnCtlColor.
MFC maps the OnCtlColor method to the WM_CTLCOLOR message.
So you just need to write your code into the OnCtlColor method.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|