|
SORRY TO BE CURIOUS.
And thanks for your suggestions, now i have cleared my doubs.
Thanks a lot
|
|
|
|
|
Hi,
I created MFC application (dialog based) and it is meant for loading bitmaps through
the edit box(bitmap paths) and custom control for showing flipping action among bitmaps.
but unfortunately my dialog which was poing up suddenly got stopped poping up while
i run the application and select from menu bar that dialog.The dialog has it's own header and souce where implementation is done but unless it never pops up, i cannot test
the flipping functionality.
Can anyone help me immediately -quite urgent?
|
|
|
|
|
Set breakpoints in your code and step through to see which part is causing the error.
|
|
|
|
|
Hi,
I want to store a list of strings. Something like this:
Name1 a1
Name1 a2
Name1 a3
Name2 b1
Name2 b2
For just a list of Name’ i.e. Name1, Name2 ‘I can use CStringList. But how do I store the ‘Name’ and its corresponding data in a single list.
I cannot use an array[][] because I do not know the exact size to allocte it at runtime.
Please can you tell me how to do it.
Maybe I can store the whole line as a string i.e. Name1 a1” “ and then use sscanf to get the separate strings?? Would that be correct?
Fortitudine Vincimus!
|
|
|
|
|
struct MyData
{
CString strName;
CString strData;
};
CArray<MyData> data;
CList<MyData> data;
|
|
|
|
|
Thank you.
Fortitudine Vincimus!
|
|
|
|
|
u can also use mulimap which will help you in faster retreival of data .
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
Hi. I am a newbie.
In C, I managed to read a file which consists of a single string.
How do I pass this string to VB via an OCX?
I was thinking of creating a safearray to do it but I am not to sure how to safearray a string. I have only managed to do it for numbers.
Thanks in advance!
|
|
|
|
|
U must convert c string to BSTR, then pass it to VB,
life is like a box of chocolate,you never know what you r going to get.
|
|
|
|
|
Bratis wrote: I was thinking of creating a safearray to do it but I am not to sure how to safearray a string. I have only managed to do it for numbers.
Is Creating SAFEARRAY of type VT_BSTR has any problem ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
An class declaration eritten below. i can't understand how it is written, i.e. which is base class & which is derived class & WHICH ARE THE MEMBER FUNCTIONSplz help me to make it clear???
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
|
|
|
|
|
|
Nirmal Khatri wrote: CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
this is not a class declaration. It is the definition of the custructor of the class CAboutDlg.
Actually there will be class called CAboutDlg derived from the class CDialog like below.
class CAboutDlg : public CDialog<br />
{<br />
public:<br />
CAboutDlg();<br />
<br />
enum { IDD = IDD_ABOUTBOX };<br />
<br />
protected:<br />
virtual void DoDataExchange(CDataExchange* pDX);
<br />
protected:<br />
DECLARE_MESSAGE_MAP()<br />
};
nave
|
|
|
|
|
It wasn't written by me.
If u start a dialog based application, The appwizard generate the above code for u.
nave
|
|
|
|
|
This is not the declaration of a class
This is the constructor of the class CAboutDlg and is derived from CDialog
"Dream bigger...Do bigger...Expect smaller"
aji
|
|
|
|
|
Hi, All
Purpose of my dialog:
When user chose color from CColorDialog, i make color value to Hex value.
three edit include on this dialog.
I wrote my class public from CColorDialog
class CColorDialogExt : public CColorDialog
and i add three edit control to my class:
BOOL CColorDialogExt::OnInitDialog()
{
CColorDialog::OnInitDialog();
m_pRed->Create(WS_EX_STATICEDGE | WS_EX_CLIENTEDGE | ES_LEFT | WS_CHILD | WS_VISIBLE | WS_TABSTOP ,CRect(445, 203, 475, 220), this, 1000);
m_pGreen->Create(WS_EX_CLIENTEDGE | ES_LEFT | WS_CHILD | WS_VISIBLE | WS_TABSTOP ,CRect(445, 225, 475, 242), this, 2000);
m_pBlue->Create(WS_EX_CLIENTEDGE | ES_LEFT | WS_CHILD | WS_VISIBLE | WS_TABSTOP , CRect(445, 247, 475, 264), this, 3000);
return TRUE;
}
So, three edit view ok, when i change color, i want to get color value (COLORREF)
but i can not get it.
( action : OnLbuttonDown)
Can you help me now?
Thank for advance.
Huynhnb
.: Your success is also mine :.
|
|
|
|
|
forst get the color value (COLORREF actually it is a DWORD)
use the following macros
GetRValue - for Red value
GetGValue - for Green value
GetBValue - for Blue value
this will return a byte value.
format to hex value using sprintf or CString.Format functiion
put these values to your edit boxes.
HTH
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
i use
COLORREF color = GetColor();
but value of color = 0;
i don't know why?
my function:
void CColorDialogExt::OnLButtonDown(UINT flag, CPoint mousePos)
{
COLORREF clColor = GetColor();// clColor value alway = 0
DWORD dwTemp;
CString strTemp;
dwTemp = GetRValue(clColor);
strTemp.Format("%d", dwTemp);
m_pRed->SetWindowText(strTemp);
dwTemp = GetGValue(clColor);
strTemp.Format("%d", dwTemp);
m_pGreen->SetWindowText(strTemp);
dwTemp = GetBValue(clColor);
strTemp.Format("%d", dwTemp);
m_pBlue->SetWindowText(strTemp);
CColorDialog::OnLButtonDown(flag, mousePos);
}
Huynhnb
.: Your success is also me :.
|
|
|
|
|
I think the value will upate to its color ref member on DoModal function.
it has a colorchooser memmber. ( CColorDialog::m_cc.rgbResult )
huynhnb wrote: COLORREF clColor = GetColor();// clColor value alway = 0
change this to
COLORREF clColor = m_cc.rgbResult;
seems this will work
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
COLORREF clColor = m_cc.rgbResult;
but m_cc.rgbResult still zero, when i OnOK to Close dialog, rgbResult will have value.
to SaRath: i have just visited your blog, very cool.
Huynhnb
.: Your success is also me :.
|
|
|
|
|
Can you show how you to use for get values and get color
when you use
<br />
CColorDialog m_dlg;<br />
m_dlg.DoModal();<br />
COLORREF color=m_dlg.GetColor();<br />
you can get color anyway you derived ColorDialog but i think its not problem
whitesky
|
|
|
|
|
he is trying to get the color from an a class derived from CColorDialog
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
yes i see but i think it not problem you use CColorDialog now you use CMyColorDialog
whitesky
|
|
|
|
|
huynhnb wrote: i have just visited your blog, very cool.
thanks alot for your comment
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|