|
|
Form your method how i can call this frame.
|
|
|
|
|
Hi,
I'm trying to create a memory manager. And I'm doing that in such a way that using the new or malloc functions is out of the question.
The memory manager is allocating memory in the pagefile. First the manager allocates chunks of memory and then split that up into objects.
The problem I have is that I need to initialize the allocations with the custructor for the object requesting the memory.
Now how do I "call" or invoke the constructor for the object, without using new or malloc(or etc...)?
Any help or opinion would be appreciated...
Thanks,
|
|
|
|
|
A form of new called placement new [^] is exactly meant for what you need.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
Thanks! That really works! Amazing!
|
|
|
|
|
Estoy intentando usar el GUI de microsoft para seleccionar directorios, de momento he usado el CFileDlg pero no me deja seleccionar un directorio , he probado varias opciones pero no me ayudan ¿alguna sugerencia?
Gracias
I want to use the GUI of microsoft to select directories, i try it with the CFileDlg class but it don´t let mi select one directorie ¿Can somebody help me?
Thanks
|
|
|
|
|
This link will help you out
http://www.codeproject.com/shell/cxsbrowsefolder.asp
"I Think this Will Help"
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
|
I want to set specific font for my tree, so I use CUSTOMDRAW event. I've write two functions that must set my own font, but they do not work
Please, help me. What is incorrect in my functions?
<br />
<br />
void CMyTree::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult)<br />
{<br />
LPNMTVCUSTOMDRAW pNMTVCD = (LPNMTVCUSTOMDRAW) pNMHDR;<br />
HWND hWndTreeView = pNMHDR->hwndFrom;<br />
if (pNMHDR->code == NM_CUSTOMDRAW)<br />
*pResult = handleCustomDraw(hWndTreeView, pNMTVCD);<br />
<br />
*pResult = handleCustomDraw(hWndTreeView, pNMTVCD);<br />
}<br />
<br />
<br />
long CMyTree::handleCustomDraw(HWND hWndTreeView, LPNMTVCUSTOMDRAW pNMTVCD)<br />
{<br />
if (pNMTVCD==NULL)<br />
{<br />
return -1;<br />
}<br />
switch (pNMTVCD->nmcd.dwDrawStage)<br />
{ <br />
case CDDS_PREPAINT:<br />
{<br />
return (CDRF_NOTIFYPOSTPAINT | CDRF_NOTIFYITEMDRAW);<br />
}<br />
case CDDS_ITEMPREPAINT:<br />
{<br />
LOGFONT lf;<br />
lf.lfHeight = 20;<br />
lstrcpy(lf.lfFaceName, "Time New Roman");<br />
lf.lfWeight = FW_HEAVY;<br />
lf.lfItalic = TRUE;<br />
HFONT gh = CreateFontIndirect(&lf);;<br />
SelectObject(pNMTVCD->nmcd.hdc, &gh);<br />
return (CDRF_NOTIFYPOSTPAINT | CDRF_NEWFONT);<br />
}<br />
case CDDS_ITEMPOSTPAINT:<br />
{<br />
LOGFONT lf;<br />
lf.lfHeight = 20;<br />
lf.lfItalic = TRUE;<br />
lstrcpy(lf.lfFaceName, "Time New Roman");<br />
lf.lfWeight = FW_HEAVY;<br />
HFONT gh = CreateFontIndirect(&lf);;<br />
SelectObject(pNMTVCD->nmcd.hdc, &gh);<br />
return CDRF_DODEFAULT;<br />
} }<br />
<br />
}<br />
return 0;<br />
}<br />
<br />
Thank to everybody very much in advance..
|
|
|
|
|
What do you mean they "do not work"? Why are you creating a new font every single time? Have you checked your return values? (specifically that of CreateFontIndirect() )
--Mike--
LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
You are right. I simply tried to create font every time. I'll do it another way, now I only want it to work.
|
|
|
|
|
Does anyone have any suggestions on a C++ code profiler that works well with VS 7.1
I used to use TrueTime quite a while ago. Any suggestions would be most appreciated.
Thanks
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
|
Thanks, I have downloaded a trial version and will evaluate it. My initial thoughts are that it is pretty good.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Hi,
aHandle = MyTree.InsertItem(....);
=> to create a new element into my treeview. My question is : how to delete this handle created by Microsoft function? When i try delete it by "delete aHandle" => it returns a warning message "warning C4150: deletion of pointer to incomplete type '_TREEITEM'; no destructor called".
Thank you.
|
|
|
|
|
it's only a handle to the inserted item, no need to do anything with it; BUT you will need to delete the tree item later on ( I'm too lazy to look and see if the tree items are automatically freed/deleted when deleting the tree ).
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Are you sure the handle was created using the operator new
suhredayan There is no spoon.
|
|
|
|
|
The handle is returned by Microsoft function InsertItem(...). This function create a new item and return it handle. I had try to delete this handle by "delete", "free" and "CloseHandle" but it does not work at all.
|
|
|
|
|
hi guys,
hope that you can help me with this one... i have created an ATL Project (server) as a .DLL type of file. I added some Composite Controls inside. the project is already functional but my main problem is that, when i tried to view the page through the client side, the composite control doesn't load with the page... what can i do??? can you pls provide sample codes, tnx in advance...
|
|
|
|
|
by the way, im using VC++ 6.0...
|
|
|
|
|
i have written an active x control. it is a windowless control, the problem is, if i try to use the control in a VB program the m_hWnd variable in the control is a NULL value, if i use the control in a VC++ program the varible is ok. the problem is i need to use some other controls such as a Timer, but when run from VB the control crashes when the SetTimer function is called... i have read that i need to create a control container but cant find anywhere that really explains it ??
any help would be greatly appreciated
Thanks.
|
|
|
|
|
I use custombar for CTreeView, but I need to return values like in following code
<br />
void CMyTree::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult)<br />
{<br />
LPNMCUSTOMDRAW pNMCD = reinterpret_cast<LPNMCUSTOMDRAW>(pNMHDR);<br />
LPNMTVCUSTOMDRAW lptvcd = (LPNMTVCUSTOMDRAW)pNMCD;<br />
if(lptvcd==NULL)<br />
{<br />
return -1;<br />
}<br />
<br />
switch(lptvcd->nmcd.dwDrawStage) {<br />
case CDDS_PREPAINT:<br />
return CDRF_NOTIFYITEMDRAW;<br />
case CDDS_ITEMPREPAINT:<br />
CString* cv = new CString("orange");<br />
lptvcd->clrText = (DWORD)cv;<br />
return CDRF_NOTIFYSUBITEMREDRAW;<br />
}<br />
<br />
How to use this function correctly?
Thanks in advance,
alex
|
|
|
|
|
bilas wrote:
CString* cv = new CString("orange");
lptvcd->clrText = (DWORD)cv;
That code is using the wrong data types. You need to assign a COLORREF , not a string. Look up COLORREF and the RGB macro in MSDN.
--Mike--
LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
How to access shared folder in a LAN
|
|
|
|
|
The folder will be accessable through its UNC name (Universal Naming Convention).
If you have a computer called MyComputer and a shared windows directory called MyWindowsShare:
\\MyComputer\MyWindowsShare
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|