|
I am already using double buffering. My question was more to do with how to force a Bkgnd erase when WM_ERASEBKGRND is overriden to return FALSE at all times. That is, If there's a way to do so without using flags to conditionalize the return value of OnEraseBkgnd().
Anyway, I stumbled across another post which mentioned Invalidate(TRUE/FALSE)... and interestingly that works... Invalidate(TRUE) erases the background... so I think I found the answer. I still don't understand why this works though. But the first hurdle's overcome
Thank you for letting me know of Set/EndCapture. I'm still puzzled as to how to decide when to call EndCapture... as I want the mainframe to handle all mouse input & motion, even in floating dialogs outside the main window frame. I'll figure that somehow anyway. Thanks again.
|
|
|
|
|
I want to upload a big blob(more than 100M) to database(SQL Server 7.0). there a method named AppendChunk in ADO, but I use OLE DB in VC++6.0. Is anyone can tell me how to write a method function same as AppendChunk in ADO in VC++6.0 OLE DB?
|
|
|
|
|
I was wondering how to display the value of an integer in hex in a text box.
I have a variable of typ int assigned to the box, but I need to see the hex value.
Is their a way to set a flag as in the way you do it with cout?
Thanks James
|
|
|
|
|
How about this:
int number = 12;
CString s;
s.Format ( "0x%x", number );
m_wndMyEditCtrl.SetWindowText ( s );
-Ben
"Its funny when you stop doing things not because they’re wrong, but because you might get caught." - Unknown
|
|
|
|
|
Hi ! I'd like to make my application
show small animation based on icons.
I tried to do this with Picture control
because it supports icons and I've also found on the web an app in which bmps were loaded from .res into an array (but were drawn on the form not in the Picture control).I'm trying to do sth like that but with icons. Can anyone help me?
I tried those functions:
hIcon=AfxGetApp()->LoadIcon(IDI_ICON)
m_anim.SetIcon(hIcon);
//m_anim is CStatic from Picture
My icons are IDI_ICON1..IDI_ICONn. Does anyone have an idea how to make it using OnTimer funct. or maybe there is better way to do this.
I'm looking for working solution with some comments. Thanks.
|
|
|
|
|
One of Chris Maunder's articles is about animating a tray icon. You could probably adapt the code to work in your app.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
I use this...
void CTestDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
X++;
if (X == 1)
hIcon = AfxGetApp()->LoadIcon(IDI_ICON1);
if (X == 2)
hIcon = AfxGetApp()->LoadIcon(IDI_ICON2);
if (X == 3)
hIcon = AfxGetApp()->LoadIcon(IDI_ICON3);
if (X == 4)
hIcon = AfxGetApp()->LoadIcon(IDI_ICON4);
if (X == 5)
hIcon = AfxGetApp()->LoadIcon(IDI_ICON5);
if (X == 6)
hIcon = AfxGetApp()->LoadIcon(IDI_ICON6);
if (X == 7)
hIcon = AfxGetApp()->LoadIcon(IDI_ICON7);
if (X == 8)
hIcon = AfxGetApp()->LoadIcon(IDI_ICON8);
if (X == 9)
hIcon = AfxGetApp()->LoadIcon(IDI_ICON9);
if (X == 10)
hIcon = AfxGetApp()->LoadIcon(IDI_ICON10);
if (X == 11)
hIcon = AfxGetApp()->LoadIcon(IDI_ICON11);
if (X == 12)
hIcon = AfxGetApp()->LoadIcon(IDI_ICON12);
if (X == 13)
hIcon = AfxGetApp()->LoadIcon(IDI_ICON13);
if (X == 14)
hIcon = AfxGetApp()->LoadIcon(IDI_ICON14);
if (X == 15)
hIcon = AfxGetApp()->LoadIcon(IDI_ICON15);
if (X == 16)
hIcon = AfxGetApp()->LoadIcon(IDI_ICON16);
if (X == 17)
X = 0;
m_anim.SetIcon(hIcon);
CDialog::OnTimer(nIDEvent);
}
|
|
|
|
|
Does anyone know if there are any tools that I can embed in my application to send huge files across a network??
|
|
|
|
|
There are many methods:
1. upload the file via Web Services(WWW Service). but you must install Web Server such as IIS in the server. you can upload the file in any size. I solved my problem in this way.
2. via windows Pipe.
3. via windows socket.
|
|
|
|
|
dont forget sergio 'the infomercial king' ... he found a way to tranafer 650mb INSTANTLY! across a MODEM CONNECTION!
heh
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Hi all,
I am trying to create custom edit control (with some additional features, one of them being bitmap background) by inheriting CEdit class. The problem is that background under the letters is erased/overwriten with background color. Does anyone know how to solve the problem? Any workaround suggestions?
Thanks,
Miha
|
|
|
|
|
can you not set the dc text bg to transparent?
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
I have tried to change background mode, but I don't know how to get dc without manualy writing the text. I have tried to overwrite OnPaint function, but didn't help. The problem is that DrawText erases background under the text (as CEdit control does). Only background under letters is erased(not the whole area of the control) Is the catch in changing the BRUSH?
from OnPaint()
----------------------
CDC* dc = BeginPaint(&ps);
dc->SetBkMode(TRANSPARENT);
GetWindowText(m_cText);
dc->DrawText((LPCTSTR)m_cText, -1, &rect, 0 );
ReleaseDC(dc);
EndPaint(&ps);
----------------------
bye
Miha
|
|
|
|
|
yup ... catch the OnCtlColor(...) message and set the dc brush properties to what you require
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
I have put my stuff in OnCtlColor (parent control) and it works
Thanks Lauren!
bye
Miha
Random code generator is the way to go
|
|
|
|
|
I have implemented printing within a MFC application.
I have a weird problem.
When I paint (BitBlt) a bitmap the Print Preview works OK.
However when I Print the page, only a black rectangle appears.
Apparantly I am doing something wrong.
Does someone had a similar problem and found the solution.
Thanks in advance,
Bert
|
|
|
|
|
Hello,
if you ware working with a variable parameter list like (int Number,...) how can you programmatically find out the number of parameters specified?
MSDN Help for va_arg, va_end, va_start does it in the following way using -1 as an extra not processed last parameter.
int average( int first, ... )
{
int count = 0, sum = 0, i = first;
va_list marker;
va_start( marker, first ); /* Initialize variable arguments. */
while( i != -1 )
{
sum += i;
count++;
i = va_arg( marker, int);
}
va_end( marker ); /* Reset variable arguments. */
return( sum ? (sum / count) : 0 );
}
Are there better ways without a finishing last dummy parameter?
--- Rainer Mangold
|
|
|
|
|
The other way is to pass # of arguments as one of 'normal' parameters. However, this increases the probability of an error - you could add one param and forget to increase passed # of param. Generally, you have to know what called function expects on the stack - there's no way to detect this 'automatically'.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Thanks a lot,
this was the answer I expected, although I hoped that there would be a nicer solution.
-- Rainer
|
|
|
|
|
Gurus (if I may call you that )
As a newbie to MFC, should I stop! and start to learn .Net with C++ ?
Or even drop C++ for C#
This takes a big investment in time, and I don't want to learn MFC if its going to die RSN.
Does .Net have a Application Framework like MFC ? If so, is there a C++ specific one or is the framework for ALL langauges now ?
Any pointers greatfully recevied.
|
|
|
|
|
Hello, the codegurus around the world.;)
My basic question is why you want to learn the computer language like C++, C# or so on.
If you want to be the programmer, to learn MFC isn't in vain.
Software company is always looking for a more talented programmer, and
if the applicant has to the ability to write the code by more language,
he or she can find the job more easily.
Besides, C# is still "BETA" version, and I doubt how many companies pick up C# ASAP for
its project as well as how valuable the programmer only know C#.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
C# is not everything, it is not attempt to replace MFC, it is a good complementarity. I think C# is good choice to develop web application, but isn't appropriate to develop a system such as CAD system. C# is compiled at load time, it consume too much time to startup an application, while it isn't a problem in web application.
To MFC or not? the answer is all depend on what you want to do in the future.
|
|
|
|
|
I'm trying to parse a text file (using ANSI C) and extract every word aand insert into link list. Where can I get to see some sample code showing this type of parsing?
TIA.
Hush..Hush.. thought I heard you calling my name now...
|
|
|
|
|
Hi !
If it's acceptable for you to use ANSI C++, the solution is below:
#include <fstream>
#include <string>
#include <list>using namespace std;
int main()
{
ifstream inputfile("readme.txt");
istream_iterator<string> isi(inputfile), iseof;
list<string> ls;
copy(isi, iseof, back_inserter(ls));
return 0;
}
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
becase forume eats some brackets - here is the repost... I think you know that symbols should be instead of "[" and "]"
#include [fstream]
#include [string]
#include [list]
using namespace std;
int main()
{
ifstream inputfile("readme.txt");
istream_iterator[string] isi(inputfile), iseof;
list[string] ls;
copy(isi, iseof, back_inserter(ls));
return 0;
}
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|