|
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
|
|
|
|
|
struct TestStr {
CString m_str;
};
TestStr varTS;
varTS.m_str = _T("Another way");
TestStr* pTS = &varTS;
pTS->m_str = _T("Hello");
|
|
|
|
|
toxcct wrote: TestStr* pTS;pTS->m_str = _T("Hello");
this time to what pTS is points to????
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
my mistake. fixed it. see the previous post.
|
|
|
|
|
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
can you please show us the code around where it crashed ?
i see no pb in the line you shown, but maybe px is pointing to nowhere (NULL ?)...
|
|
|
|
|
USER * pUser = new USER;
if (NULL == pUser)
{
return NULL;
}
ZeroMemory(pUser, sizeof(USER));
pUser->pMember = pMember;
hr = pMember->GetName(&bstr);
if (FAILED(hr))
{
AddLog("Problem with GetName");
}
else
{
name = BSTRtoStr(bstr);// THIS IS MY FUNCTION
//pUser->strName.Insert(0,name); -----******* HERE WHERE IT IS CRASHED
SysFreeString(bstr);
m_ListMembers.InsertString(-1,name);
}
KIRAN PINJARLA
|
|
|
|
|
|
typedef struct USER
{
INmMember *pMember; //INmMember is a componant Interface
CString name;
}USER;
KIRAN PINJARLA
|
|
|
|
|
why do you use CString::Insert() instead of CString::Operator = ???moreover, how is declared name ??
|
|
|
|
|
Actually i tried all assignments of CString and insert was one of it.
I tried name =..., name.Format("%s",...
But it doesnt work.
KIRAN PINJARLA
|
|
|
|
|
it's not what i'm asking. how is declared name ?
1. CString name;
2. char* name;
3. char[] name;
4. other...
|
|
|
|
|
its declared as
CString name;
KIRAN PINJARLA
|
|
|
|
|
then, where you wrote
pUser->strName.Insert(0,name); -----******* HERE WHERE IT IS CRASHED
what happens with the following code if you dirrecly affect strName ?? :
ASSERT(pUser != NULL);
pUser->strName = _T("hello");
|
|
|
|
|
The first thing i did was that. It failed there, then i tried differenct ways.
KIRAN PINJARLA
|
|
|
|