|
Missing header?
VC7 using different set of headers if you are aware of it.
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
I got rid of the small weird errors in the header file but if anyone knows about header files that are used in VC7 that are not used in VC6, as regards WMI, then please let me know. The headers im using so far are:
#include string.h
#include wbemidl.h
#include windows.h
#include objbase.h
#include wbemcli.h
#include comdef.h
#include tchar.h
#include stdio.h
Some of these may even be sitting there doing nothing, According to the MSDN both functions that are giving me problems (CoInitializeSecurity & CoSetProxyBlanket) are in "objbase.h" and use "ole32.lib", and I have referenced both.
We have a mathematician, a different kind of mathematician, and a statistician!
|
|
|
|
|
You should be using #include <windows.h> for any Windows features, including COM. It needs to appear before any other Windows-related includes. windows.h includes a whole load of other include files; you can speed up compiles quite a bit by using pre-compiled headers. It may be that you haven't copied your stdafx.h from your VC6 project.
objbase.h is included by ole2.h in the Platform SDK that ships with Visual Studio .NET 2003. However, ole2.h is not included if you define NOGDI unless you also define INC_OLE2 .
The C2143 error often occurs if a type isn't declared; the compiler assumes you were trying to define a variable with that name instead. The '*' is then illegal at that position, so it assumes a missing semicolon.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Im already using #include <windows.h> and if I use precompiled headers then I get:
fatal error C1010: unexpected end of file while looking for precompiled header directive.
and the advice for this was "not to use precompiled headers" which gave me the problems I have now,
Also, What can I do to get rid of:
error LNK2001: unresolved external symbol _CLSID_WbemAdministrativeLocator
_CLSID_WbemAdministrativeLocator should be a default value in the function CoCreateInstance.
The code used looks like:
hRes = CoCreateInstance (CLSID_WbemAdministrativeLocator,
NULL , CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER ,
IID_IUnknown ,
( void ** ) & IWbemLoc);
I have also tried:
hRes = CoCreateInstance(CLSID_WbemLocator, NULL,
CLSCTX_INPROC_SERVER,IID_IWbemLocator,
(LPVOID *)&m_pIWbemLocator);
and I get the same link error with both CLSID_WbemLocator & IID_IWbemLocator
We have a mathematician, a different kind of mathematician, and a statistician!
|
|
|
|
|
OK, if you decide to use precompiled headers, you need to either #include your precompiled header file in each source file, use a #pragma hdrstop directive, or disable pre-compiled headers for that file (in which case you should include any headers that you need for that source file).
I can't see why CoCreateInstance would still be undefined if you've included both windows.h and objbase.h . Have you defined _OBJBASE_H_ somewhere?
You could try using the /showIncludes option to the compiler to show which files are actually being included. I'm not sure if this option was available in VS.NET 2002. If objbase.h is definitely being included, try using the /P option (with /C to preserve comments) to generate a pre-processed output and check whether the declarations are being output.
As for your other problem, you need to provide a definition as well as a declaration for your GUIDs. For WMI, you can simply link to wbemuuid.lib .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Adding wbemuuid.lib sorted it, thanks a million, your a star!
We have a mathematician, a different kind of mathematician, and a statistician!
|
|
|
|
|
how shall i add a toolbar to IE using MFC. is there any class available for that.
ComputerNewton
|
|
|
|
|
|
i had searched the entire MSDN. but hadnt found. i got it using WTL in Codeproject. but i want it strictly in MFC but not in wtl/atl/other.
how shall i get that
for that in msdn.microsoft.com i got something, which not working.
ComputerNewton
|
|
|
|
|
Hello,
I wrote applications that suppose to open automatically by the auto
play mechanism of the WinXP, I entered the correct values to the
registry and the application start ok.
The problem I have is that I get a message box with error every time:
'E:\ The device is not ready'
Any ideas what is the problem?
The Registry settings:
--------------------------------------------------------------------
[HKEY_CLASSES_ROOT\MyApplication]
@="ImageDownload"
[HKEY_CLASSES_ROOT\MyApplication\shell]
[HKEY_CLASSES_ROOT\MyApplication\shell\open]
[HKEY_CLASSES_ROOT\MyApplication\shell\open\command]
@="C:\\Work\\Private\\MyApplication\\Debug\\MyApplication.exe \"%1\""
[HKEY_CLASSES_ROOT\MyApplication\shell\open\ddeexec]
@="[open(\"%1\")]"
--------------------------------------------------------------------
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\MyApplication]
"Action"="MyApplication"
"DefaultIcon"="C:\\Work\\Private\\MyApplication\\Debug\\MyApplication.exe,0"
"InvokeProgID"="MyApplication"
"InvokeVerb"="open"
"Provider"="MyApplication"
--------------------------------------------------------------------
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\ShowPicturesOnArrival]
"MyApplication"=""
--------------------------------------------------------------------
|
|
|
|
|
Hi,
I am sorry, I do not have the answer to your question but another one with which you can help, I guess.
I just entered all the correct values into the registry, but my application does NOT start. Is there anything I have to do from within the application?
I verified my entries by starting another application, which works fine. But my own does not start at all. Any ideas?
Thanks,
Sathie
|
|
|
|
|
How may I lock the width on my CDialog. I’d like to size it only vertical
.....and justice for all
APe
|
|
|
|
|
Handle WM_SIZING . You can restrict the user's operation to allow sizing by a specific edge or corner only.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi.
I want to do NAT Tunneling using NAT (network address translation)
protocol.
How can i do it in VC++
Means any one know about its commands etc.
Actually my server (private IP)is running on one LAN ( Public IP)
And Client(private IP) is Running on other LAN (public IP)
How can they communicate to each other ...
I Guessed that it is bcoz of NAT ..
But i not know about its Programming techniques
PLZ
Reply me
thanx
|
|
|
|
|
To get them to talk you have to change the firewall on the server side to forward a port to the server machine-- how you do this depends on your firewall.
|
|
|
|
|
Why this error comes?. is there any remedy for this?. can my application get relief from it, if i download VC6 service pack?.
ComputerNewton
|
|
|
|
|
You need to install the unicode version of your MFC lib which by default not set in your stardard installation.
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
hello all,
As mentioned in the MSDN, i had added "Shlwapi.h" and a library link "Shlwapi.lib". but the problem is that still my application is giving an error informing about the declaration of UrlEscape(...)
Error : UrlEscape undeclared identifier
how shall i fix this bug.
ComputerNewton
|
|
|
|
|
do you have platform sdk installed ?
greatest thing is to do wot others think you cant suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
ohhh i dont know that i am simply using MFC Applications. how shall i install that?.
what ever the application i am using that is MFC based application in that i got this error. for this type of applications too i need platform SDK?. where shall i get the platform SDK.
ComputerNewton
|
|
|
|
|
|
Hi NewtonOfComputers, instead of statically linking to shlwapi.lib , you should consider dynamic linking instead, because UrlEscape function was introduced in version 5.00 of shlwapi.dll so it requires Windows 98 (or Windows 95 with Internet Explorer 5.0 or later) in your system. To make your code compatible with all Windows versions, do something like this:
#ifdef _UNICODE
#define szURLESCAPEFUNC _T("UrlEscapeW")
typedef LWSTDAPI (*URLESCAPEFUNC)(LPCWSTR, LPWSTR, LPDWORD, DWORD);
#else
#define szURLESCAPEFUNC _T("UrlEscapeA")
typedef LWSTDAPI (*URLESCAPEFUNC)(LPCSTR, LPSTR, LPDWORD, DWORD);
#endif
HMODULE hModShlwapi = LoadLibrary(_T("shlwapi.dll"));
if (hModShlwapi != NULL)
{
URLESCAPEFUNC pUrlEscFunc = (URLESCAPEFUNC)GetProcAddress(hModShlwapi, szURLESCAPEFUNC);
if (pUrlEscFunc != NULL)
{
(*pUrlEscFunc)(...);
}
FreeLibrary(hModShlwapi);
}
Gurmeet S. Kochar If you believe in God, it's because of the Devil
My CodeProject Articles: HTML Reader C++ Class Library, Numeric Edit Control
|
|
|
|
|
hello all,
As i am trying to add a toolbar to InternetExplorer from VC++ applications, i had downloaded the said component kbbar.exe from
http://support.microsoft.com/support/ kb/articles/Q246/2/34.ASP
But this file is giving so many errors. How shall i overcome these errors.
ComputerNewton
|
|
|
|
|
Is it possible to make a dialog only enable to minimize from the System menu?
.....and justice for all
APe
|
|
|
|
|
yes we can do that. for that u need to control the system menu. first get the handle of System Menu and start working as we used do in case of general menus concept.
ComputerNewton
|
|
|
|