PDA

View Full Version : smart_com



ims4f214
May 29, 2008, 10:02:12
:confused:Hi ,
I have problem with smart_com, I don't know how to use the class smart_com, several information is missing. " CreateFilter " returns a reference without it's not indicated in which kind of variable must be inserted the variable.
//Creates an instance of a specified frame filter.
//@return 0 when no according filter could be created, otherwise a reference
//to the newly created filter.

static smart_com<IFrameFilter> createFilter( const FilterInfo& fi );

I think that there are errors at the level of the syntax.
Thank you for your assistant.
regards

Stefan Geissler
May 29, 2008, 15:11:55
You should do following:


smart_com<IFrameFilter> pFilter = FilterLoader::createFilter( "Rotate Flip", "" );

You may look here for sample code:
http://www.imagingcontrol.com/support/documentation/class/stdfilterRotateFlip.htm

ims4f214
May 29, 2008, 15:53:59
Thank you very much of your help, I added to my main program the fragments of code which you make me pass on but modules " stdfiltersd.ftf " and " stdfilters.ftf " don't supply the information necessities which have to I make????
Thank you

Stefan Geissler
May 30, 2008, 08:51:00
Please do not pass the module name to the function. This wont work.

ims4f214
May 30, 2008, 10:06:55
I have used your demos applications to build a project for imaging from a TIS video camera.
So far I could add some kinds of overlays on the image.
Next step is making image filtering and I have tried two ways to make it:
Through a ddl based on the DemoFilters project delivered with IC Control 3.0.
this is a fragment of code which leads to errors when running:

AFX_MANAGE_STATE(AfxGetStaticModuleState());
TATA=LoadLibrary("DemoFilters.DLL");
TOTO=(valeur)GetProcAddress(TATA,"getFilterFactory");
std::vector<FilterInfo> fi = FilterLoader::getAvailableFrameFilters(eFC_ALL);
TF=fi.empty();

The last code shows that fi remains emty (TF== true) so we can't use this vector....
.......
Then I have tried to create a filter using your advice with the code:

smart_com<IFrameFilter> pFilter = FilterLoader::createFilter( "Rotate Flip", "" );

In that case pFilter remains null...:(

Therefore I ask myself wether the environnement of the application is Ok .
Thanks for your help:)

Stefan Geissler
May 30, 2008, 11:38:25
Hi,

the list is empty, because demofilters.dll is no a DLL of IC Imaging Control or you renamed it from demofilters.ftf, thus IC Imaging Control is not able to find and load it.
Please rename it back to demofilters.ftf, thus IC Imagingcontrol can load it and check, which filters are in there. This is done automatically by IC, thus you can not influence it anyway.

ims4f214
May 30, 2008, 14:19:07
According to the setting of VC6 demo samples wizard, executables are ouput in
C:\Program Files\The Imaging Source Europe GmbH\IC Imaging Control 3.0\classlib\debug

As I said in previous thread I built first an "creating an overlay" type of application. Then I added files from the "DemoFilters" directory to try image filtering. From the original installation of the IC Control kit (we still have a copy of this) DemoFilters.ftf was not in:
C:\Program Files\The Imaging Source Europe GmbH\IC Imaging Control 3.0\classlib\debug\DemoFilters

When I first read the documentention the only .ftf file to deal with was "stdfilters.ftf" or "stdfiltersd.ftf" and in your previous thread we had this link which talk about these. Therefore I tried to find them and finally I found a "stdfilters.ftf" in
C:\Program Files\The Imaging Source Europe GmbH\IC Capture 2.0
and again this is the original installation.

At this point we have a "DemoFilters.ftf" in
C:\Program Files\The Imaging Source Europe GmbH\IC Imaging Control 3.0\bin
We copied this file almost every where in our project directory but creating filter fonctions still answers a null when we call with or without using this name or with "" as parameter.

If I summarize the situation:
I have a project based on "Creating an overlay" wich works fine
I want to add image filtering to this application
The questions are:
1-Do I have to add another IC Imaging Control sample project and which one.
2-which .ftf file is usefull
3-how do I incorporate the (.exe ? or .ftf ? or .dll ?) file to my current project

I am very sorry if this thread is too long.
thanks for your patience:)

Stefan Geissler
May 30, 2008, 15:27:54
The demo filters are available in source code in the "VC*" directories in the subdirectories "demofilters. You can compile them as debug and release version. After doing so, they should reside in the "classlib/release" and "classlib/debug" directory. They will have the extension "ftf" instead of "DLL". But in fact, they are DLLs.

I tried the installation again and the stdfilters.ftf and stdfiltersd.ftf are in the "classlib/release" and "classlib/debug" directory.


1-Do I have to add another IC Imaging Control sample project and which one.
No, there is no other to be added. You may also look for a sample here:
http://www.imagingcontrol.com/library/cpp/section/image-aquisition/example/image-and-avi-capture/


2-which .ftf file is usefull
stdfilters.ftf


3-how do I incorporate the (.exe ? or .ftf ? or .dll ?) file to my current project
I do not understand this question.

You may use the depends.exe too and open the stdfilters.ftf. Then you can see,if there are missing dlls. May be this is the reason, why they wont load.

Which C++ version do you use?

ims4f214
June 9, 2008, 10:04:32
hello,
just to thank you for your help. overlay shapes and filters are correctly implemented now.