Congratulations! Cmake configuration may be nerve-wrecking (and often are imo ;) ). See you
Legor
Posts
-
If I use a library, do I need DLL file ? -
If I use a library, do I need DLL file ?Yes in VTK version 6 the naming convention for the libraries was changed. It is now part of the lib name, that is why you have a vtkRenderingCore-6.1.lib instead of vtkRendering.lib. It seems those changes did not make it in the cmake files of the example you're trying to use. Anyway when using cmake you shouldnt care about the concrete names of the libs since this is handled by the cmake configuration. I can show you how I succesfully link VTK 6.1 to one of my projects:
# Try to automatically detect VTK.
find_package(VTK REQUIRED COMPONENTS vtkIOGeometry vtkIOLegacy vtkFiltersCore)
if(VTK_FOUND)
message(STATUS "Found package VTK. Using " ${VTK_USE_FILE})
include(${VTK_USE_FILE})
else(VTK_FOUND)
message(FATAL_ERROR "VTK not found. Please set VTK_DIR.")
endif(VTK_FOUND)target_link_libraries(myTarget ${VTK_LIBRARIES})
In your place I would start trying to build a basic VTK project (Hello World etc.) at first to see if this works. If you got this you can start to add simple MFC functionality. I did not use MFC with VTK myself so sadly I cannot share any experience about this combination.
-
If I use a library, do I need DLL file ?Do you have problems compiling or linking? Because before you were talking about libraries and they only come into play afer you successfully compiled your pogram and now your telling that you have problems compiling.
-
If I use a library, do I need DLL file ?Superman allready explained in his answer that in general there are two types of libaries (static and dynamic or also called shared libraries). Now when using VTK you can choose if you would like to use the static libraries or the dynamic ones. Assuming you did build VTK yourself in the CMake configuration you'll have to set the option BUILD_SHARED_LIBS=OFF. This way VTK will be build as static libraries.
-
Double bufferingYou have to be more specific. What does a dialog have to do with how you save an image? And what do you mean by saving the image directly in memory?
-
Turning of QA Email Notifications doesn't workHow can i turn of the notifications of comments or replies to my Answers/Comments in the QA section. In my settings i deactivated the option "Send me an e-mail if someone replies to the message" under the Forums section. Still i get Emails for every reply (in the QA section).
-
Article Comment - Email NotificationI have the reverse problem. I dont want to receive Email notifications and unchecked this option. But i still get lots of Emails about replies or comments in the QA section?
-
Extract Circle Features From ImageYou should also think of using the GPU for such tasks which can improve the performance a lot.
-
Rookie Alert! Need Help Learning CFor books i can advice: - "The C Programming Language" by Kernighan and Ritchie, which are the brains behind Ansi C. - "Head First C" - The Head First books are one of my alltime favorites for learning the many facettes of programming / developing There are also plenty of online resources e.g. - Solutions to the Exercises of above mentioned book: http://users.powernet.co.uk/eton/kandr2/[^] - Essential C : http://cslibrary.stanford.edu/101/EssentialC.pdf[^] - C Programming : http://www2.its.strath.ac.uk/courses/c/[^]
-
Pointer MathsWell i was a bit fast with saying that it will not be 12 bytes. Of course it depends on the compiler. I just wanted to state that its not allways 12 bytes.
-
Pointer MathsWhat if p points to element 0 of the array? How would you check for this?
-
Pointer MathsWhen using sizeof with a structure it is not guaranteed that you get the sum of the single components due to Structure padding (wiki for it). Just printf the sizeof() of your struct and you will see that its not 12 Bytes. Anyway it is very unclear to me why are you even trying to do it this way. Dont mess with addresses and pointers in such an unsafe way. Who even tells you that you could just decrease the given int pointer and it would still point to a valid adress. E.g. just use the indices of the array to get the last element.
-
Running a c++ programThe builded exe is in your Release and / or Debug folder. Look for it. I didn't say the exe will be called TimeStamp.exe at you local PC! It was just an example. The name of the exe depends on your Project Settings (the project name by default). But then if you want to use only the logic shown in the code that you've linked in a program of yours, of course you don't need to build this exe at all but rather use the code that fullfills the desired task. And then again you dont have to provide the filename as command line parameter. This is totally up to you. For the beginning .. it would for your case probably enough if you change the following line.
hFile = CreateFile(argv[1], GENERIC_READ, FILE_SHARE_READ, NULL,OPEN_EXISTING, 0, NULL);
The argv[1] here contains the file name. You could also hard code this filename like
hFile = CreateFile("C:\tmp.txt", GENERIC_READ, FILE_SHARE_READ, NULL,OPEN_EXISTING, 0, NULL);
You'd also have to remove this if you dont want the code to be dependent of the number of command line parameters..
if( argc != 2 )
{
printf("This sample takes a file name as a parameter\n");
return 0;
}Or get the filename somewhere else. i dont know what you want to do but you'll have to think of stuff like that for yourself. I strongly advise you to go through some basic C/C++ tutorials, since you seem to lack some basic understandings of the language here.
-
Running a c++ programYou'll have to provide the name of the file as command line parameter. For example lets consider the compiled executable is called TimeStamp.exe. Execute the program from the command line (console): TimeStamp.exe c:\textfile.txt As the name implies it, a command line parameter is passed from the command line. In the code you've linked you can see how the parameter is accessed using the argv array.
modified on Monday, May 23, 2011 7:52 AM
-
Open other Application From DialogueWhat exactly don't you know? As you said it you'd have to add the code for creating a process in the button click event handler.
-
GridView PagingI can't reproduce this behaviour. When paging through the Grid the screen doesn't go blank. Im using VS 2010. Maybe it has something to do with the data source you've bound to the control?
-
About Three -Tier and N-tier Architecture?As their name implies it. A data access layer has the responsibility to access data sources (e.g. a data base). Possible implementations of that layer may contain SQL statements. The business logic layer contains all the logic of the domain you're in. It gets the data needed for its business processes by using the functionalities of the data access layer. It doesn't care about how the data is grabbed from a source. The data access layer in contrast is not able to acccess the businnes layer (which lays "above" it).
-
MVC Implementation QuestionI just can tell you about how i have done it (so far at least). Usually i just divide one solution by subfolders for the different layers of the architecture e.g. View, Model, Controller. If for example you look at the ASP.NET MVC approach you'll find this in a similar way. Just by the path of the class file you could tell lets say a View from a Controller. Another benefit is, if you're are consistent in Naming your files you can simply by this convention tell which Control belongs to which View. In my opinion Reuse doesn't come from your project management but the class design itself. Anyway i think it's easier to keep your different layers in one solution. good question btw ;)