|
what is DIBSection, I hear much about?
karanba
|
|
|
|
|
basically, a DIBSection is a DIB that can act like an HBITMAP. you can get at the pixel data as you do in a DIB, but you can use it in functions liek BitBlt, like an HBITMAP.
-c
There ain't no second chance
Against the thing with the forty eyes, girl
|
|
|
|
|
Hi,
In my application, I have some classes which
also use some MFC classes.
what effect would it make if i Convert those Classes to
ATL objects.
I am new to ATL, so please excuse me if there is some
technical glitch..
Please help
Sameer
|
|
|
|
|
By convert do you mean to remove the MFC parts, or do you use MFC with ATL ( which is evil ) ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Actually it is MFC + ATL.. some components of ATL..
But how can i convert my full project to ATL.. and also
can i handle OnTimer() an d messages in ATL..
Please suggest me some sites also..
Thanx
Sameer
|
|
|
|
|
I am trying to add/modify the columns and rows of ClistCtrl, when i compile the code there are no errors but when i run the program its giving some error message 'Illeagal Operation'..
My code is as follows:
for(int c=0; c< nColumnCount; c++)
m_lc.DeleteColumn(0);
//here m_cols is the integer value entered by the user
//and m_rows is also an integer value entered by the user
//m_lc is the ListControl variable
if(m_cols > 0)
{
LV_COLUMN lvcol;
lvcol.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
lvcol.fmt = LVCFMT_LEFT;
lvcol.cx = 80;
CString s;
for(int c=0; c<m_cols; c++)
{
s.Format("Coloum %d",c+1);
lvcol.pszText = (LPSTR)(const char *)s;
lvcol.iSubItem = c;
m_lc.InsertColumn( c, &lvcol );
}
}
The above code i used to delete the existing columns and add new columns which is working fine
but when I tried to add the rows i am getting the error message.
The following is the code i wrote to add the row data
CString s;
for( int i = 0; i < m_rows; i++)
{
LV_ITEM lvitem;
lvitem.mask = LVIF_TEXT | LVIF_PARAM;
lvitem.lParam = 0;
lvitem.iItem = 0;
s.Format( "subitem %d", 0);
lvitem.pszText = (LPSTR)(const char *)s;
lvitem.iSubItem = 0;
int r = m_lc.InsertItem( &lvitem );
for(int c = 1; c < nColumnCount; c++)
{
s.Format( "subitem %d", c);
BOOL b = m_lc.SetItemText( 0, c, (LPTSTR)(const char *)s);
}
}
Can Any one Help me in doing the above??
Thank you.
|
|
|
|
|
If I add buttons while application initialization CToolBar will resize well. But if i do it in the midle of my program there is no CToolBar resizing (but buttons i can see new buttons). If I minimize and then maximiza application, then CtoolBar size will be recalculating an all OK.
Please help me. I was trying to use different pToolBarCtrl->Invalidate and pToolBarCtrl->AutoSize(), but there is no any changes.
|
|
|
|
|
Call the RecalcLayout() method on the parent frame.
--------
I don't think that I'm a sell-out but I do "Enjoy Coke!"... -- Bloodhound Gang, The Inevitable Return Of The Great White Dope
|
|
|
|
|
|
Hi !
I'm building an ATL App with VC++ 6.0.
I added a dialog in my app with the 'Insert->New ATL Object->Miscellaneous->Dialog'.
Then, using the resources editor, I put in this new dialog a CListBox control.
Then, during the InitDialog, I try to add strings to this CListBox control using :
CListBox* pList=(CListBox*)GetDlgItem(IDC_LIST);
pList->AddString("hi");
It compiles fine, but when I run it, I get an assertion failure at the line 'AddString'.
Anyone could help me ?
Thank you !
Jerome
|
|
|
|
|
Hi,
I tried ATLCONTROLS.H ( or whatever name), to get the sugar control classes, but I had some problems as well, have you tried, the "attach" method to attach the HWND.
I rather use, ::SendMessage stuff, when you get used to it it´s not so bad, the message for adding one string is:
LB_ADDSTRING
So something like:
SendMessage(
(HWND) hWnd,
LB_ADDSTRING,
(WPARAM) wParam,
(LPARAM) lParam
);
HTH
Braulio
|
|
|
|
|
Hi,
How do we minize a dialog at the startup i've tried to use
showwindow(SW_MINIMIZE)
in the initdialog but with futile results has anyone done this before will be grateful for any help
Thanks.
|
|
|
|
|
The easiest way is to create the dialog with the WS_MINIMIZE style. One way to do this is to add this style to the dialog template. You may need to edit the .rc file directly in order to do this.
--------
I don't think that I'm a sell-out but I do "Enjoy Coke!"... -- Bloodhound Gang, The Inevitable Return Of The Great White Dope
|
|
|
|
|
Oops! i checked it out an it hasn't worked. or may be is there a way to hide the dialog at the statup.
|
|
|
|
|
Yes, I'm still fumbling around with the basics of MFC. I've got a CSettings class of which I declare an instance "settings" as a member of CMyApp.
So I've got:
class CMyApp : public CWinApp<br />
{<br />
public:<br />
CSettings settings;<br />
}<br />
When someone selects Settings... from the menu, the framework calls CChildView::OnFileSettings().
How can I access the settinngs I've got stored in CMyApp::settings ? AfxGetApp() just returns a pointer to the base class, CWinApp.
Confused.
- Jason
(SonorkID 100.611)
"I just recieved an email from myself but I didn't send it ?"
- Colin Davies, Sonork conference
|
|
|
|
|
Well, there's probably a global variable named theApp around somewhere, otherwise just cast the return value of AfxGetApp() to a CMyApp* [edited: yeah, forgot about the <> thing):
CMyApp* pApp = static_cast<CMyApp*>(AfxGetApp());
--------
I don't think that I'm a sell-out but I do "Enjoy Coke!"... -- Bloodhound Gang, The Inevitable Return Of The Great White Dope
|
|
|
|
|
Just do this ...
CMyApp * pApp = (CMyApp*)<code>AfxGetApp()</code>;
Best regrads,
Eugene Pustovoyt
|
|
|
|
|
The cast of the AfxGetApp will work but I think its a problem of the architecture. Why you should one (of many) CChildView objects modify an element of the app?
IMHO: delete the "CChildView::OnFileSettings()" and create the OnFileSettings() -Message-Handler in the Mainframe or App class.
|
|
|
|
|
I use COXHyperLink from Dundas Ultimate Toolbox to display two links. In Win2K/XP I have following problem: by default, this OS hides underlied letters on buttons/menus (these letters used for quick access with Alt, for example &Close). When I press Alt key, captions became underlined. COXHyperLink uses subclassing of static control.
TROUBLE:
After Alt pressing hyperlink disappears, and only gray background is visible. How can I fix the problem by myself?
See image here
|
|
|
|
|
Hi there,
I have tested the latest version of this class, and I was not able to replicate the issue you have indicated. I was also not able to view the image you have linked to, please contact Dundas Tech Support, lets work together to locate and resolve this issue.
Peter
Dundas Technical Support
|
|
|
|
|
=======================================================
Win32 Debug
-------------------------------------------------------
Generating Code...
Linking...
Creating browse info file...
AhMan_Language_Swap.exe - 0 error(s), 0 warning(s)
========================================================
========================================================
Win32 Release
-------------------------------------------------------------
Linking...
msvcrt.lib(MSVCRT.dll) : error LNK2005: _sprintf already defined in LIBCMT.lib(sprintf.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __itoa already defined in LIBCMT.lib(xtoa.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __setmbcp already defined in LIBCMT.lib(mbctype.obj)
msvcrt.lib(MSVCRT.dll) : warning LNK4006: _sprintf already defined in LIBCMT.lib(sprintf.obj); second definition ignored
msvcrt.lib(MSVCRT.dll) : warning LNK4006: __itoa already defined in LIBCMT.lib(xtoa.obj); second definition ignored
msvcrt.lib(MSVCRT.dll) : warning LNK4006: __setmbcp already defined in LIBCMT.lib(mbctype.obj); second definition ignored
Creating library Release/AhMan_Language_Swap.lib and object Release/AhMan_Language_Swap.exp
Release/AhMan_Language_Swap.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
AhMan_Language_Swap.exe - 4 error(s), 3 warning(s)
==============================================================
Why error in release compile but not in debug compile
|
|
|
|
|
Try to change the setting :
From the VC++ menu:
Project -> Settings...
Go to C/C++ tab, choose "Code generation" category.
Try other choices listed in "Use run-time library:",
for example: Debug ones or non debug ones, DLL ones or non DLL ones.....
Maxwell Chen
People say "No news is good news". Then, no code is good code!?
|
|
|
|
|
How can i turn off the little blinking cursor in console c++?
i have a text game that is a big loop and the game field is stored to an array that is outputted, but when its run on slow computers u can see the cursor moving down in row in the array, is there a way to turn this off?
i asked a while back and Nish kindly gave me this code:
char abc[128];
int main(int argc, char* argv[]){
HANDLE h;
h= CreateConsoleScreenBuffer(GENERIC_WRITE|GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,CONSOLE_TEXTMODE_BUFFER,NULL);
SetConsoleActiveScreenBuffer(h);
CONSOLE_cursor_INFO cci;
cci.dwSize = 90; cci.bVisible=false;
SetConsolecursorInfo(h,&cci);
cin >> abc;
but i couldn't get it to work within my specific program,
can anyone help me out?
-ryan
|
|
|
|
|
After you check the case of some stuff there (struct name and function name), this code works as-is.
|
|
|
|
|
Ok THis should be really easy, but as you all know frustration is the number one killer of compurter keyboards, so i've given up.
I have a loop that refreshes a OpenGl screen rendering contect.
What is the easiest and most reliable way to measure the the time taken to run through the loop I.E FPS. What time functions can I use to get the elapsed time in ms.
Thank you.
|
|
|
|