|
NoName II wrote: //: CDialog(CMyDlg::IDD, pParent)
You should remove this code from your constructor. because it will create a dialog with the IDD (resource ID) you are passing. that is why it failed.
see MSDN to know how to create modeless dialog?[^]
You can see the following in the documentation... that
For a modeless dialog box, you must provide your own public constructor in your dialog class.
|
|
|
|
|
Sarath. wrote: because it will create a dialog with the IDD (resource ID) you are passing
i don't agree
see the code inside the constructor.
CDialog::CDialog(UINT nIDTemplate, CWnd* pParentWnd)<br />
{<br />
AFX_ZERO_INIT_OBJECT(CWnd);<br />
<br />
m_pParentWnd = pParentWnd;<br />
m_lpszTemplateName = MAKEINTRESOURCE(nIDTemplate);<br />
m_nIDHelp = nIDTemplate;<br />
}
is only sets the member varaiable.Wont create the dialog
nave
|
|
|
|
|
yes once I had went through the code...
for the ease of undestanding I explained it that manner.
when creating a modal dialog, the error occurs at module state handling.
The function get called twice. first on the ctor and Create function
Anyway I dont know more about the same. It would nice informative if you share how a modal dialog asserts on the above scenario
-- modified at 6:48 Monday 31st July, 2006
|
|
|
|
|
check the code he posted.
in the constructor itself he creates the dialog. I.e
CMyDlg dlg; // Dialog is created in this line itself.
then he calls
dlg.Create(...) the dialog is already created, hence Assertion fails will come and most probably from the function
void AFXAPI AfxHookWindowCreate(CWnd* pWnd)
{
..........
ASSERT(pWnd->m_hWnd == NULL); // only do once
...........
}
nave
|
|
|
|
|
So it's not part of CDialog. it's part of CWnd right? then how the creation with template name specified occurs?
|
|
|
|
|
Sarath. wrote: then how the creation with template name specified occurs?
i dont understand what u mean. In what ever way create the dialog, atlast ::CreateDialogIndirect(..) funtion is called.
nave
|
|
|
|
|
Sarath. wrote: You should remove this code from your constructor.
That code is fine. It was the extra Create() call that was the problem. Note the assertion indicated exactly what the problem was (i.e., the window handle was non-NULL ).
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hope I understood your question
<br />
CMyDlg *mydialog;<br />
mydialog=new CMyDlg(this);<br />
<br />
CMyDlg::CMyDlg(CWnd* pParent)<br />
: CDialog(CMyDlg::IDD, pParent)<br />
{<br />
Create(pParent);<br />
ShowWindow(SW_NORMAL);<br />
}<br />
|
|
|
|
|
Sachin Gedam wrote: Now I am facing a problem, how to get this abbreviation from client side?
Why aren't you using GetTimeZoneInformation() ?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i want client's(web browser) time zone information.. now i store time zone related information in xml file and to access particular time zone information only time zone abbrevatoin is only the way
Sachin Gedam
(Software Engg.)
Pune India
|
|
|
|
|
I don't quite follow you. You wanted to know how to obtain the timezone using Visual C++. I suggested you use GetTimeZoneInformation() . Now you are talking about browsers and XML files. What exactly is it that you are looking for?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi..can anyone help me out of thiss???
i trying to load a a ImageList of 24Bit Color Bitmap , but when it draw on a Static Control ot Losses it Quality to 16 Color im doing this to load a Image List :
/////////////////////////////////////////////////////////
[B]
CImageList m_imgList;
HIMAGELIST hImageList = ::ImageList_LoadImage ( AfxGetInstanceHandle(),
_T("d:\\total.bmp"),
64, 32,
RGB(255,255,255),
IMAGE_BITMAP, LR_LOADFROMFILE);
if(NULL != hImageList)
{
BOOL bRet = m_imgList.Attach(hImageList);
HICON m_hIco = m_imgList.ExtractIcon(0);
//CStatic Control on Dialog with SS_ICON
m_bBitmap.SetIcon(m_hIco);
}
/////////////////////////////////////////////////////////[/B]
i also tried to Draw the Extracted Image to Dialog box by calling the Funtion in CImageList
Draw(....); and DrawIndirect(...); and same problem done in this Also.. the Quality of Image loss
please please help me out of this
|
|
|
|
|
It's my recollection that you need to create an empty image list and copy the 24 bit images into it in order for them not to revert to the lower bit depth.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thnx for reply... but can you tell me how to copy the 24bin image to CimageList.. and i want to Animate the Images, but if i load one by one image into the Imagelist in Startup initailization then it takes a lot resource and thr will be lots of bitmap image files in the skin folder. like if i want to create a animation of 20 frames then user have to create the 20 images , and i think its better if we use a Image List instead of loading a Single bitmap into imagelist without lossing qualit !
please tell me a way out of this.. thnx
|
|
|
|
|
There are actually articles on this site with 24 bit images in toolbars. It would be easier for you to read one of them than for me to repost the code here.
If you want to create a 20 frame animation, you will need to load 20 images, they take up the same size in an image list as they do in a bitmap.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Can I use serialization on a RecordSet Class? To be more exact. I have a program which does all sorts of things with a database. Can I save the results of a querry in a file? And can I load them when I want?
|
|
|
|
|
tanarnelinistit wrote: Can I use serialization on a RecordSet Class?
Yes.
tanarnelinistit wrote: Can I save the results of a querry in a file? And can I load them when I want?
Most definitely (to both).
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
Sanroop wrote: bitmaps to combobox
See Here
[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
You can derived CComboBox and use from WM_DRAWITEM
like this
void CMyCombo::DrawItem(LPDRAWITEMSTRUCT lpDrawItem)
{
CDC dc;
CString str;
dc.Attach(lpDrawItem->hDC);
CRect rect(lpDrawItem->rcItem);
...
...
DrawIconEx(dc.GetSafeHdc(),rect.left,rect.top,
hIcon,0, 0, 0, NULL, DI_NORMAL);
...
...
dc.Detach();
}
|
|
|
|
|
I have a structure x which have a CString s; in it. I have created a pointer to that structure; In one of my functions i want to assing a string to that 's'; i wrote px->s = "y"; There i am getting an debug assertion failure window.
Can u show me the way.
Thank you.
KIRAN PINJARLA
|
|
|
|
|
did you create the structrure with the new operator?
modified 9-Mar-17 17:14pm.
|
|
|
|
|
|
why creating the struct in the heap ?
no need to call new .
|
|
|
|
|
Then how do you want to create the struct???
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|