|
You can always use double buffering.
Copy the current contents as a bitmap. As the drawing moves,
blt the bitmap to a memory dc, do the drawing at its new location
on the memory DC, then blt from the memory DC to the screen. It'll be
nice and smooth.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for the good suggestion. But i'm already using a background image as a bitmap. All drawing i do on top of background image.
So i cant take all drawing in another bitmap.
Manoj Kumar Chauhan
|
|
|
|
|
MKUser wrote: i cant take all drawing in another bitmap
Can't or won't?
I know you "can". I do it for video/image window drawing, where the image is
offscreen, a snapshot of the window background is offscreen, all drawing is
done offscreen except for final blt. Appears smooooth.
Any time you redraw a background followed by a redraw of the foreground on
the screen, there's going to be flicker. You can't avoid it without doing it
in the background/memory.
If you can use other's suggestions by drawing/erasing only the "foreground"
using logical ops, then that's you're only other option.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
How can remove these MCI errors
1.
"MCIERR_INVALID_FILE" meaning of this is "The specified file cannot be played on the specified MCI device. The file may be corrupt or may use an incorrect file format."
2.
The specified file cannot be played on the specified MCI device. The file may be corrupt, not in the correct format,or no fill
modified on Wednesday, January 16, 2008 4:43:11 AM
|
|
|
|
|
Compiler, linker, or run-time errors? Do you suppose a relevant code snippet might be at all helpful?
"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
|
|
|
|
|
Dude, I really believe you need to tell your supervisor that you can't do this project. I believe you simply don't have the depth to complete a project like this. You reposted the same question at least 7 times, and recieved answeres on every thread. You couldn't impletment the suggestions. You even had source code, examples, etc that would help you get the job done. I'm not trying to be rude, but this project is way out of your league, you need to give it up.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Hello!
I have an application that runs under the SYSTEM account (it's a Windows service).
Is there any possibility that I can make the service run under a limited user account? (I want to make the application access the network resources; running under SYSTEM forbiddens me to do that)
I must mention that I cannot afford to restart the SYSTEM application or create another process from it, that runs under that limited user account.
So, what I want is to make the service appear like running under the limited user account, on-the-fly, if I am permited to say it this way...
I've already tried ImpersonateLoggedOnUser(), but the application still runs under SYSTEM and I cannot connect to a proxy server this way.
Can anyone help?
Thanks in advance!
|
|
|
|
|
Look at the final two parameters to the CreateService function.
Judy
|
|
|
|
|
Also, maybe there's some useful info here:
Service User Accounts[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hello.. i want to know how to make fingerprint software using c++/mfc
for the interface i have completely done
but i don't know how to interact the source code with gui
actually i will focus on fingerprint enhancement and ridge reconstruction only
can anyone help me or maybe just let me know where to find the source
thanks,
faz
|
|
|
|
|
How about entering some [ex: fingerprint recognition software] of the keywords in some search engine.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Can anybody tell me the way os getting this answer
#define f(g,g2) g##g2
main()
{
int var12=100;
printf("%d",f(var,12)));
}
Ans:100
Thanks in advance
|
|
|
|
|
Upon Preprocessing completion (but before compilation), the statement printf("%d",f(var,12))) ; gets expanded to printf("%d",var12)) . So the answer, 100.
In macro f(g, g2) , u r passing var and 12. The statement g##g2 joins the original parameter to the macro i.e, var##12 = var12 . Hence the resulting variable, var12
Come online at:-
jubinc@skype
|
|
|
|
|
Have you considered compiling with the /P switch to see just what the preprocessor resolves the macro to?
"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
|
|
|
|
|
Hi,
I have created a dialog in a dll and exposed that method.It is being used by java code through JNI.
Once the dialog is created I want my dialog to stay till the user closes
the dialog. But unfortunately as the java application exits,obviously my dialog also gets killed.
What should I do so that my application doesn't exit and my dialog stays
till the user closes the dialog?
Thanks
Today is a gift, that's why it is called the present.
|
|
|
|
|
Can you stop the java application from exiting. Just hide the java application window so that it's process still runs in the background and the other dialog in the dll can be closed by the user later on...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
hello,
I am trying to create an mshtml document object from an html buffer. But when the following code is executed it is invoking internet explorer window. Any body know how it can be prevented.
CString strHTMLCode = _T("<html><head><script language=\"JavaScript\">{top.location.href=\"index.php\"}</script></head><body></body></html>");
CComPtr<IHTMLDocument2> pDoc;
HRESULT hr = CoCreateInstance(CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER, IID_IHTMLDocument2, (void**)&pDoc);
SAFEARRAY* psa = SafeArrayCreateVector(VT_VARIANT, 0, 1);
VARIANT *param;
hr = SafeArrayAccessData(psa, (LPVOID*)¶m);
param->vt = VT_BSTR;
param->bstrVal = strHTMLCode.AllocSysString();
hr = pDoc->write(psa); //This line invoks internet explorer window.
hr = pDoc->close();
Thanks,
Shino
|
|
|
|
|
Is that enough TLAs in the title?;o)
I develop a CAD tool that generates multiple reports in RTF format, making heavy use of tables. My users want to be able to embed the reports on the CAD drawing.
However, if I use WordPad (write.exe, using RichEdit50W) to open the RTF file, the tables do not render correctly.
If, in WordPad again, I use 'Insert|Object|Create from file' on the RTF file it is embedded as a Word document and does render correctly.
Is there a RichEdit control I can use for embedding that will render properly? I'm not keen on introducing a dependence on Word.
Cheers.
|
|
|
|
|
Nevermind... I found one. Unsurprisingly, its made by the same folks who provided us with our report generator...
|
|
|
|
|
Hello All:
I have some hardware with given .DLL & .H files. I have created an MFC Application with Single Document Interface that have the following drop-down as follow.
File
-Regester.
-Write Register.
My goal in to have the CView display what is On the Register when select -Register or -Write Register.
Could someone please help direct me to the right path??
Here is the Header contains:
#include <string>
#ifdef BUILD_SCANPORT_DLL
#define DLLEXPORT2 __declspec(dllexport)
#else
#define DLLEXPORT2 __declspec(dllimport)
#endif
#define SETBIT 1
#define CLRBIT 0
#define CSR0 0x00 //scanner register locations
#define CSR1 0x01
DLLEXPORT2 int readreg(int reg); //some prototypes
DLLEXPORT2 void writereg(int reg, int value);
DLLEXPORT2 void writebit(int reg, int value, bool clear);
DLLEXPORT2 int checkwarmup();
DLLEXPORT2 float checkbattery();
typedef enum ScanStatus {
SCAN_OK,
SCAN_FAIL_FILE_ERROR,
SCAN_FAIL_USB_OPEN_ERROR,
SCAN_FAIL_USB_XFER_ERROR
};
DLLEXPORT2 ScanStatus scanport(bool doClean, bool doSharpen, const char* outFile);
Thanks in advance for your help
Eyungwah
|
|
|
|
|
Your question can be broken into a few parts.
Using class wizard, add menu handlers to your CMyDocument casll for (eg) IDM_REGISTER and IDM_WRITEREGISTER. In those handlers, do whatever the hardware thing you want to do is, and store the value that you'll want to display in eg CString m_MyValueToReport.
To then get your CMyView to update and display the new string, just call UpdateAllViews in your menu handler.
Then, in CMyView::OnDraw, just display the new string
void CMyView::OnDraw (CDC *pDC)
{
CMyDoc *pDoc = GetDocument ();
ASSERT(pDoc);
....
pDC->TextOut (x,y, pDoc->m_MyValueToReport);
....
}
Going back to the hardware stage, the header file doesn't look like there's any call saying "tell me what was recently written", so you're going to have to keep track of the value you write to the register. Beyond that, the help file / documentation that comes with the USB device/SDK should be of more help than us.
Good luck,
Iain.
|
|
|
|
|
Just moved to "new" PC and having this anoyning problem with Windoze beeping. It beeps when I open modal dialog and when I try to close parent window when modal dialog is on.
Standard MFC About dialog opens without beep and beeps when I try to close the parent window also.
I have no sound card in my PC and all sounds options are grayed out.
It looks like some kinda of Windoze error beep, but I cannot find nowhere how to disable it. I am about to clip the beeper off the motherboard!
Anybody has better idea?
Is this VC++ or Windows "problem"?
I am running Windows 2000 advanced server on Dells Dimension 1000.
The "problem " is only in VC++ 6.0 during debug run ( I have not tryed release) and
I have not have this problem on my "older" PC runing same software.
Thanks for reading.
Cheers
Vaclav
|
|
|
|
|
I used a big hammer. No sounds from my computer anymore.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Vaclav_Sal wrote: Does size matter??
Depends on how much a smile you want to receive...
Oh wait, this isn't the soapbox!
Iain.
|
|
|
|