|
koumodaki wrote: I do not want this window to appear
Did you try ShellExecute:
HINSTANCE ShellExecute(HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
It's last parameter may help you in your cause.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
You may be able to get around the confirmation by redirecting a text file containing a Y , or yes followed by a CR , but it would likely be better for you to just use the SCM/Service API directly to start/stop the service.
Lookup the StartService(...) Win32 function for more details.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
koumodaki wrote: Is there some way to stop the dos window poping up and asking for confirmation?
Yes.
echo y.|net stop iisadmin But you are better off using James' suggestion.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I am currently working on a Visual C++ 6 project which generates an html file by first generating a xml file and applying my own xsl stylesheets. Currently, I just have the xsl files on my harddrive and I am loading them with a c++ string literal containing the directory of the files. Obviously this is a bad way, but it is temporary..
The problem now is that I would like to package up the xsl files, an external javascript file, and a set of images (used as icons in the html pages) with the executable. How can I do this with VC6? I would ideally like to be able to output a folder containing the html file and a subfolder that contains the images and the javascript file. In this way, a user can use my tool to "publish" the html file. To generate the html file, I would like to use my internal xsl files along with MSXML.
To summarize in case I was not clear, I need to allow the user to publish an html file by generating the html file, and also supplying with the html file a set of images and a javascript file needed by the html file. However, I need to package the images and javascript file with the executable of my project and output those files when the html is published.
Thanks a bunch for any help!
|
|
|
|
|
have you seen this[^] series of articles ?
|
|
|
|
|
Yes, but the article deals with embedded text files and I was not sure if the same techniques would apply to bitmap files.
Since the files are stored as binary files, could I simply output the binary stream of an embedded bitmap to some file and call it "name.bmp" and it would that file interepted by Windows as a bitmap?
|
|
|
|
|
yes, i think doing so would do the trick...
|
|
|
|
|
Yes, you can even store executables or DLL's as resource files and write them back out to disk. They will have the same checksum as they did before being stored as a resource, its an exact binary match.
The article by Hans is great but in case you dont feel like reading for that long, here is another thats alot more simple and right to the point. http://www.codeproject.com/win32/binaryresources.asp[^]
-Randor
|
|
|
|
|
Torus_XL wrote: The problem now is that I would like to package up the xsl files, an external javascript file, and a set of images (used as icons in the html pages) with the executable. How can I do this with VC6?
To understand how FindResource() and LoadResource() work, see the Extracting the data section
of this article.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Alright, thanks to everyone who posted! Those articles should be a good jumpstart for me
|
|
|
|
|
I'm moving from VC6 to VC2005. This code....
class myAccessor
{
public:
TCHAR m_EMPRESA[6];
SHORT m_TipoCpbte;
BEGIN_COLUMN_MAP(CdboBajFactProvAccessor)
COLUMN_ENTRY(1, m_EMPRESA)
COLUMN_ENTRY(2, m_TipoCpbte)
END_COLUMN_MAP()
CString sEmpresa = "Esta Empresa";
strcpy( myAccessor.m_EMPRESA, sEmpresa );
myAccessor.m_TipoCpbte = 1;
HRESULT hr = myAccessor.Insert();
I can't compile strcpy, invalid function. What function replace strcpy. Thanks
|
|
|
|
|
it's been deprecated (due to thread safety reasons), but never removed from the CRT (how could it?) !
if the compiler doesn't find it, you have a problem in your VS2005 installation
|
|
|
|
|
Interesting, I didn't know this. I thought it was deprecated for buffer overflow reasons.
|
|
|
|
|
Yes, it was because of the possibility of buffer overflow.
-Randor
|
|
|
|
|
Even if strcpy() were available (it is, just not by default), you do realize that m_EMPRESA will only hold 6 characters, not the 13 that sEmpresa holds.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Have you read the docs? The first sentence on the strcpy page reads:
These functions are deprecated because more secure versions are available; see strcpy_s, wcscpy_s, _mbscpy_s.
|
|
|
|
|
Hi,
I'm using VC++6.
I'm having an application which has dependency with many other libraries.
I've added the libraries to the application workspace using
project->dependencies.
I'm getting compiler error c1083. "fatal error C1083: Cannot open include file: 'filename.h': No such file or directory"
But the file exists.
If i include the path in Include files(Tools->Options->Directories), Iam getting the error for some other file.
The files are library files. If i build the library there is no error. The error occurs only if i build the application.
What could be the root cause?
Thanks & Regards,
Sanju
|
|
|
|
|
I'm not sure if I fully understand what you mean. First you mention a header file. Then you mention a library file. Which one is it? *.h and *.lib paths are not part of the same list of paths, as far as I know. There should be a section for each of them. That said, it would typically be better to add the include paths to your project file, not in the global settings as it makes your application more portable in development when you move from computer to computer, environment to environment.
Edit: I just reread it, and maybe you mean that once you solve the header issue, you get a library issue. If that's the case, then you will have to edit the library paths as well. I'm unsure which setting it is in VC6, but in VC2005, it's under "Configuration Properties --> Linker --> General --> Additional Library Directories".
|
|
|
|
|
Hi,
Thanks for the reply.
I'll explain the issue in detail.
I have an MFC AppWizard Exe application and i've say 2-3 MFC Win32 static library applications. I've added the library applications as dependencies in the exe application using Project->Dependencies.
Suppose fileX.h and fileY.h is in lib1.
file2.h in lib2, file3.h in lib3.
Then in fileX.h i've added #include "file2.h" and
in fileY.h i've added #include "file3.h".
If i build lib1 i'm not getting any compiler error.
But if i build the application which has dependency on lib1, i'm getting error c1083, saying
"fatal error C1083: Cannot open include file: 'file2.h': No such file or directory".
But the file exists. Then i included the file path of file2.h using Tools->Options->Directories. Then the error for file2.h is gone but it shows error for file3.h. What could be the problem?
Thanks & Regards,
Sanju
|
|
|
|
|
OK, a few things.
First of all, do not add your folders to Tools->Options->Directories. That's going to bite you later on, since that's pretty much the global folder reference. Instead, you need to add everything to the include directories under your project properties. It should be in the C/C++ section of the properties.
Second of all, say project 1 depends on project 2 which depends on project 3. If you include project 3 folders in project 2, then, project 2 will compile. If you include project 2 folders in project 1, it will not compile, because you also need to include project 3 headers in project 1 (which may be in an entirely different folder). I suggest you dump your lib headers in a common include folder so every project can simply include that folder.
|
|
|
|
|
Do you have it written as
#include <filename.h> // error C1083
// or
#include "filename.h"
|
|
|
|
|
Hi,
Thanks for the reply.
It is written as #include "filename.h"
Thanks & Regards,
Sanju
|
|
|
|
|
Can you show the "include" line of the code?
He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.
-Marc Clifton.
Best wishes to Rexx[^
|
|
|
|
|
Hi,
Thanks for the reply.
It is given as #include "filename.h"
Thanks & Regards,
Sanju
|
|
|
|
|
We have a straight Win32 developed application (no MFC, etc.). We've implemented dockable toolbars, but when they float there is a taskbar button that appears along with the application button. Each floating toolbar has its own button.
Can anyone recommend a way to remove this button, or somewhere I should look to see why I'm getting this button in the first place? I swear I read a Code Project article on just this thing several months ago, but have been unable to find it.
I'd also like the floating toolbars to keep the focused look, even when using the main application. Currently, the title bar of the toolbar gets the unfocused color to it. Again, I thought I read this in CodeProject somewhere, the same article, but can't find it!??!
Thanks,
|
|
|
|