|
Hi, mukkie!
Thanks for your reply.
I have checked my two projects, the identifier 1 for string is unique.
My question is how can I define a string with the String Table in a DLL so other program can use. I do not want to simply use a function to return a string.
Can you help?
Best regards,
Maer
|
|
|
|
|
If you go to ms word and insert a symbol, there exists the character of a dot. It's not a period, it's a vertically centered dot that's kinda bigger than a period.
How can I get this as a CString? Something like:
CString symbol = char(?????);
How do you find this value? I looked all over MSDN and I can't find it.
Please, any response any one can give me will be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
The ANSI character 183 (decimal) is a vertically centered dot.
If you are using any peculiar fonts or what not, you may have problems.
|
|
|
|
|
Hi,
I am displaying a java servlet in my CHtmlView window. So the URL i am specifying in the Navigate2 directs to a servlet where I am using Apache JServ as the server.
The problem that I am getting is that, after I continuously keep loading/refreshing a page for some 10/15 times in the window, my Apache is getting hung. Did anyone face a similar problem, or have any ideas for this.
Thanks,
Korimilli
|
|
|
|
|
Have anyone measured performance data for MFC and STL containers using VC6? If yes, which is faster? I like the STL containers better, but am not certain about the performance implications of porting an application that uses MFC containers, basically Maps and Lists.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Well, I haven't done any empirical tests, but here are a couple of issues you need to consider:
1.) Unless something is terribly wrong, linked lists will be comparable between the two. They are both implemented as doubly-linked lists.
2.) In MFC, CMap is implemented as a hash map, whereas std::map<> has looser constraints on time complexity, and is usually implemented as some sort of binary tree (red-black is a common one). This has all sorts of ramifications, as you might imagine. In essence, do not treat CMap and std::map as representing the same data structure, they do not. If you want an STL-like hash map (which is NOT part of the standard yet), try STLPort 4.5, which works on VC++, and includes a std::hash_map class.
3.) Different STL implementations could have dramatically different performance. The best example I can think of is std::list<>::size(). The standard does NOTsay that this has to be O(1) complexity (only that it should), and in fact, STLPort implements it as O(n). However, the standard Microsoft/Dinkumware STL implementation implements it in O(1) time. So you have to be very careful.
I would always use the STL containers, MFC is a decade old antique, which is only useful for user interface work. Personally, I use STLPort 4.5, the standard STL that comes with MSVC is disgusting.
|
|
|
|
|
Hi,
I'm having difficulties testing if Active Desktop is enabled. I have so far devised three functions for determining if it is enabled :
BOOL CActiveDesktop::IsEnabledInShell()
{
BOOL bActiveDesktop = FALSE;
HWND hWindow;
// get the handle of Program Manager window
hWindow = FindWindowEx(0, 0, "Progman", "");
// search for its child SHELLDLL_DefView window
if(hWindow)
{
hWindow = FindWindowEx(hWindow, 0, "SHELLDLL_DefView", "");
// finally, search for the Internet Explorer_Server grandchild window
if(hWindow)
{
// if this call returns a non-zero handle, the computer
// is using ActiveDesktop
if(FindWindowEx(hWindow, 0, "Internet Explorer_Server", ""))
{
bActiveDesktop = TRUE;
}
}
}
return bActiveDesktop;
}
// This method checks the registry Explorer\ShellState key to determine whether
// or not the Active Desktop is currently enabled
// The 4th byte is examined.
// For NT4 - if the byte is 0x13 it is assumed that Active Desktop is enabled
// For W2K - if the byte is 0x73 it is assumed that Active Desktop is enabled
// Other - if the byte is 0x63 it is assumed that Active Desktop is enabled
BOOL CActiveDesktop::IsEnabledInRegistry()
{
BOOL bInstalled = FALSE;
DWORD dwType;
DWORD dwMaxValueData;
HKEY hkey;
if(this->IsInstalled())
{
if(RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer", 0, KEY_ALL_ACCESS, &hkey) == ERROR_SUCCESS)
{
// query value first time around to determine length of data
if(RegQueryValueEx(hkey, "ShellState", 0, &dwType, 0, &dwMaxValueData) == ERROR_SUCCESS)
{
LPBYTE pRegBytes = new BYTE[dwMaxValueData];
if(pRegBytes == NULL)
{
return FALSE;
}
if(RegQueryValueEx(hkey, "ShellState", NULL, &dwType, pRegBytes, &dwMaxValueData) == ERROR_SUCCESS)
{
unsigned char desktopMode = *(pRegBytes+4);
CString s;
s.Format("ShellState is [0x%x][0x%x][0x%x][0x%x][0x%x]", *(pRegBytes), *(pRegBytes+1), *(pRegBytes+2), *(pRegBytes+3), *(pRegBytes+4));
LOG(s);
delete[] pRegBytes;
CWindowsVersion winVers;
if(winVers.IsWindowsNT4())
{
if(desktopMode == 0x13)
{
LOG("Active Desktop Enabled on Windows NT4");
return TRUE;
}
}
else
if(winVers.IsWindows2000())
{
if(desktopMode == 0x73)
{
LOG("Active Desktop Enabled on Windows 2000");
return TRUE;
}
}
else
{
if(desktopMode == 0x63)
{
LOG("Active Desktop Enabled on Windows 9x / Windows Me");
return TRUE;
}
}
}
}
}
}
return FALSE;
}
// Determine if Active Desktop is enabled. SHGetSettings is apparently
// more reliable than IActiveDesktop::GetDesktopItemOptions, which can
// report incorrectly during the middle of ApplyChanges!
BOOL CActiveDesktop::IsEnabled()
{
BOOL bResult = FALSE;
if(this->IsInstalled())
{
typedef ULONG (FAR PASCAL FnShGetSettings)(SHELLFLAGSTATE* pFlagState, DWORD dwFlags);
HINSTANCE hLib = ::LoadLibrary(_T("SHELL32.DLL"));
if(hLib != NULL)
{
FnShGetSettings* pfnShGetSettings = (FnShGetSettings*) ::GetProcAddress(hLib, _T("SHGetSettings"));
if(pfnShGetSettings != NULL)
{
SHELLFLAGSTATE sfs;
pfnShGetSettings(&sfs,SSF_DESKTOPHTML);
bResult = sfs.fDesktopHTML;
}
::FreeLibrary(hLib);
}
}
return bResult;
}
Each of these have worked on different machines at differnet times. Currently on my home machine (win me), NONE of them work - my ShellState 4th byte is 0x61 and all other determinations return FALSE;
Any ideas on a FAIL SAFE method of checking this across platforms (or one platform would be a start !)
Thanks
Jase
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
View your digital photos and images with ease using the ultimate desktop image manager for Microsoft Windows
Download your free copy of SlideShow Desktop today from http://www.slideshowdesktop.com
|
|
|
|
|
Try SHGetSettings with SSF_DESKTOPHTML flag.
|
|
|
|
|
I have, and whats more i quoted it in my code example. It is the third method i have displayed.
It isn't a very reliable method.
Any other ideas?
Jase
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
View your digital photos and images with ease using the ultimate desktop image manager for Microsoft Windows
Download your free copy of SlideShow Desktop today from http://www.slideshowdesktop.com
|
|
|
|
|
I have a tree descended from CTreeCtrl displaying text only.
I am using CustomDraw to colour the text of items.
I find I cannot see the text when the item is clicked. This is most obvious where I have not changed the colour from normal.
How do I implement the standard inversion of colour of the text to allow it to be visible.
Sara
|
|
|
|
|
If I understand, when you click on an item, the background goes the same colour as the text ? I'd say because you're drawing the text yourself, you need to check if you're drawing the current selection and change the text colour accordingly.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
How would I use this in a Dialog app. I.E. I need to have it navigate to "res://about.html".
-Matt Newman
-Matt Newman
|
|
|
|
|
Assuming you have inserted the control into your dialog and let the class wizard build a member variable like m_Browser.
m_Browser.Navigate( "res://about.html");
Should do it.
|
|
|
|
|
Thanks I couldn't find an appropriate command or whatever. Thanks
-Matt Newman
-Matt Newman
|
|
|
|
|
|
Yea I figured that out but couldn't get the control to work.
-Matt Newman
-Matt Newman
|
|
|
|
|
Is it possible to have a HTML page on a dialog when using VC 5.0. Do I need VC 6.0? This CWebBrowser does the job? If not is it possible to have something like a control in wich I would simulate a page(I need to write text and load images), something derived from CView maybe? Thanks in anticipation and less bugs!
|
|
|
|
|
I think basically it is from IE 4+ and is an ActiveX control. I don't know if it will work in VC 5 I would think so. I believe their is a third-party open source browser control project but I don't know much about that.
-Matt Newman
-Matt Newman
|
|
|
|
|
How do I open default mail client?
/Ola Carlsson
|
|
|
|
|
To do what ? If it's to send mail, you can pass mailto: (from memory) into ShellExecute.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I think he is looking for the registry keys for the default email client and or browsers.
I would be intersted in knowing that too.
|
|
|
|
|
I don't want to send an e-mail. I only want to open the users default mail client. If the user has Netscape, i want netscape mail client to start etc.
Hope everybody can interpret my message
/Ola Carlsson
|
|
|
|
|
I want to be able to generate a CLSID, but I always want the first 4 sections (best case) to be the same like so:
51eb18c0-98a7-11d1-83d1-f46705c10000
51eb18c0-98a7-11d1-83d1-f46705c10001
51eb18c0-98a7-11d1-83d1-f46705c10002
51eb18c0-98a7-11d1-83d1-f46705c10003
I need this to happen regardless of the machine's on a network or not. The first four sections should be different for each machine the program is run on as well.
Is this possible?
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
Just dug this up....
"For security reasons, UuidCreate was modified so that it no longer uses a machine's MAC address to generate UUIDs. UuidCreateSequential was introduced to allow creation of UUIDs using the MAC address of a machine's Ethernet card."
Norm Almond
Chief Technical Architect
FS Walker Hughes Limited
|
|
|
|
|
That might be exactly what I want.
Thanks Norm.
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|