|
Hi,
I'm making a personal library for handling images, videos and some other stuff. I use the code of libpng, and libtheora for example.
In theora there is a function named "cpu_init" and I haven't conflicts for now but you see it has a "common" name that can be used in other libraries or by me if I have no deep knowledge of internal functions.
I wish to add the "theora_" prefix to all functions in libtheora to prevent potential conflicts. If there is no way I should change the names manually.
Best regards, Mauro.
|
|
|
|
|
Mauro Leggieri wrote: I wish to add the "theora_" prefix to all functions in libtheora
what about prefixing - like Roger suggested - to prefix with theora:: instead ?
|
|
|
|
|
Not really sure what you're after, but there's a chance that a namespace would satisfy your needs. Have a look here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi,
Yes it would but namespaces works in C++ and many libraries are in plain C.
Best regards, Mauro.
|
|
|
|
|
if you code in C++, there's no problem... you can import C functions inside it then
what do you think the standard C++ library does with the C runtime functions into the std:: namespace ?
-- modified at 14:30 Tuesday 20th March, 2007
|
|
|
|
|
Each C source files in theora generates a .obj file with the possible conflicting public symbols. Encapsulating inside a C++ object doesn't hide public symbols from original theora compiled object files.
Code is opensource so I can make things like changing function names but I wish to avoid that in order to make updates easily when there are new versions available.
Greetings,
Mauro
|
|
|
|
|
you don't get it.
process in 2 steps.
firstly, generate a library which will present the theora in your namespace.
then, use this "new" library, which won't generate name duplicates anymore, due to the namespace...
|
|
|
|
|
Thanks Toxcct 4 answering.
Can you explain me more detailed?
Imagine I have a C function named myfunc in test1.c
Then test1.lib will contain the module test1.obj that contains the _myfunc public symbol.
On the other side, another function with the same name but in test2.lib
When I link the app with test1.lib and test2.lib the linker gives an error in test2.lib(test2.obj) because _myfunc is already defined in test1.lib(test1.obj)
I didn't find to hide test1.obj from the visibility of test2.obj, no matters if it is inside a .lib
Best regards,
Mauro.
|
|
|
|
|
Hi everybody,
I try to create a modeless dialog in the client area of a MDI application. It should display some data form the app class (not the document). When I create the dialog:
pmyDlg = new CmyDialog;
pmyDlg->Create(IDD_DIALOG_mydlg)
pmyDlg->ShowWindow(SW_SHOW)
it always appear on top of the application, not in the client area of the child frame. I tried things like pmyDlg->Create(IDD_DIALOG_mydlg, theApp.m_pMainWnd) to set a parent for this dialog but it was alway dragable over the whole desktop and was not restricted to the client area.
Can someone send me a hint?
Many thanks.
Cheers,
Frank.
|
|
|
|
|
did you have a look at this[^] ?
|
|
|
|
|
yes, but it doesn't help me because Nishant Sivakumar suggest to use the desktop window as a parent for the modeless dialog. When I do this, the modeless dialog is even more independent of my application.
What I want is a modeless dialog, which behaves like a MDIView but without the overhead of the document. It should be moveable only inside the client area of the application and not on the whole desktop.
|
|
|
|
|
Subclass your childview[of MDI] and create a child[WS_CHILD] dialog on it.
--
======
Arman
|
|
|
|
|
Franken wrote: What I want is a modeless dialog, which behaves like a MDIView but without the overhead of the document.
yuck.
Franken wrote: It should be moveable only inside the client area of the application and not on the whole desktop.
double yuck.
but I'm a good sport.
Can't you create the modeless dialog with the MainFrame as a WS_CHILD of the main frame ? or something similar ?
I think I remember that you can set of the dialog style to do this.
|
|
|
|
|
Maximilien wrote: ...the MainFrame as a WS_CHILD of the main frame ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
ok, that was bad!
|
|
|
|
|
I also thought that it should be possible to set WS_CHILD style but haven't found a way to do this.
|
|
|
|
|
Do you want the MDIFrame window to be the parent or do you want to place the dialog in a
MDIChild frame?
Either way, the dialog needs to be a child and you need to specify the parent in the Create()
call.
You can set the child style in the resource editor, properties, style.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
I set the style to child in the dialog editor properties and did the following during the creation of the dialog:
CMainFrame* pFrame = (CMainFrame*)GetMainWnd();
CChildFrame* pChild = (CChildFrame*)pFrame->GetActiveFrame();
CmyDlg* pDlg = new CmyDlg;
pDlg->Create(IDD_DIALOG_myDlg, pChild->GetParent());
pDlg->ShowWindow(SW_SHOW);
This is almost what I wanted but it shows some weird behaviour. When a region of the dialog is covered by another child window this region shows still the part of the child window even if I drag the dialog to another place. It only restores the correct dialog, when I resize the dialog. Is there somewhere a flag like redraw or something?
Many thanks ,
Frank.
|
|
|
|
|
hmm I'm not sure if there's different invalidation with MDI windows (which differ from other
windows because they're controlled by an "MDICLIENT" class window).
I have a feeling it's due to activation issues. Mixing a non-MDI child window in a MDI client
window isn't necessarily going to work properly.
I still think it's much easier to make the dialog a client window of a CMDIChildWnd frame. There
shouldn't be any issues then.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Here's some more info: Using the Multiple Document Interface[^]
As you can see in the Window Procedure sections, the MDI windows use different default window
procs so they can/will behave differently than normal parent/child windows.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
You could do something like:
BOOL CModelessDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CRect rc;
GetWindowRect(rc);
m_lWidth = rc.Width();
m_lHeight = rc.Height();
AfxGetMainWnd()->GetWindowRect(m_rcParent);
return TRUE;
}
void CModelessDlg::OnMoving(UINT fwSide, LPRECT pRect)
{
CDialog::OnMoving(fwSide, pRect);
pRect->left = min(pRect->left, m_rcParent.right - m_lWidth);
pRect->left = max(pRect->left, m_rcParent.left);
pRect->top = min(pRect->top, m_rcParent.bottom - m_lHeight);
pRect->top = max(pRect->top, m_rcParent.top);
pRect->right = min(pRect->right, m_rcParent.right);
pRect->right = max(pRect->right, m_rcParent.left + m_lWidth);
pRect->bottom = min(pRect->bottom, m_rcParent.bottom);
pRect->bottom = max(pRect->bottom, m_rcParent.top + m_lHeight);
} It works regardless of whether WS_POPUP or WS_CHILD is used. A parent can be specified or not.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
after playing with some LockWindowUpdate / UnlockWindowUpdate and SetRedraw(FALSE) / SetRedraw()
i have a problem with a view, a grid on this view disappears after drawing.
I removed all LockWindowUpdates,Unlock,SetRedraws and the problem is still there.
I added a this->RedrawWindow(); at the end of the initialisation but this line
erases the hole view,the grid and all other components ( it will be redrawn if the MainForm will be minimized/restored)
It seems as the Invalidations are working inverted
big thanks in advance
-- modified at 7:55 Tuesday 20th March, 2007
I removed the line where i add the row to the grid and all is ok.
I re-insert the line and the Grid becomes invisible(not drawn)
But i have nothing changed at the grid, at the moment i have so strange problems
The same with a class which i allocate in a thread and delete at the end of the function.
If i set 0 to a variable, the debugheap is corrupted at the destruction of the element.
if i dont set a value to the variable, i don't get an error...
|
|
|
|
|
I resolved the problem partially.
I put a Grid->RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE | RDW_FRAME);
into the EraseBackground Handler.
But it's not the reason of the problem.
If i put the view directly into a frame( not into a TabWnd of another view ) it works also without errors.
|
|
|
|
|
Hello,
Is it safe to use:
CDC memDC;
memDC.CreateCompatibleDC(pDC);
CBitmap *m_pOld = memDC.SelectObject(&some_bitmap1);
memDC.SelectObject(&some_bitmap2);
memDC.SelectObject(&some_bitmap3);
memDC.SelectObject(&some_bitmap4);
....
memDC.SelectObject(m_pOld);
memDC.DeleteDC;
or I should use SelectObject(m_pOld)/DeleteDC() after each SelectObject(&some_bitmapX)??
|
|
|
|
|
PatrykDabrowski wrote: Is it safe to use:[...]
Yes.
PatrykDabrowski wrote: or I should use SelectObject(m_pOld)/DeleteDC() after each SelectObject(&some_bitmapX)??
No.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|