|
In the Additional Include Directories for the resource compiler? I'm NOT talking about the C++ compiler options...
|
|
|
|
|
In 'MyProgram' Property Pages under C/C++ General Additional Include Directories.
|
|
|
|
|
OK I got you.
Stop complaining about that.
Thanks big time!
Now I get:
"fatal error LNK1104: cannot open file 'C:/Program Files/Microsoft SDKs/Windows/v5.0/Lib/DnsAPI.Lib'" ?
|
|
|
|
|
That's a completely different matter - if you really need DNSAPI.lib, what I'd do is open a Command Prompt window, and execute the following commands:
CD /d "c:\Program Files"
dir /s/b dnsapi.lib
It might take a while to run, probably, but it'll likely find any DNSAPI.lib you have. On my machine, I get the following output:
C:\Program Files\Microsoft SDKs\Windows\v5.0\Lib\IA64\DnsAPI.Lib
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\DnsAPI.Lib
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\x64\DnsAPI.Lib
C:\Program Files\Microsoft SDKs\Windows\v6.1\Lib\DnsAPI.Lib
C:\Program Files\Microsoft SDKs\Windows\v6.1\Lib\IA64\DnsAPI.Lib
C:\Program Files\Microsoft SDKs\Windows\v6.1\Lib\x64\DnsAPI.Lib
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Lib\DnsAPI.Lib
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Lib\DnsAPI.Lib
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Lib\AMD64\DnsAPI.Lib
You can see that (for some reason - I don't know why!) I only have Itanium libraries under C:\Program Files\Microsoft SDKs\Windows\v5.0.
|
|
|
|
|
Is there any way you can get him to take another one, like second from v6.0A for example?
|
|
|
|
|
Yes - in the project properties, under 'Linker', you can tell the linker what directories to look in.
Alternatively, you can add them under Tools->Options, somewhere near the place where you can say what C++ include directories to use.
|
|
|
|
|
Tried it in both places but still no improvement (in tools options even when I pull it up at the top of list)!
Error:"fatal error LNK1104: cannot open file 'C:/Program Files/Microsoft SDKs/Windows/v5.0/Lib/DnsAPI.Lib'"
But big thanks for you anyway.
|
|
|
|
|
Sounds like something has the whole of that path hard-coded.
There might (might!) be a #pragma comment(lib, "C:/Program Files/Microsoft SDKs/Windows/v5.0/Lib/DnsAPI.Lib") somewhere in your code or the code you #include ?
|
|
|
|
|
I agree it looks like hard-coded line of code because no meter what directory path I add, both in 'project property->linker->additional library directories' or 'tools->options->VC++directories(under library files)' I'm getting the same error:
"LINK: fatal error LNK1104: cannot open file 'C:/Program Files/Microsoft SDKs/Windows/v5.0/Lib/DnsAPI.Lib'"!
But can't find where in my code I'm doing that. I inherited this project from another person and on his machine everything works just fine.
???
|
|
|
|
|
Problems are solved, I get the project working!
Thanks for helping me around!
If I have any future question al be sure to post it here.
Once again thanks!
|
|
|
|
|
I am facing the same problem u faced..but i am not getting the solution.
the error i got is:
fatal error LNK1104: cannot open file 'C:/Program Files/Microsoft SDKs/Windows/v5.0/Lib/DnsAPI.Lib'
please help me..
thanks in advance..
|
|
|
|
|
Hi,
it was a long time ago, but if I remember correctly I had to recreate the workarounds (folder states/names/positions) as the person who redistrict this project to me. For example I placed all folders needed in my 'D:\MyProject\...' while on his PC it was placed on 'C:\' drive each folder for himself. I know this may seem odd (especially if you link everything properly ) but it worked.
The thing was there was many files to edit and rebuild for things to work this seamed to be the easy way!
Best luck to you!
|
|
|
|
|
CComObject<CMyCircle> *pCircle;
HRESULT hRes = CComObject<CMyCircle>::CreateInstance(&pCircle);
IMyCirclePtr pCircle1;
pCircle1.CreateInstance(__uuidof(MyCircle));
Difference between pCircle & pCircle1?
|
|
|
|
|
(Presuming CMyCircle is a proper COM interface) - pCircle1 is a managed pointer (it calls AddRef and Release when necessary). pCircle isn't, so you have to call AddRef and Release when necessary.
|
|
|
|
|
I need smtp2 code..in oder to send mass email address at a time....
|
|
|
|
|
i need mass sender to in box ..
|
|
|
|
|
And this has what connection to ATL/WTL/STL?
|
|
|
|
|
whats the advantage in using CComPtr over CComQIPtr?
How to create COM object using CComObject class?
|
|
|
|
|
CComQIPtr performs an IUnknown->QueryInterface call on the interface pointer you pass in the constructor, to get a correctly typed interface pointer (or NULL in the case that the interface pointer you gave it does not implement the interface pointer type you want). CComPtr assumes that you're passing a correctly typed interface pointer (i.e. the same type as what the CComPtr has been instantiated for).
So - if you are 100% sure that the interface pointer type is the correct type, CComPtr is fine. If you can't make that guarantee, then you need to use CComQIPtr . CComQIPtr 's constructor will be a little slower than CComPtr 's (it does the QueryInterface call, after all), but it is safe.
|
|
|
|
|
I am using Vista and VS2008. I have changed setup80.js and it gives the message
App Wizard successfully installed!
Now when I want to create a project it goes through all the dialog boxes but at the end no project is created. What I am missing.
|
|
|
|
|
Yesterday I installed VS2008, downloaded WTL and added the WTL include directory to VS settings but had not run the .js file. So after seeing you mail I tried it only to have it say it couldn't find Visual Studio. You said you changed setup80.js; but not what you changed which would have helped. Anyway, a quick look in the registry showed that it 9.0 was needed, presumably this is what you meant. I did a search and replace in setup80.js for '8.0' and changed it to '9.0' in about four places. I saved the file as setup90.js and ran it with it completing successfuly.
On starting a new VS2008 project I now get the option of a WTL project. Selecting this and the defaults on the wizard gave me a WTL project, files and all.
I realise this doesn't tell you what you are doing wrong, but it does tell you what I did to get it to work.
|
|
|
|
|
Nice post. I have not yet used WTL in VS2008 so this information will be great when I do, thanks.
led mike
|
|
|
|
|
I did not change anything in registry but changed js file.
// Windows Template Library - WTL version 8.0
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// This file is a part of the Windows Template Library.
// The use and distribution terms for this software are covered by the
// Microsoft Permissive License (Ms-PL) which can be found in the file
// Ms-PL.txt at the root of this distribution.
// Setup program for the WTL App Wizard for VC++ 8.0 (Whidbey)
main();
function main()
{
// Decode command line arguments
var bDebug = false;
var bElevated = false;
var Args = WScript.Arguments;
for(var i = 0; i < Args.length; i++)
{
if(Args(i) == "/debug")
bDebug = true;
else if(Args(i) == "/elevated")
bElevated = true;
}
// See if UAC is enabled
var Shell = WScript.CreateObject("Shell.Application");
if(!bElevated && Shell.IsRestricted("System", "EnableLUA"))
{
// Check that the script is being run interactively.
if(!WScript.Interactive)
{
WScript.Echo("ERROR: Elevation required.");
return;
}
// Now relaunch the script, using the "RunAs" verb to elevate
var strParams = "\"" + WScript.ScriptFullName + "\"";
if (bDebug)
strParams += " /debug";
strParams += " /elevated";
Shell.ShellExecute(WScript.FullName, strParams, null, "RunAs");
return;
}
// Create shell object
var WSShell = WScript.CreateObject("WScript.Shell");
// Create file system object
var FileSys = WScript.CreateObject("Scripting.FileSystemObject");
// Get the folder containing the script file
var strValue = FileSys.GetParentFolderName(WScript.ScriptFullName);
if(strValue == null || strValue == "")
strValue = ".";
var strSourceFolder = FileSys.BuildPath(strValue, "Files");
if(bDebug)
WScript.Echo("Source: " + strSourceFolder);
if(!FileSys.FolderExists(strSourceFolder))
{
WScript.Echo("ERROR: Cannot find Wizard folder (should be: " + strSourceFolder + ")");
return;
}
try
{
//var strVC8Key = "HKLM\\Software\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir";
var strVC8Key = "HKLM\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC\\ProductDir";
strValue = WSShell.RegRead(strVC8Key);
}
catch(e)
{
try
{
var strVC8Key_x64 = "HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\9.0\\Setup\\VC\\ProductDir";
strValue = WSShell.RegRead(strVC8Key_x64);
}
catch(e)
{
WScript.Echo("ERROR: Cannot find where Visual Studio 9.0 is installed.");
return;
}
}
var strDestFolder = FileSys.BuildPath(strValue, "vcprojects");
if(bDebug)
WScript.Echo("Destination: " + strDestFolder);
if(!FileSys.FolderExists(strDestFolder))
{
WScript.Echo("ERROR: Cannot find destination folder (should be: " + strDestFolder + ")");
return;
}
// Copy files
try
{
var strSrc = FileSys.BuildPath(strSourceFolder, "WTLAppWiz.ico");
var strDest = FileSys.BuildPath(strDestFolder, "WTLAppWiz.ico");
FileSys.CopyFile(strSrc, strDest);
strSrc = FileSys.BuildPath(strSourceFolder, "WTLAppWiz.vsdir");
strDest = FileSys.BuildPath(strDestFolder, "WTLAppWiz.vsdir");
FileSys.CopyFile(strSrc, strDest);
}
catch(e)
{
var strError = "no info";
if(e.description.length != 0)
strError = e.description;
WScript.Echo("ERROR: Cannot copy file (" + strError + ")");
return;
}
// Read and write WTLAppWiz.vsz, add engine version and replace path when found
try
{
var strSrc = FileSys.BuildPath(strSourceFolder, "WTLAppWiz.vsz");
var strDest = FileSys.BuildPath(strDestFolder, "WTLAppWiz.vsz");
var ForReading = 1;
var fileSrc = FileSys.OpenTextFile(strSrc, ForReading);
if(fileSrc == null)
{
WScript.Echo("ERROR: Cannot open source file " + strSrc);
return;
}
var ForWriting = 2;
var fileDest = FileSys.OpenTextFile(strDest, ForWriting, true);
if(fileDest == null)
{
WScript.Echo("ERROR: Cannot open destination file" + strDest);
return;
}
while(!fileSrc.AtEndOfStream)
{
var strLine = fileSrc.ReadLine();
if(strLine.indexOf("Wizard=VsWizard.VsWizardEngine") != -1)
strLine += ".8.0";
else if(strLine.indexOf("WIZARD_VERSION") != -1)
strLine = "Param=\"WIZARD_VERSION = 8.0\"";
else if(strLine.indexOf("ABSOLUTE_PATH") != -1)
strLine = "Param=\"ABSOLUTE_PATH = " + strSourceFolder + "\"";
fileDest.WriteLine(strLine);
}
fileSrc.Close();
fileDest.Close();
}
catch(e)
{
var strError = "no info";
if(e.description.length != 0)
strError = e.description;
WScript.Echo("ERROR: Cannot read and write WTLAppWiz.vsz (" + strError + ")");
return;
}
// Create WTL folder
var strDestWTLFolder = "";
try
{
strDestWTLFolder = FileSys.BuildPath(strDestFolder, "WTL");
if(!FileSys.FolderExists(strDestWTLFolder))
FileSys.CreateFolder(strDestWTLFolder);
if(bDebug)
WScript.Echo("WTL Folder: " + strDestWTLFolder);
}
catch(e)
{
var strError = "no info";
if(e.description.length != 0)
strError = e.description;
WScript.Echo("ERROR: Cannot create WTL folder (" + strError + ")");
return;
}
// Read and write additional WTLAppWiz.vsdir, add path to the wizard location
try
{
var strSrc = FileSys.BuildPath(strSourceFolder, "WTLAppWiz.vsdir");
var strDest = FileSys.BuildPath(strDestWTLFolder, "WTLAppWiz.vsdir");
var ForReading = 1;
var fileSrc = FileSys.OpenTextFile(strSrc, ForReading);
if(fileSrc == null)
{
WScript.Echo("ERROR: Cannot open source file " + strSrc);
return;
}
var ForWriting = 2;
var fileDest = FileSys.OpenTextFile(strDest, ForWriting, true);
if(fileDest == null)
{
WScript.Echo("ERROR: Cannot open destination file" + strDest);
return;
}
while(!fileSrc.AtEndOfStream)
{
var strLine = fileSrc.ReadLine();
if(strLine.indexOf("WTLAppWiz.vsz|") != -1)
strLine = "..\\" + strLine;
fileDest.WriteLine(strLine);
}
fileSrc.Close();
fileDest.Close();
}
catch(e)
{
var strError = "no info";
if(e.description.length != 0)
strError = e.description;
WScript.Echo("ERROR: Cannot read and write WTL\\WTLAppWiz.vsdir (" + strError + ")");
return;
}
WScript.Echo("App Wizard successfully installed!");
}
I only changed 2 places. At first it looks it is working and go through all the dialog Boxes where you can change options for your project, but at the end nothing is generated. No project no file. I am not sure what I am doing wrong. Thank you for your reply.
Best regards
Agha Khan
|
|
|
|
|
I
I just realized I also have to change from strLine += ".8.0" to strLine += ".9.0";
It works.
Thanks for reply.
Best regards
Agha Khan (UMIST)
while(!fileSrc.AtEndOfStream)
{
var strLine = fileSrc.ReadLine();
if(strLine.indexOf("Wizard=VsWizard.VsWizardEngine") != -1)
strLine += ".8.0";
else if(strLine.indexOf("WIZARD_VERSION") != -1)
strLine = "Param=\"WIZARD_VERSION = 8.0\"";
else if(strLine.indexOf("ABSOLUTE_PATH") != -1)
strLine = "Param=\"ABSOLUTE_PATH = " + strSourceFolder + "\"";
fileDest.WriteLine(strLine);
}
To
while(!fileSrc.AtEndOfStream)
{
var strLine = fileSrc.ReadLine();
if(strLine.indexOf("Wizard=VsWizard.VsWizardEngine") != -1)
strLine += ".9.0";
else if(strLine.indexOf("WIZARD_VERSION") != -1)
strLine = "Param=\"WIZARD_VERSION = 8.0\"";
else if(strLine.indexOf("ABSOLUTE_PATH") != -1)
strLine = "Param=\"ABSOLUTE_PATH = " + strSourceFolder + "\"";
fileDest.WriteLine(strLine);
|
|
|
|
|
I have defined a struct type in IDL as follows
typedef struct tData
{
int i;
int j;
tData()
{
i = 0; j = 0;
}
}MyData;
Getting error as follows.
error MIDL2025 : syntax error : expecting a type specification near "tData".
|
|
|
|