|
Hi,
I thought I'd cracked this problem but it seems that I was wrong. Although I know now that the problem lies with the operating system.
I want to display a web page in a window. I realized that this is possible with the ShowHTMLDialog function, however it only works in windows XP not windows 7. There is something else though: I can get a web page to display when I run the program directly in visual studio but not when I run it as a stand-alone application(in windows 7). So I think the problem is that some required dlls are being loaded when I run it in visual studio but not as standalone.
It seems that the only dll i need for ShowHTMLDialog is mshtml.dll but I'm not sure if other dlls with different versions from windows XP are being used.
What's going on when I run the program from visual studio that is different from running the program on it's own ? How do I get ShowHTMLDialog to work in windows 7 ?
(I'm not using MFC)
thanks,
|
|
|
|
|
What kind of error are you getting? Not really sure what you mean when you say it only works on Windows XP, not Windows 7. You might be able to try using the dependancy walker application to find out what DLLs are needed by your application, thouhg.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
the error is that the program crashes on a call to ShowHTMLDialog(only on windows 7) and no dialog window appears.
thanks, I will check out the dependancy walker
|
|
|
|
|
Now that I checked here[^], I doubt that Dependancy Walker will help. You are going to have step through your code and find out which line of code is failing. My wild-ass guess would be that a call to GetProcAddress is probably not behaving as you expect it to.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Ah, the problem is where I convert a char string to wide char string. I need to convert the url I want to display to a wide char string and if I leave that code out and just specify google as the url, the program works in windows 7.
I'm not sure what I'm doing wrong with the conversion ?
char url[MAX_PATH];
_getcwd(url, MAX_PATH);
std::string file = url;
file += "\\Help.html\0";
OLECHAR* oleChar = NULL;
oleChar = (OLECHAR*)calloc(file.length(), sizeof(OLECHAR));
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, file.c_str(), -1, oleChar, sizeof(OLECHAR)*file.length());
BSTR bstrURL = SysAllocString(oleChar);
|
|
|
|
|
hi,
how do i know index of an iterator of a map?
map<int, int>::iterator it = mymap.find(3);
i want to know index of 'it' in mymap???
Zo.Naderi-Iran
|
|
|
|
|
You can increment a counter in a loop.
But why do you need this.
std::map always works on the key and so you must not use the index to perform any operations on the map.
Here is something you could do -
map<int, string> num;
int j = 0;
for (auto i = num.begin(); i != num.end(); ++i, ++j)
{
if ((*i).first == 5)
cout << j << endl;
}
Don't know if there is any other way to do this.
|
|
|
|
|
maps are not arranged in a simple linear order (they are trees), so there is no 'index' for an item.
|
|
|
|
|
int a[33*1024];
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
HANDLE hReadThread = NULL;
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
_tprintf(_T("Fatal Error: MFC initialization failed\n"));
nRetCode = 1;
}
else
{
hReadThread = AfxBeginThread(ThreadWrite,0);
}
WaitForSingleObject(hReadThread,INFINITE);
return nRetCode;
}
UINT ThreadWrite(LPVOID lParam)
{
for(int i=0; i < 32*1024; i++)
{
a[i]=i;
cout<<"Write:" << a[i];
}
return 1;
}
Why in above program,
WaitForSingleObject() is not wating for thread comletion?
|
|
|
|
|
Because AfxBeginThread returns a pointer to a CWinThread object, not a thread handle (see "AfxBeginThread" at MSDN[^]).
You have to change from:
john5632 wrote: hReadThread = AfxBeginThread(ThreadWrite,0);
to (error checks left to the reader)
CWinThread * pWinThread = AfxBeginThread(ThreadWrite,0);
hReadThread = pWinThread->m_hThread;
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
You are welcome.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yep...
|
|
|
|
|
Can you tell me where I found the CHKBOOK sample project ? Because here [^] I found only documentation, not project source ... Thank you.
|
|
|
|
|
|
Sorry, I didn't see any CHKBOOK sample ...
|
|
|
|
|
You need to use the links on that page to go and find it. Somewhere in there it will also explain where the sample source code can be found.
|
|
|
|
|
Of course that I use these links, but still, I didn't find it ... I found something newer but not CHKBOOK ... maybe microsoft get rid of ... I don't know.
|
|
|
|
|
Information on CHKBOOK is here[^] but it looks like the source has been removed. You should check your Visual Studio and SDK installation directories as some samples are shipped with the software.
|
|
|
|
|
Hello everybody,
i am working with VS 2008. I would like to change the Path dynamically in Additional Include Directories (Project Properties->Linker). Is that possible?
I would like to work with two set of SDKs'. After comparing the version, i would like to include appropriate versions of SDK. This is my situation.
Thanks in Advance.
Regards,
A. Gopinath.
|
|
|
|
|
I don't know how you could do this dynamically; an easier way would be to create a copy of the project with all the same settings except for this one value.
|
|
|
|
|
Hello Richard,
Thanks for your reply. Right now i am doing like that only. I just want to know whether it is possible or not. so only i posted here.
Thanks again.
Regards,
A. Gopinath.
|
|
|
|
|
You can use preprocessor directives to do all that... for example:
#ifdef SDK1
#pragma comment(lib, "sdk1.lib")
#include "sdk1/sdk1.h"
#elif SDK2
#pragma comment(lib, "sdk2.lib")
#include "sdk2/sdk2.h"
#endif
Then just the preprocessor directive SDK1 or SDK2 as a switch within the configuration manager.
|
|
|
|
|
I have VS6, which is a great little compiler. If I had an
error, VS6 showed me the error and what lead up to the error. That
is, what functions where called before the error. That helped
me spot where the error was.
Im using VS2005 and when an error arises, I just see the error. Is there a way finding out what functions were called just before that error was committed? Please let me know because that will be help me debug an application Im working on.
Sincerely,
Danielle Brina
|
|
|
|
|
when your app stops, go to the Debug menu, in the Windows sub-menu, find "Call Stack".
|
|
|
|