|
currentIE = (UplinkMapIE*)malloc((uplinkMap->numberUL_MAP_IE + 2) * sizeof(UplinkMapIE));
Can anyone explain whats going on here at all? Thanks in advance
Ste
|
|
|
|
|
it's allocating (uplinkMap->numberUL_MAP_IE + 2) * sizeof(UplinkMapIE) bytes. sizeof(UplinkMapIE) is the size of the UplinkMapIE structure (or class). so, it's allocating room for (uplinkMap->numberUL_MAP_IE + 2) UplinkMapIE structs.
then it's assigning the return from malloc to a pointer to an UplinkMapIE.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
As i told you that i have inserted media player in my application as an activex control. I allow user to select a media file using File open dialog. Then the selected file will be played in that media player. I do not want to open saparate media player to play file. Also play, as i know is not a valid verb for ShellExcute function.
We Believe in Excellence
|
|
|
|
|
i want the text to be formatted like.. value of x=5, for doing this,
CString msg ="value of x=";
int num =5;
Msg.Format(Msg,"%d", num); //i dont want like "value of x" here lke ("val of x"%d,num)
output should be --> "value of x=5"
but its printing only --> "value of x"
regards,
Rookie
|
|
|
|
|
Look here[^]
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
hi,
you schould do one of the following:
CString strMsg = "value of x = %d";<br />
int num =5;<br />
<br />
strMsg.Format(strMsg, num); <br />
<br />
CString strMsg = "value of x =";<br />
int num =5;<br />
<br />
<small></small><br />
strMsg.Format(strMsg + "%d", num);
The reason you ended up without the 5 is because the Format function didn't see any formating paramaters and therefore only placed "value of x=" in the object.
Hope this sets you on the way
Regards,
Kurt Pattyn
codito ergo sum
|
|
|
|
|
nice stuff frm u and marc... thanx guys..
its done
regards,
Rookie
|
|
|
|
|
And don't forget:
<br />
CString strMsg = "value of x =";<br />
int num =5;<br />
<br />
strMsg.AppendFormat("%d", num);<br />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
Hello
I have added windows media file in dialog based application as an activeX control. Now i want to play a file in it. Please tell me how can i do that?
Thanks
We Believe in Excellence
|
|
|
|
|
I am creating an MFC application with activeX document server support. The application runs perfectly fine when i run as a standalone application. But when i run the application in Internet explorer,
it opens however opening a form from the top menubar, it gives an error "access violation reading
location" having error code 0xC0000005 (Running in standalone mode does not give this error).
I have used global pointers to the objects I need.
In application class, i have declared a object as
TestClass* tm; //tm is a global pointer to TestClass
In application class, InitInstance() function i initialize the pointer as
tm = new TestClass();
AND i call the following code on Menu click as
{
tm->doModal();
}
I get the access violation error when i call DoModal().
I have to use tm as a global pointer to TestClass since using
local pointer has not worked. If you have any workaround, please help.
Thanks.
Bruce
|
|
|
|
|
Is there a more standard way from within MFC to get the current working directory? What I’m using is _getcwd(buff, 50). It does the job, but I’m wondering if I should be using something else (which I can’t as now find)?
Thanks,
Ilan
|
|
|
|
|
Platform SDK call:
TCHAR szDirectory[MAX_PATH] = "";
::GetCurrentDirectory(sizeof(szDirectory) - 1, szDirectory);
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
I have a ClistCtrl with three columns how do i select wich colum i want to insert my string.
Each time i insert a String it is inserted in the same column (1):
int a;
a = m_F.m_SN.GetCount()-1;
while (a>0)
{
S = m_F.m_SN.GetAt(m_F.m_SN.FindIndex(a));
CLC.InsertItem(a,S.SNUPS,0);
CLC.InsertItem(a,S.SNRand,1);
CLC.InsertItem(a,S.SNDevice,2);
a--;
}
/\|-||\/|/\|)
|
|
|
|
|
You have to fill the LVITEM structure:
<br />
LVITEM lvi;<br />
CString csText = "Hi !!";<br />
<br />
lvi.iItem = 0;
lvi.iSubItem = 1;
lvi.mask = LVIF_TEXT;
lvi.pszText = csText.GetBuffer(0);<br />
CLC.InsertItem(&lvi);<br />
For a complete guide Using the List Control
[^]
I hope it helps,
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
|
Hi,
InsertItem, adds an item to the listcontrol, this is a full line in the list view and is in fact the text of the first column.
The text in the other columns (2 and further) is call subitems.
int nIndex = 1;
nIndex = c_listcontrol.InsertItem(nIndex, "placed in first column");
// use the new index because we dont know where the actual item is added in the listview,
// due to sorting and so.
// add to second column, 1: subindex is zero based
c_listcontrol.SetItemText(nIndex, 1, "placed in second column");
// add to third column, 2:
c_listcontrol.SetItemText(nIndex, 2, "placed in third column");
Regards
Kurt Pattyn
codito ergo sum
|
|
|
|
|
|
I have written the following piece of code into my project. But it is giving me assertion error. Can anyone tell me what is problem in it?
void CPungaDlg::OnBUTBrw()
{
CFileDialog find(true, NULL, NULL, OFN_EXPLORER, NULL, NULL);
find.DoModal();
CString filename = find.GetFolderPath();
m_name = filename; //prints address in edit box.
UpdateData(false);
}
We Believe in Excellence
|
|
|
|
|
|
Strange cause even GetFolderPath is only valid for an Explorer-style window you have provided this style ... and it crashes
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
The assertion is this, right?
CString CFileDialog::GetFolderPath() const
{
ASSERT(::IsWindow(m_hWnd));
[...]
}
It means that calling CFileDialog::GetFolderPath is only allowed while the file dialog is active, and not after DoModal has returned, as it is your case.
If you are only interested in the folder for the selected file, consider using SHBrowseForFolder instead of CFileDialog .
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
how to clear items of CList ?
i miss m_Clist.Clear();
regards,
Rookie
|
|
|
|
|
From MSDN: CList::RemoveAll[^]
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
it's for win CE it seems.. its not working..
n also why there's no method like m_clistbx.RemoveAll() available in the control variable m_clistbx??
regards,
Rookie
|
|
|
|
|
Ups !!! I think you'll have to remove them one by one looping through the CList, using GetCount and IsEmpty and RemoveTail, RemoveHead or RemoveAt.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|