Strange behavior of CHM project - css

Anybody can help me with a strange problem I am having with my CHM based project?
I took an existing CHM file and deconstructed the file using WinCHM. After that I added some new pages and compiled the project. The CHM file was created and everything looked great so far.
After that I put the entire folder (where the original CHM file was deconstructed) into SVN. When I opened the folder the next time I see that all the original formatting from the html pages is lost.
I cant seem to find a reason why. The css files are okay and i have not changed that at all. I know that finding a solution to this (or determining the problem) may not be easy for you guys with so little information.
But can you guys at least tell me what the problem might be?? We are talking possibilities that is all.

Somehow you are in different directories when running, so CHM compiler doesn't get a proper understanding of the CHM root ? E.g. you now run a batchfile via a shortcut instead of changing to the proper dir ? (either by cmd.exe or direct link?)y
If that is not it, try looking at it with some other CHM viewer (easier on non Windows, but e.g. kchmviewer builds for windows exist too). Sometimes they give more error information (but sometimes only in the console window)
Then update your question with what exactly went wrong.

The answer is so simple that I am surprised that it did not occur to me. The directories stylesheets, scripts and images are not in the same folder as the html files. These should be in the same folder.

Related

Qt creator deleted files and is unrecoverable

I had a code which Qt deleted it by itself, now I cant recover it even with data recovery programs.
I dont know if qt caches codes anywhere or saves history of them, also i ran it couple of times so there are some code.o and moc_code.cpp but they dont seem any useful.
If you have any idea on how to recover it, please help.
I think, there are a few things that you need to learn.
In general each development environment like Creator or Visual Studio will compile your code in one or more steps into something like an executable.
For Qt, the way roughly looks like this:
.cpp/.hpp -> .moc -> .o -> executable
Files with suffix .moc or .o are generated by moc/gcc/msvc-compiler and whatever you edit inside them, is lost.
So I guess, you edited the moc file and these changes are definitely lost (unless you have a backup tool like TimeMachine which was fast enough to catch your edits before you compiled them away).
I recommend reading a step-by-step example and walk through that w/o deviating from the path that is given there. This should give you a better start.
Qt will generate some code when compiling.
the .ui files will be used to generate xxx_ui.h files.
the .cpp/.h files may be used to generate xxx_moc.cpp files.
The auto generated files are not allowed to be modified.

Opening a chm file containing merged files in a Qt application

In my Qt application we can open a help file (chm) by doing the following:
QDesktopServices::openUrl(QUrl::fromLocalFile(_PathToTheCHMFile));
This seems to be the suggested way of doing things. And it has worked up until now.
However, the documentation team has now changed how the chm files work. Now we are referencing a "master" file which only contains references to other chm files. The directory structure of the chm files is as follows:
master.chm
SUBDIR/
-> child1.chm
-> child2.chm
...
If open the master.chm file with hh.exe (the default tool in windows), everything looks perfect. However, from my Qt application, the help file opens, but there are no sub topics, just the root node.
I assume this is a search path issue, and it can't resolve the relative paths. There doesn't seem to be any way to configure the openURL call to run from a certain directory, or anything like that.
Thanks in advance
If you need to be able to access those elements properly, then you may need to change your applications current directory on the fly.
http://qt-project.org/doc/qt-4.8/qdir.html#details
http://qt-project.org/doc/qt-4.8/qdir.html#setCurrent
If that doesn't work, you may want to look into using QProcess::startDetached
http://qt-project.org/doc/qt-4.8/qprocess.html#startDetached
and specifying the working directory to be exactly where your master.chm is located.
You may want to specify some command-line arguments, too.
http://www.help-info.de/en/Help_Info_HTMLHelp/hh_command.htm
Hope that helps.

Possible to turn off App_Code auto-compile?

Working with Visual Studio (I'm using 2008) I have started to notice that when you save a file in the /App_Code folder, the program will hang for a bit before returning control. After a bit of research, I have learned that there's an auto-compile feature at work, which I assume is what is slowing down my system.
So the question is this: Is it possible to turn off the automatic compiling of files in the /App_Code folder? Or, even better, is there a way to reduce the time that it takes, or make it work a little more smoothly in the background? Any thoughts/ideas are appreciated!
Sorry i don't know of any way of switching off compiling the app_code folder. If its an issue I would try to keep the amount of files in this directory down to a min or even move them out to a seperate library.
ScottGu has some good tips that you might find useful.
https://weblogs.asp.net/scottgu/Tip_2F00_Trick_3A00_-Optimizing-ASPNET-20-Web-Project-Build-Performance-with-VS-2005
No you can't turn off app_code folder.

Creating project from existing IIS/ASP.NET website, building stuff

So I'm left maintaining a proprietary codebase from a third-party vendor. The vendor is still sort of around, but support is limp. The site is ASP.NET.
I have made some changes but I am having a really hard time getting IIS to compile these changes in. The bin/ directory has what I believe is a precompiled dll for the core classes. I've changed these but it doesn't recompile. I have tried deleting the dll but then the app refuses to build saying that the Global.asax can't inherit the type anymore, so I don't really know how to rebuild with changes.
I spent all day Saturday setting up a build environment and trying to get a testing thing working. I have just been importing into VS2008 as a web site from the local IIS server. I got it to rebuild the app without changes, but it ignores changes I would place in it.
So I need to make a solution out of this website and/or directory structure so that I can do actual, big, full grown-up rebuilds and make changes to this codebase. Anyone know how I can go about this?
EDIT: A bit more elaboration. I've tried creating a blank project and just Add Existing File... on the whole website directory. This hasn't worked, it stops the import about 10% in.
Keep in mind there are two (actually, three) levels of 'builds' or compiles going on here.
1) The DLLs in the /bin directory should be pre-built, by visual studio or otherwise. The content of .ASPX, ASCX, ASHX, ASAX etc fiels are not included in those.
2) The ASPX, etc files I noted above are then compiled by IIS when the first request comes in (normally; there are ways to change that behavior). That is the source of the error with Global.asax you are seeing; With the DLL(s) gone, the class that Global.asax is supposed to inherit from does not exist.
3) Then there is the just-in-time compilation, which is not relevant for this discussion.
It sounds like you may be missing the source files for the project, or perhaps the web site is not getting properly set up as a project to compile that DLL
Try these links, I suppose this is what you are looking for.
http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/01/20/linking-files-in-visual-studio.aspx
http://support.microsoft.com/kb/306234
Not sure this question is really valid anymore. The source we were working with was rather different than it should have been. Not sure if someone got angry in the past and moved stuff around or what, but grabbing a new copy of the source fixed most of our issues. I am able to build now with an included csproj.
This doesn't really help many others with the same issue I suppose, but if you are getting weird build behavior like this, you might want to start with basics, like making sure that your source checkout is valid.
I am new in asp.net so I am not sure it is a professional way or not.
I have the project without .snl file. I just create a empty web site and then paste the files inside the folder where I created the project.
It worked for me.
I think pasting the files and folder directly by file manager will help you.

TortoiseSVN with ASP.net Web Projects - How to manage this?

We're a small team starting to use TortiseSVN to manage our web projects.
I was just wondering what is the best way to manage web projects into Subversion.
As you know a web solution consists of the .sln file as well as all the .aspx files.
Well we noticed when we right click the solution and we select "Add selected projects to subversion". It prompts me to tell it where to store the .sln file. So I give it some path like svn://serverName/CIS/MyWebSiteProject. Cool it just placed the .sln file...so I thought to myself how is it going to store the .aspx files as well.
Within a second I got a second prompt, I thought cool it is prompting me for the .aspx pages. So I tried giving it the path svn://serverName/CIS/MyWebSiteProject/ASPX_Files, but it comes back with an error stating I cannot place this folder within this path. I actually have to go outside of the folder MyWebSiteProject.
Not good cause now I have 2 folders one with the .sln folder and the other with all the .aspx pages and these folders are sitting on:
(sln file):
svn://serverName/CIS/MyWebSiteProject
(aspx files):
svn://serverName/cis/myWebSitePages
This really is not ideal cause I am sitting on the root of CIS with 2 folders for really one solution. Now when I try to check the project out I have to check both folders out.
What makes this even worse is when I do check them out I try to open the .sln file and I get an error that it cannot find the corresponding .aspx files. This seems like too much work, is there an easier way or a recommended way of using tortisesvn/subversion with asp.net web projects ?
While I am sure you have TortoiseSVN installed, it sounds like you are using Ahnk or some other VS SCC plugin to add from within VS.
I would suggest not using the plugin to initally add the solution to SVN, but to use TortoiseSVN in Windows Explorer for your initial check in. This will add your solution directory in its original state.
From that point on, you should be able to use the SCC plugin from within VS without trouble.
EDIT
Ok, after your commment I realize that I was not fully understanding the problem.
If you are dealing with a single project, after you create your solution and project, select the solution in Solution Explorer, go to 'file>save solution as' and save the solution inside the directory where your project file is.
Close the solution and go out to Explorer and use Tortoise to add the directory to SVN. If you have multiple projects/sites, just pick one to hold the solution.
Does that make sense? and from that point you should have no problems with ahnk
The key to successfully using Visual Studio with any source control is to put the solution file in the same path as the rest of the project files.
Usually, I will do something like the following:
\Project\Project.sln
\Project\MainWebSite\*.* <-- All web site files (including .??proj here).
\Project\Library\*.*
Then, I manually put \Project\*.* into source control.
Other options exist, as for my recent projects, I have been using:
\Project\SolutionFiles\Project.sln
\Project\MainWebSite\*.*
\Project\Library\*.*
Again, I manually put \Project\*.* into source control.
I generally find that it is better to set up the repositories for my solutions and projects from within Tortoise SVN. Then use whatever VS plugin that you care for to manage the commits of your pages etc. This gives you a little more control and allows you to get your setup correct from the start.

Resources