|
I also try to find this on the site, but I can't got it. Could you mind tell me where can i find it?
|
|
|
|
|
I dunno, I thought I'd seen it. Maybe it was in MSDN.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
hello Everybody,
I am working on a project involving PCs as peer sensors on a network. The sensor can use ccd cameras (microscops), can process acquired images, can replicate data on an overlay network (P2P), can distribute processing (actually start, control and stop them remotely).
I'd like to create a object-oriented, component-oriented "generic" framework in C++... for sensors in general and for my application in particular. Also, I'd like to have some functionalities (Input, Processing, Networking...), as independent components, i.e. that can be used without the others (separate DLLs?).
Sensor Component
|
|- Input Component
|
|- Processing Component
|
|- Networking Component
|
|- Coordinator Component
MySensor Component : inherited from Sensor Component
|
|- Vision Component : inherited from Input Component
|
|- MyProcessing : inherited from Processing Component
|
|- P2P : inherited from Networking Component
|
|- MyCoordinator : inherited from Coordinator Component
How do I make such a framework? What tools are the easiest?
Where should I start?
Should I buy a book "creating our own framework for dummies"?
Any comments are welcome!!
Thanks a lot!
Bertrand Boichon
Research Assistant
Electrical & Computer Engr.
Oregon State University
|
|
|
|
|
Anonymous wrote:
I'd like to create a object-oriented, component-oriented "generic" framework in C++...
Your description suggests a class library, not the framework. What exactly do you mean by 'generic'? 'Generic' as in 'generic programming'?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
I want to ask how to display four view at the same time(i.e. splitting), each views are come from different class?? (e.g view1, view2 view 3, view4)
|
|
|
|
|
You want to display in 2x2 or 4x1 or 1x4??
Weiye, Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
i WANT TO DISPLAY 2X2
THX!!!
|
|
|
|
|
Then you can try this
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT ,<br />
CCreateContext* pContext)<br />
{<br />
if (m_wndSplitter.CreateStatic(this, 2, 2) == FALSE)<br />
return FALSE;<br />
<br />
if (m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CView1), CSize(100, 100), pContext) == FALSE ||<br />
m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CView2), CSize(100, 100), pContext) == FALSE ||<br />
m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(CView3), CSize(100, 100), pContext) == FALSE ||<br />
m_wndSplitter.CreateView(1, 1, RUNTIME_CLASS(CView4), CSize(100, 100), pContext) == FALSE)<br />
return FALSE;<br />
<br />
return TRUE;<br />
}
Weiye, Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
Thx you very much!!!
But when I execute it
it tell me
CView1 is not a class or namespace name
classCView1: undeclared identifier
CView2 is not a class or namespace name
classCView2: undeclared identifier
CView3 is not a class or namespace name
classCView3: undeclared identifier
CView4 is not a class or namespace name
classCView4: undeclared identifier
How can I solve it?
Sorry for I have many question!!!
|
|
|
|
|
CView1, CView2, ... CView4 are your 4 different views that you need to create. You need to replace them with the actual names of those view classes you created.
Weiye, Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
OK
Thx you very much!!!
I know how to do it right now^V^
|
|
|
|
|
How to add a scroll bar in CView? (MDI APP)
|
|
|
|
|
Derive from CScrollView instead.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
But my existing program are come from CView, how to modify it?
thx!!!
|
|
|
|
|
You cunningly place your cursor between the C and the View and type S-c-r-o-l-l. Seriously, you just need to derive your existing view from CScrollView instead, which means a few changes in the .h and .cpp file, and it will work. Look up CScrollView in the MSDN, I forget how to set the scrollable area off the top of my head.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
I also use this tricky method before.
But when I execute it, even there is no error and warning are detected.
The program will terminated when I open a new file. I dont know why
THX!!!
|
|
|
|
|
I am attempting to load an XML file using the DOMDocument 'load' method of the MSXML parser but it does not seem to be validating the file against the schema. The document will load ok and is even checked for correct XML syntax but doesn't validate against the schema.
Here is an outline of the code:
#import "msxml3.dll"
IXMLDOMDocumentPtr spDoc;
hr = spDoc.CreateInstance(__uuidof(DOMDocument));
if (FAILED(hr))
{
return 0;
}
// These properties are supposed to be set by default
// but just in case I make sure they are.
hr = spDoc->put_resolveExternals(VARIANT_TRUE);
if (FAILED(hr))
{
return 0;
}
hr = spDoc->put_validateOnParse(VARIANT_TRUE);
if (FAILED(hr))
{
return 0;
}
// Load and parse the input XML file.
_variant_t vFile(lpszXMLFile);
VARIANT_BOOL bSuccess = false;
hr = spDoc->load(vFile, &bSuccess);
if (FAILED(hr) || !bSuccess)
{
return 0;
}
The reference to the schema in the input XML file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<FreshItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\Visual Studio Projects\Wcpw\Debug\FreshItem.xsd">
I suspect it is something to do with the reference to the schema since if I edit this to put in some bogus path it will still succeed to load, it looks like it is ignoring the schema reference altogether.
|
|
|
|
|
Hi,
I was in need to do a listview with 100x100x32 bitmaps/thumbs and I did so. But then a problem appeared, as the 9x windows don't seem to be able to handle the 330 neccessary items (13 megs in image list... ImageList_Add fails for one of the items, seemingly due to lack of resources). So I followed a fellows idea and did it over LVS_OWNERDATA. He told me making a 1-item image list and changing the image actually when the text is asked for. But here comes my problem:
1) I specify the ownerdata flag when creating
2) I specify the number of items in the listview control
3) The listview starts immediately asking me for texts... and I provide them... so far all right
4) It also asks for images. I provide them (the index = 0 and an appropriate image in the imagelist)
Problems
1) With that many items (330 and more), the application starts saying low on resources again. But mostly when I start moving thru the list itself. So it's a fault in my imagelist construction routines. Could someone send me his/her? Or is it because the incorrect appoarch?
2) I DO NOT add any items, I just specify the count and the control starts immediately asking me... Where's the fault?
It's kind of urgent and I would REALLY apperciate any ideas, hints, thoughts, suggestions, better appoarches. Thanks
|
|
|
|
|
If you're running out of resources you are creating DCs or HBITMAPs and not cleaning them up. Do you deselect everything you select into a DC before deleting it ?
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
HBITMAP hBitmap;
HGDIOBJ hOld;
HDC hDC,hTempDC;
RECT rect = {0, 0, 100, 100};
int width,height,x_offset,y_offset;
hDC = ::GetDC(Window->GetHWND());
hTempDC = CreateCompatibleDC(hDC);
hBitmap = CreateCompatibleBitmap(hDC, 100, 100);
hOld = SelectObject(hTempDC, hBitmap);
FillRect(hTempDC, &rect, (HBRUSH)GetStockObject(GRAY_BRUSH));
SelectObject(hTempDC, hOld);
m_Thumb->CreateFromHBITMAP(hBitmap); //this is a 3rd party lib and I assume it's correct
DeleteDC(hTempDC);
DeleteObject(hBitmap);
ReleaseDC(Window->GetHWND(), hDC);
}
the second one (there are two funcs working with this stuff is exactly the same, just that it returns the HBITMAP to another function which Adds it to image list and then DeleteObjects it
Thanks
|
|
|
|
|
All looks fine to me, except I'm not sure why hOld is not a HBITMAP ? That may be the problem, but I don't see why.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Can someone help my with the item addition issue then? Maybe I could find something there
|
|
|
|
|
You almost/kinda have it. I'm not sure what exactly m_Thumb->CreateFromHBITMAP( hBitmap ); does.
The theory is once you have a HBITMAP from your thumbnail you either use the CImageList Replace method if you're using MFC, or ImageList_Replace using straight win32. It looks like your 3rd party lib will give you a HBITMAP when you need it. Just use that to replace the 0th image in the imagelist.
If you need further help, let me know. What I do is slightly different. I store the raw image data using a FAST data (un)compression library and decompress it on-the-fly. Image lists tend to consume large amounts of memory when used exclusively. Once I figured out this method my app consumes about 1/10th the memory it used to.
Joel Lucsy (jjlucsy@ameritech.net)
|
|
|
|
|
Well, it seems like I'm unable to make the listview handle my handles properly or what... I still cannot figure it out. Could you contact me via e-mail? I need to discuss some related issues. My ICQ is 100419594 - thanks much for your help
|
|
|
|
|
I was told that I could debug with the OnSysCommmand handler. I cant find in the Clas wizard where it is to add it. Will it be a handler in the mainframe? Or the view? Anyways I dont see a SySCOMMAND message or anything likethatin theCW for mainframe class or view class...
Thanks,
ns
(I want to debug a crash that happens when I click the right cross system menu)
|
|
|
|