|
narayanagvs wrote: So any suggetions to Optimize my code would be helpful.
I haven't gone through your code but I would like to suggest a memory bitmap.
Write a dedicated class called CMemDc and ask it to do the stuff for you. Search google with "Memory DC VC++".
Directly doing the drawing into this dc and dumping the drawing will help in reducing flicker. Saving this drawing will help further. But you will have to take care of other things.
These are some quick suggestions.
|
|
|
|
|
Using GetPixel and SetPixel is SLOW! Every call needs to calculate the offset into the pixel
data.
I would start with a DIBSection - an HBITMAP that can be selected into a DC but you can directly
access the pixel data using a pointer.
See CreateDIBSection[^]
The CImage class can help wrap the DIBsection since you're using MFC.
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Hi All,
In my application i need to identify the drives available in my PC and the type(Ex: USB Floppy / Removable Disk etc -- The same way as shown in "MyComputer")
But while using the "GetDriveType" API, it returns only the type as DRIVE_UNKNOWN / DRIVE_REMOVABLE etc., But here i should know whether its a USB floppy or a removable one. Can anyone of you help me?
Thanks in advance.
Thanks & Rgds,
Sri..
|
|
|
|
|
Hi,
Hope this helps ...
Take the following into consideration, and then have a look a the function _getdrive() on MSDN.
curdrive = _getdrive();
for( drive = 1; drive <= 26; drive++ )
{
if( curdrive == drive )
{
sprintf(lpdrive, "%c:\\", drive + 'A' - 1 );
sprintf(szDirPath,"%s",lpdrive);
CreateDirectory(szDirPath, NULL);
}
}
Regards,
-- modified at 5:53 Tuesday 27th March, 2007
Sorry didn't read the whole question ... thus my answer won't help, seeing that you want the physical name.
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
"QueryDosDevice" API shall be used for getting the deivce path name. And after that we can search for the string "floppy" in the return string of QueryDosDevice.
Thanks & Rgds,
Sri..
|
|
|
|
|
PSrividya wrote: Can anyone of you help me?
Lots of information here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi
what is the difference bet these throw.
void Fun() throw();
void Fun() throw()=0;
void Fun() throw(bad_alloc)=0;
<\pre>
<div class="ForumSig">VIBIN
"Fool's run away,where angle's fear to tread"</div>
|
|
|
|
|
vibindia wrote: void Fun() throw(); //can throw any exception,I think
Yes.
See Steve's reply for this.
vibindia wrote: void Fun() throw()=0;void Fun() throw(bad_alloc)=0;
I guess, there should be virtual specifier mentioned.
These are pure virtual functions(assuming virtual specifier).
-- modified at 1:56 Tuesday 27th March, 2007
-- modified at 2:01 Tuesday 27th March, 2007
|
|
|
|
|
prasad_som wrote: vibindia wrote: void Fun() throw(); //can throw any exception,I think
Yes
This actually means that the function does ***NOT*** throw any exceptions. On a compiler that supports exception specifications if the function does try to throw one std::unexpected is called which usually terminates the program.
Steve
|
|
|
|
|
Thanks for correction !
|
|
|
|
|
ya now i got it. They are having virtual keyword.(pure virtual function>
i was confused with that throw() in betweeen
virtual void Fun() throw();
virtual void Fun() throw()=0;
virtual void Fun() throw(bad_alloc)=0;
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
|
See here[^] for the details on exception specifications.
|
|
|
|
|
Hi
All
I want to use Dialog as MessageBox in my project, so i want to load error icon,exclamation mark icons on my dialogBox. I want to do this at run time so how can i do it?
Thanks in Advance
Atul
Atul
|
|
|
|
|
If you wanted these icons in message box, then you can mention it while displaying message box only.
e.g.
AfxMessageBox(_T("Error message"),MB_ICONERROR);
AfxMessageBox(_T("Error message"),MB_ICONEXCLAMATION); In other places see following methods.
M. Atul wrote: i want to load error icon
Use IDI_ERROR .
M. Atul wrote: exclamation mark icons on my dialogBox.
Use IDI_EXCLAMATION .
Use LoadIcon[^] and SetIcon to load these predefined icons.
|
|
|
|
|
Thanks
Prasad
But i want to Load it at run time, in which event of DialogBox i have to write code. plz explain some more code.
Atul
|
|
|
|
|
M. Atul wrote: But i want to Load it at run time, in which event of DialogBox i have to write code.
As explained earlier, AfxMessageBox should suffice you if you are not doing any customization with it.
Otherwise, Override OnInitDialog to look it something similar to,
BOOL CMyDlg::OnInitDialog()
{
...
SetIcon(LoadIcon(NULL,MAKEINTRESOURCE(IDI_ERROR)),FALSE);
return TRUE;
}
|
|
|
|
|
Hai,
Iam using this line for getting the commandline argument.
The error iam getting is:
wchar_t** szArglist = ::CommandLineToArgvW( ::GetCommandLineW(), &numArgs );
error C2039: 'CommandLineToArgvW' : is not a member of '`global namespace''
error C2065: 'CommandLineToArgvW' : undeclared identifier
error C2440: 'initializing' : cannot convert from 'int' to 'unsigned short ** '
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast.
Can anyone suggest how to rectify this error..
Thanks & Regards,
Harshadha
|
|
|
|
|
Add a #include <shellapi.h>
Steve
|
|
|
|
|
Hai Steve,
I have included the needed header files and Lib file(Shell32.lib).Actually my code is working in VC++ but the same code is not working in EVC.
Thanks For Spending Your Precious Time by Replying...
Thanks & Regards
Harshadha.
|
|
|
|
|
harshadha wrote: but the same code is not working in EVC.
Its no supported on that platform.
|
|
|
|
|
Hai,
Do you have any idea how to use that in EVC
Thanks
Harshadha
|
|
|
|
|
harshadha wrote: Do you have any idea how to use that in EVC
No.
Possibly, you can get help from mobile development[^] forum.
|
|
|
|
|
Q1:
if(action&ODA_FOCUS)
{
CBrush brush(RGB(255,0,0));
pDC->FrameRect(&rectItem,&brush);
}
I wonder why I do this in DrawItem,when I ran the program and clicked the item which is not the first one,the first item's edge turned red too?
Q2:
What is difference between ODA_FOCUS and ODA_SELECT?
Q3:
As I click an item in a listbox,and then I click another control,does combination of (state & ODS_SELECTED)&& !(action&ODA_FOCUS) correspond to the item I clicked firstly?
|
|
|
|
|
No one is interested in this problem?~~~
|
|
|
|