oh, I didn't know it , so it's imposible send and recive messages between a model and modeless? ok supose that i change the main dialog to modeless , how can i do te send or post a message between the two modeless? with PostMessage?
Thanks. But , wich is the correct syntax? i wrote the following code in CDlgMapa1
<code>CCalibracionDlg.PostMessage( ? , WM_MYCUSTOMMESSAGE,(WPARAM) wParam,(LPARAM) lParam);</code>
1-What have i put in'?' ? , the handler to CCalibracionDlg (is the object that recives the message) ? in this case , how can obtain it? if you could put some code like an example , would be nice.
2- at that line of code the compiler says : error C2143: syntax error : missing ';' before '.' , sounds like the compiler doesn't recognizes that line. thanks again.
I am trying to get started with some programming, but I'm getting nowhere with an actual interesting sort of a project.
I can do console examples fine, and follow the instructions on the MSDN, but what I want to do is work on editing and creating modules for a program called SynthEdit.
SynthEdit creates Music software synthesizers, and the software has an SDK released.
So if I can figure out how to load a project/solution file from the SynthEdit SDK and actually successfully compile it, I will be able to actually start working on something.
But I am getting nowhere, because I always get errors when trying to compile.
It should be as simple as installing Visual C++ and the Microsoft SDK, then just loading a file from the SynthEdit SDK and compiling it. But something is not working right.
Visual C++ 2008 installs with Windows SDK version 6.0A already installed and ready to go, right? But it doesn't work. I added the file paths to the VC++ directories for Executable files, Library and Include files, it still doesn't work.
I downloaded Windows SDK v 7.0 and added the paths to the VC++ directories, it still does not work.
So What do I need to do to get a Windows SDK integrated into my Visual C++ 2008, so that I can compile something?
I have seen the Microsoft Blog about using the Microsoft Windows SDK configuration tool, it is no help. It fails to be a straightforward step by step guide, and goes into setting directories using the command prompt window without explaining how exactly to do that. So it is useless for a beginner such as myself.
I am pasting the log for my attempt to compile a project called "AGain" below. If anyone sees exactly what the problem is, that would be great. Please don't spend more than a minute or two, I'll have to eventually figure this out, even if it takes weeks.
cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release
Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385
Copyright (C) Microsoft Corporation. All rights reserved.
.\AGain.rc(10) : fatal error RC1015: cannot open include file 'winres.h'.
Build log was saved at "file://c:\Program Files\se_sdk3\AGain\Debug\BuildLog.htm"
AGain - 1 error(s), 1 warning(s)
Your source code seems to be compiling correctly according to your logs. Its the resource compiler that is failing. Your AGain.rc resource file is including a file named winres.h but the compiler cannot find it. You may be missing an #include path... locate this file and add the path into the projects 'Additional Include Directories'
I come to know IE use "Acrobat Browser document" ocx control to open pdf file.
I am using same ocx control but it doesn't expose any function to get open PDF page count.
BUT IE do the same.
I also come to know you can get page count by opening PDF in binary format and search for /Count or /Type /Page pattern.
I opened PDF in binary form using CFile and try to read single line and count " /Type /Page " pattern but as it is binary file, I could not able to read single line.
Line end is specified by '\n' or '\r' or '\r\n' i.e. 0x0A or 0x0D 0r 0x0D 0x0A.
To check the regular expression I used CAtlRegExp class.
If i check all these patterns and read single byte at a time, it takes lot of time. So can you please provide me some c++/VC++ code sample if possible to read the single line in PDF or get the page count.
I think Adobe Reader(AR) supports OLE Automation, so that another applications can embed AR with in them and automate it programatically. If IE automates AR to open pdf files, there will be two process running in task manager: iexplorer.exe (IE) & AcroRd32.exe (AR). This is not happening when I opened a pdf document in IE. That means IE uses an ActiveX control (Program Files\Common Files\Adobe\Acrobat\ActiveX\AcroPDF.dll) provided by Adobe. You can use this control in your MFC App by inserting "Adobe Reader" activeX control on dialog. You can generate wrapper class for this OCX, but i couldn't find any method to get no. of pages there.
Another way is to automate AR from you application. The Type Library for AR is Program Files\Adobe\Reader 9.0\Reader\AcroRd32.dll. Use OLEView.exe tool of Visual Studio to see the interfaces that AcroRd32.dll provides. There is CAcroPDDoc interface and it has a methods 'Open' to open a pdf document and 'GetNumPages(long*)' to get no. of pages Create wrapper classes for all necessary interfaces using "Add Class from Type Library" in visual studio, instantiate those classes in specified order, invoke methods on them, finally close the document and release the interfaces. Iam sure that this will work for you...
Every problem has n+1 solutions. 'n' is the number of solutions I have tried and '1' is that which is waiting to be tried.
U r right. There may be changes in type libraries of different versions of acrobat reader. But if u build ur app with a lower version such as 7, that will run even if the installed version is higher one. The reverse my not be possible.
I am almost finished coding a command console for a home project and have just noticed that the static map I used is causing visual studio to whine about leaking memory on program termination. I have included the code for detecting memory leaks
The program bombs during the assert. If I remove my static map it terminates without blowing up but keep it it and BAM. I should point out that almost all code has been commented out and almost all source files removed. The static map is not used at all. It is the declaration of the static map in the .cpp file that causes the so called memory leak.
I think it is because the maps constructor is called during start up as it is a static variable and its destructor is therefore called on program termination. However this is after the last line of code so the assert will always trigger .
Is there any way to get visual studio to ignore the static map because I do not think it is an actual memory leak or do I have to have a static pointer to a map instead of a static map and new and delete the stupid thing myself before the assert?
You shouldn't worry about it.
The map internally allocates memory in its constructor and deallocates in its destructor.
But when you're calling _CrtDumpMemoryLeaks() you destructor has not yet been called.
So you should not have the assert statement at all.
«_Superman_» I love work. It gives me something to do between weekends.
The assert statement is there to catch other memory leaks. It has already caught leaks when I forgot to call the destroy function for a class and when I used the normal delete operator instead of the array  delete.
So taking out the assert while developing could mean I leak memory in future due to some other silly thing I do, and seen as no one is perfect I am bound to forget to delete somehthing else sometime and the assert is there to flag any errors I might make.
Therefore I would rather not take it out even though there is currently no memory leak. I was just wondering is there a flag you can set or something you can do to tell visual studio to ignore the static objects during leak testing which would stop the assert triggering every time I close the application.
You could get the size of the map using std::map::size(), sizeof(std::map::key_type) and sizeof(std::map::value_type) and then assert on memory leaks more than that size.
You could also call std::map::clean() before doing this.
«_Superman_» I love work. It gives me something to do between weekends.
Checking the size of the leak is a good idea but I have no clue how to get the amount of memory leaked in code. _CrtDumpMemoryLeaks() just throws a wobbler when memory is leaked, it doesn't give any information on how much memory has been leaked, at least not until it shows up in the output window (60 bytes every time).
I assume you mean std::map::clear() (not clean). I already tried it to no avail.
After a lot of reading I think I am just going to go with a static map pointer instead of a static map. That way I can nuke the new'd map memory myself and make sure it is dead and gone before the program ends and memory leaks are checked for.