|
i'm currently using visual C++ and i want to know the library and command to draw lines and boxes and fill the boxes with colours in win32......does anyone knows? Help me i'm really desperate!
jan
|
|
|
|
|
Win32 APIs: MoveTo, LineTo, Rectangle, FillRect
--Mike--
http://home.inreach.com/mdunn/
"Listen you footwarriors, can you hold down a bit with the firing? I've just got three impromptu weddings breaking out behind me!" -- Arthur Dent
your with and
|
|
|
|
|
If this relates to your earlier question, the answers provided there are still the case, you are going to have trouble if you're trying to draw to a console. You might also find it better NOT to SCREAM AT US, and to provide some clue to your problem in the question, rather than your personal level of urgency, which I'm sure is the same for everyone.
If you're now writing a Windows program ( one with a Window), then GDI is the way to go, and there is a plethora of documentation about it. Most on this site use MFC, so you'll probably need to go to MSDN to get info on doing it under Win32. Be VERY careful of your resources, it's very easy to crash a program under Win32 through leaking resources. Another good source is www.WDJ.com - the site has all the old article code for download and authors are not allowed to use MFC, so you'll find a fair bit of Win32 GDI code there. They do a graphics issue annually, so look for that for each year, and you should find some stuff that will help you. Obviously, if you get stuck, just ask.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I want to print data onto the NISCA printer using MFC.
vijaya.
|
|
|
|
|
(My first post here, this board is awesome.. tremendous thanks for all the tips from the guru's)
Hiya,
Does anyone have any tips on how to create custom slider controls? I want to put some slender popup sliders in an app I am developing. I think the generic sliders in MFC are fairly obnoxious.
Many thanks in advance,
Christian
"I have made this letter a rather long one, only because I didn't have the leisure to make it shorter."
-Blaise Pascal
|
|
|
|
|
Hi all,
I maked OLE object field in Access 2000 ...
Now, i wanna load and save my pictures from my field with ADO ...
How can i do that ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
|
Thank you Michael ...
That was great article ...
But i have problem still !!!
Because i can't create Long Binary field in Access 2000 !!!
How can i solve it ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I have written a custom control derived from CWnd. Basically I am not drawing the entire client rectangle. I do not want to obscure things behind the control. Now I have added the ability to click and drag a "thumb" piece on this control. Works great, except for the drawing.
What I am seeing is the control is not erasing the rectangle and I start getting "smearing"
Is there an easy way to grab an XOR map on this? I'm kinda new to MFC and am feeling my way through this.
Little help?
-JT
|
|
|
|
|
How can I send email from a program?
I would like to not have to go through an SMTP server.
On a related note, but off topic for this forum, I set up an SMTP server on my computer but when I tried to email my hotmail account through it, it said that it was 'unable to relay' for that email address. On the 'relay restrictions' page of the internet information services settings I have the 'Allow all computers which successfully authenticate to relay' check box checked.
Thank you for suggestions,
-Alex Griffing
|
|
|
|
|
See this:
http://www.codeproject.com/useritems/xymailclient.asp
I vote pro drink
|
|
|
|
|
Hey Alex,
Well, I suppose you have few choices.
MAPI
If you are willing to rely on the MAPI subsystem in Windows, you can certainly use MAPI to deliver the email. There can be issues with using MAPI from within NT Services (I guess we need to start calling these something else now with the advent of 2000 and XP), not sure if this is part of your objective. Depending on how and where your software will be distributed, it can also be problematic to ensure that your clients will configure MAPI properly. Mapi works well however, when everything is configured and running.
DUMB SMTP
There are lots of basic SMTP mail classes and code around, so if you don't need attachments, rich content, MIME etc., and you know you have access to a set up and working "smart" SMTP host, you could use something like this. Setup here too can be a little tricky. Your clients need to provide the name of the smart host, there really isn't any way to auto detect this.
SMART SMTP
** warning: I'm going to plug a product from my company
Depending on your needs, an option could be to use a comprehensive library like our Dundas TCP/IP toolkit. The toolkit includes all the SMTP and MIME stuff to handle attachments, rich content, etc., and it is also smart enough to be able to deliver the outgoing email directly to the recipients email server (no need for a relay host). The toolkit is 100% C++ and provided as source code, so it compiles right into your .exe w/o any external dependencies.
Check it out:
http://www.dundas.com/index.asp?products/tcpip/index.asp
HTH,
David
|
|
|
|
|
You've got 2 choices:
* MAPI (yuk)
* SMTP (easy)
I've done both -- and neither are great. SMTP has turned out to be easier, but you gotta learn the protocol. MAPI is a pain....
MAPI is a little more memory intensive, by making those memory calls, all of the MAPI suport gets loaded. SMTP only needs to load winsock...
As for your main problem -- it seems that you've not actually authenticated.
-p
|
|
|
|
|
The use of the const keyword is a point of problems between myself and others in my work group. I love to use it, but it is not used universally... (which is really annoying to me).
I really like the control that it places on the code. The fact that you can control which methods may be called on an object. A very effect way to denote which pointers are accessible to changeable objects and which should not.
But what I really want to know is this -- does it, in any way, affect the code generation, and the run of the program -- is there ANY sort of optimization that goes on here?
The thing I hear from people all the time is this -- "what's the point of doing that -- seems like a waste of time".
Should I just give up?
Regards,
-peter
|
|
|
|
|
The compiler can optimize because it knows the contents of the 'this' object won't change. For example take a mythical class method:
void A::SomeOtherMethod(int) const { ... }
void A::DoStuff(bool) const { ... }
void A::DoMoreStuff(int,bool) const { ... }
void A::Func() const
{
SomeOtherMethod ( m_nValue1 );
while ( ... )
{
DoStuff ( m_bFlag1 );
DoMoreStuff ( m_nValue1, m_bFlag1 );
}
} In this trivial example, the compiler knows m_nValue1 and m_bFlag1 will never change for the duration of Func(), nor will they be changed by SomeOtherMethod(), DoStuff(), or DoMoreStuff(), so it can keep m_nValue1 and m_bFlag1 in temp storage (like maybe a CPU register), instead of doing a 'this' pointer dereference every time those values are accessed.
"what's the point of doing that -- seems like a waste of time".
I could rant on here about people who think it's a hassle to take care with the code they write, but I won't because that's getting into religious debate territory.
--Mike--
http://home.inreach.com/mdunn/
"Listen you footwarriors, can you hold down a bit with the firing? I've just got three impromptu weddings breaking out behind me!" -- Arthur Dent
your with and
|
|
|
|
|
It's funny, I only recently have started to think more about 'const' and the fact that well written code will use it. Given that it never makes something work to declare it const, it's just something I knew about but didn't consider overmuch. I guess that's because I've taught myself to program, in the same way that the need to preserve namespaces rather than declare using on an entire namespcae is something I came to grips with by discussing it here.
I have nothing intelligent to add to what Michael has said ( no surprises there ), I just wanted to say as someone who constantly seeks to better himself and learn to do things *well*, and a veteran of many fights over STL before my workmates accepted it over MFC containers and ones they had written, all I can say is 'stick to your guns'. Get a copy of Stroustrup if you don't have one and quote it like the Bible. There is no way any remotely competent developer can argue with the guy who wrote the language without bringing some hefty evidence to the table.
Everyone at work uses STL now, to the point where I find it in the code instead of being called over to help impliment/optimise it. I'm sure you'll win your battle to, because you are right. Anyone who thinks it is a 'waste of time' to do things properly is a monkey.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
|
How can you tell if a window is SW_HIDE or SW_MINIMIZE.. I want to do a function, but if the window is hidden or minimized, I dont want the function to run.
Thanks,
Rob
|
|
|
|
|
Call ::GetWindowPlacement(..)
WINDOWPLACEMENT wp;
GetWindowPlacement(&wp);
if(wp.flags == SW_SHOWMINIMIZED)
{
// window is minimized
}
Hope this helps.
// Fazlul
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
I implemented this:
void CTimerDlg::RefreshTimer()
{
UpdateData(TRUE);
WINDOWPLACEMENT wp;
CTimerDlg::GetWindowPlacement(&wp);
if(&wp.flags == SW_HIDE)
{
}
else
{
OnBstop();
if (!::IsWindow(m_dRefreshDlg.GetSafeHwnd()))
m_dRefreshDlg.Create(IDD_REFRESH, this);
m_dRefreshDlg.ShowWindow(SW_SHOW);
OnBstart();
m_dRefreshDlg.ShowWindow(SW_HIDE);
}
}
When my timer reaches 1 hour I have it do the RefreshTimer() function.. I have a dialog pop-up unitl the OnBstop() and OnBstart functions complete.. I only want the dialog box to open if the program is not hidden.. this works fine but after this function runs.. it locks up the program.. any ideas
Rob
|
|
|
|
|
Hey Rob:
Sorry for the late reply. Hope the problem has already been fixed.
I tried to reproduce the problem on my end, but it seemed to work fine. If you still have the problem, can you please email me a test app? Just thought I might be missing something..
// Fazlul
fkabir@capitolsoft.com
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
Thanks, every thing is working fine now.. I have a Multimedia Timer in my app, I have a event fire at a certian time and i dont want the event to be visible if the window is hidden.. I moved the function to the WM_TIMER instead of the Multimedia timer, everything seems to be working fine.. Thanks for the help.
Rob
|
|
|
|
|
There is also an IsIconic call which will tell you if its minimized I believe.
"I never met anyone I didn't like" Will Rogers.
|
|
|
|
|
Just thought I should add this...
As you said, ::IsIconic() will tell if the window is in minimized/iconic state, even though the window may still be in visible state (i.e. not hidden).
// Fazlul
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
IsWindowVisible() to tell if a window is hidden.
IsZoomed() to tell if a window is maximized.
--Mike--
http://home.inreach.com/mdunn/
"Listen you footwarriors, can you hold down a bit with the firing? I've just got three impromptu weddings breaking out behind me!" -- Arthur Dent
your with and
|
|
|
|