|
what is the difference between (c):
HMENU hMenu = NULL;
and
HMENU hMenu = (HMENU) NULL;
or (c++):
HMENU hMenu = 0;
and
HMENU hMenu = reinterpret_cast<HMENU>(0);
Is cast operator while initializing pointers really necessary?
|
|
|
|
|
There is no difference between any of those. They all have the same effect.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hello,
I am trying to make a plugin in Visual C++ using netscape API.
the plugin gets invoked when i try to open a non-native user defined file (eg. somefile.yyy )and runs properly. But it does get invoked for html and htm files.
Please help....i need to submit this project for graduation.
thanks in advance...
zuber
|
|
|
|
|
I was trying to includeThe nFS Library[^] in my project, but I couldn't do it like the demo application, where he didn't include neither the .h files nor the .lib file into the project.
When I tried to recompile my program with including all the .h and .cpp files of the libraries it worked.
Since my project is already full with files, so I removed all these files, and included only the .lib file, and recompiled the program. and I got the following error
LIBCMT.lib(crt0.obj) : error LNK2005: __amsg_exit already defined in msvcrtd.lib(MSVCR70D.dll)<br />
LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCR70D.dll)<br />
LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCR70D.dll)<br />
LIBCMT.lib(crt0dat.obj) : error LNK2005: __cexit already defined in msvcrtd.lib(MSVCR70D.dll)<br />
LIBCMT.lib(crt0dat.obj) : error LNK2005: __c_exit already defined in msvcrtd.lib(MSVCR70D.dll)<br />
LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in msvcrtd.lib(MSVCR70D.dll)<br />
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj)<br />
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj)<br />
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj)<br />
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj)<br />
msvcrtd.lib(MSVCR70D.dll) : error LNK2005: __setmbcp already defined in LIBCMT.lib(mbctype.obj)<br />
LINK : warning LNK4098: defaultlib 'msvcrtd.lib' conflicts with use of other libs; use /NODEFAULTLIB:library<br />
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library<br />
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup<br />
Debug/Trial.exe : fatal error LNK1120: 1 unresolved externals
When I put /NODEFAULTLIB:LIBCMT, it works fine. But I will need multi-threading for an even more important Library.
So, what are the consequences of adding that line to the commandline of Linker....... and what can I do to solve my problem without having to add it. Do I have to go back to adding all the .h and .cpp files of the library.... or .
Please help.
|
|
|
|
|
This happens when you try to link things together that have been compiled with different settings.
Go through *every* single library that you are linking in and make sure you are using the correct one i.e. multi-threaded. You also need to check the DLL/not-DLL switches are all the same as well.
Lets be honest, isn't it amazing how many truly stupid people you meet during the course of the day. Carry around a pad and pencil, you'll have twenty or thirty names by the end of the day - George Carlin
Awasu 2.1.1 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Thanks
It worked fine.
|
|
|
|
|
I can host and communicate with it just fine. The only quirk is that it refuses to use the XP look and feel for buttons and other HTML controls. I have a manifest for my app. Every native/win32 control is correctly themed, so the manifest is obviously correct. In fact, IE's own scrollbar is correctly themed, just not its contents.
What did I miss?
I am hosting the control in an ATL/WTL project, but I don't think that's the problem. I should also mention that if I load the html file in IE (the "real" browser), UI controls are themed.
--
Schni Schna Schnappi! Schnappi Schnappi Schnapp!
|
|
|
|
|
This takes a few steps, and I don't think I have code for it handy at the moment, but the procedure is:
Write a COM object that implements IDocHostUIHandler .
That COM object has to be attached (vague term here, this is the part I don't have memorized) to the AtlAxWin that is hosting the WebBrowser control.
In the IDocHostUIHandler::GetHostInfo() method, do this:
HRESULT CFoo::GetHostInfo(DOCHOSTUIINFO *pInfo)
{
pInfo->dwFlags |= DOCHOSTUIFLAG_THEME;
return S_OK;
} The "attach" part is done by querying the WebBrowser control for ICustomDoc and calling its SetUIHandler() method.
Let me know if you need more help, I can try to find some working code for you.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
I have implemented IDocHostUIHandler::GetHostInfo() just like advised.
However, the web control does not implement ICustomDoc, but the document object does, which I assume you meant and not the web browser itself. I set ui handler on that interface, but nothing happens. Well not when expected anyway. GetHostInfo is only called when I for example click on the document, which is way too late I imagine.
I'm stumped. And it doesn't help that it's half past midnight. Perhaps I do best in taking a break.
--
Schni Schna Schnappi! Schnappi Schnappi Schnapp!
|
|
|
|
|
Even a very tired man has his moments. I navigated to "about:blank" first, then set the doc host ui handler, and then navigated to my real page. And voilà!
Thank you very much for your help MrMVP Dunn.
--
Schni Schna Schnappi! Schnappi Schnappi Schnapp!
|
|
|
|
|
|
The result of the equation below should be 18.056298955613577023498694516971, but I cannot get anything other then 00 and I don't know why. Anyone else know why?
UINT answer = (36883 / 49024) * 24;
|
|
|
|
|
Integer division of 36883 by 49024 is zero. Multiply that by 24 and you get zero.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I understand that but I cannot find a solution to this problem. If done by calculator it comes out like this;
36883 / 49024 = 0.75234578981723237597911227154047
0.75234578981723237597911227154047 * 24 = 18.056298955613577023498694516971
|
|
|
|
|
Try (36883.0 / 49024.0) * 24.0.
The compiler thinks you're declaring integers, because you aren't including the decimal point.
As mentioned above, integer division of your values results in zero.
|
|
|
|
|
|
Hi
How i can :
run an *.exe file and then stop it ?
|
|
|
|
|
Use ShellExecute()for starting exe , why you want to stop exe?
Regards,
Abhi Lahare
|
|
|
|
|
i have to close exe and run it to update some other tasks.
|
|
|
|
|
|
How can I read/write registry entries in an mfc dll?
e.g. can I use the CWinApp interface ?
Thanks.
- KarmaFX
|
|
|
|
|
karmafx wrote:
How can I read/write registry entries in an mfc dll?
The same way you would in an EXE...with the registry API.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks..
Okay, so I guess I cannot do it the MFC way ?
i.e.
CWinApp* pApp = AfxGetApp();
CString key = "Preferences";
CString f = pApp->GetProfileString(key,....
int l = pApp->GetProfileInt(key, ....
....
?????
|
|
|
|
|
Sure, you can use the CWinApp() methods, but they are slightly less flexible that the API itself. It really just depends on exactly what you are wanting storing and where.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Ok...so now my questions boils down to:
How do I get a CWinApp interface within a dll ?
in my experience AfxGetApp returns null in dll's...
Thanks again.
- KarmaFX
|
|
|
|