|
Try SetButtonInfo(). There is also a class created by Christian Graus and Masoud Samimi here which can change the bitmap of a toolbar button with a transparent color.
-Raffi
A Sign of Boredom
|
|
|
|
|
On some webpages that use some scripting languages VisualStudio thinks there is some errors on those scripts and gives annoying message if i would like to debug that webpage. Is there any way i could turn this feature off.
Before when i chose it to debug it showed a screen where i could choose debugging with Visual Studio 6 or Visual Studio .NET..but on both of those programs i switched of the Just-in time debugging and now it only alerts that there was eror on a script on website and if i choose to debug it doesn't do anything (because i switched just-in-time debugging off) but it still displays that annoying alert dialog. So anyone knows how to get rid of it.
Thanks a lot
|
|
|
|
|
In Internet Explorer. Tools->Options->Advanced. Under Browsing there is disable script debugging checkbox.
Michael
|
|
|
|
|
I downloaded Mike Blaszczak's http://www.nwlink.com/~mikeblas/samples/stealth.zip
It is a VC++ 5.0 project.
I'm using VC++ 6.0
I put it here C:\Program Files\Microsoft Visual Studio\MyProjects\Stealth\
After compiling I receive this alert:
Error Starting Program
The STEALTH.EXE file is
linked to missing export MFC42D.DLL:1365
This Windows message popped up as well:
C:\program Files\Microsoft Visual Studio\My
Projects\Stealth\Debug\Stealth.exe
A device attached to the system is not functioning.
Where can I find this missing dll?
MFC42D.DLL
Do versions 5 and 6 build code similiarly?
|
|
|
|
|
I downloaded the sample and recompiled it with Version 6 without any problems. Did you do a Build or a Rebuild all. Try doing clean first and then a rebuild all. It sounds like you ran a version 5 exe which tried to use the version 6 MFC42D.DLL
Michael
|
|
|
|
|
I want to define controller for ActiveX like
MS ADO ,or DBGrid in vc++.net but when I right click
on them and press"varibles" it doesn't give me
class for their controler??
|
|
|
|
|
Hello.
I am very close to getting my program working. I would like to know how to send something from an STL container to:
1) cin
2) cout
and especially
3) ifstream
4) ofstream
ifstream temp;
std::string text;
temp << text // this does not work.
It seems I cannot use the sample approach with STL as character array or string.
Do I need to implement an iterator?
Kuphryn
|
|
|
|
|
have you tried
<br />
temp << text.c_str()<br />
Michael
|
|
|
|
|
Just seen the solutuion proposed by Michael P Butler, yeah - it's should work - but
it needs additional call to c_str() member function (dont wanna say that this will cause the
perfomance problem, but it's not looks fine =)
The my STL's implementation (the one that comes with VC6++ ) and (most likely) yours have the << operator overloaded for a basic_string - so the code that you've shown
<br />
template<class _E, class _Tr, class _A> inline<br />
basic_ostream<_E, _Tr>& __cdecl operator<<(<br />
basic_ostream<_E, _Tr>& _O,<br />
const basic_string<_E, _Tr, _A>& _X)<br />
{<br />
_O << _X.c_str();<br />
return (_O); }<br />
in your post should compile flawlessly. The potentional problem that could cause the
compile errors is that you've included old include files...
so - try to compile this code:
<br />
#include <string><br />
using std::string;<br />
#include <iostream><br />
using std::cout;<br />
<br />
<br />
int main()<br />
{<br />
string s = "Russian Software Developers Network - www.RSDN.ru";<br />
cout << s;<br />
<br />
return 0;<br />
}<br />
if the code above will fail to compile - use the Michael's approach to workaround the problem.
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor@soukhov.com | ICQ:57404554 | http://soukhov.com
Russian Software Developer Network
|
|
|
|
|
Most likely you have not included the <string> class. <ifstream> will include parts of the string class which will allow you to declare and use a string, but it will not include the parts which include the insertion operator between string and streams.
--
Where are we going? And why am I in this handbasket?
|
|
|
|
|
Thanks everyone.
The new code works. It use the ostream_iterator and copy() function to output data from the STL deque container to ofstream.
Kuphryn
|
|
|
|
|
So I am almost done my project. Our app is pretty sweet.
So I was checking all the menus to make sure they work properly, and i crashed the app when i tried using the most recently used (mru) list in the File menu.
How do i use this little beast, i only have 4 items at a time showing (set this when i created the app).
I believe if i can get the path from the mru list i can then pass it to my open code (in the same class )
Christian if you are around ? Thank you again for all your help !
Our team actually got an interview with CBC radio (Canadian station) to discuss our app and the technologies used...
Rob Dunsmuir
|
|
|
|
|
|
Thanks Igor,
I have read the documentation in MSDN and online at a few sites.
This is what I have done:
// in my .h
#include <afxadv.h>
CRecentFileList* pMRU;
// in my .cpp
// in my InitInstance()
pMRU=m_pRecentFileList;
// in my OnFileMruFile1()
for(int i = 0; i < pMRU->GetSize(); i++) {
CString strFileName(m_pRecentFileList->m_arrNames[i]);
AfxMessageBox(strFileName);
}
So I can get at all the files in my array (4 of them), but i don't understand how this is connected.
If i click in the mru menu on the first file, when OnFileMruFile1() runs I'd like to find out what was clicked. I was hoping that if i get an index or a string (file path), then I can look it up in the MRU array and pass it to my open file code.
any ideas ?
Thank you.
Rob Dunsmuir
|
|
|
|
|
I'm using the CSystemTray class from http://www.codeproject.com/shell/systemtray.asp , and I can't figure out how to check a menu item from the tray icon's pop-up menu. I can set the default menu item, but I can't set the checked state! Here's the function I use:
[code]
BOOL CSystemTray::CheckMenuItem(UINT uItem, BOOL CheckState, BOOL bByPos)
{
#ifdef _WIN32_WCE
return FALSE;
#else
HMENU hMenu = ::LoadMenu(m_hInstance, MAKEINTRESOURCE(m_tnd.uID));
if (!hMenu)
return FALSE;
HMENU hSubMenu = ::GetSubMenu(hMenu, 0);
if (!hSubMenu)
return FALSE;
::CheckMenuItem(hSubMenu,uItem,MF_UNCHECKED);
return TRUE;
#endif
}
[/code]
The following code works fine:
[code]
BOOL CSystemTray::SetMenuDefaultItem(UINT uItem, BOOL bByPos)
{
#ifdef _WIN32_WCE
return FALSE;
#else
if ((m_DefaultMenuItemID == uItem) && (m_DefaultMenuItemByPos == bByPos))
return TRUE;
m_DefaultMenuItemID = uItem;
m_DefaultMenuItemByPos = bByPos;
HMENU hMenu = ::LoadMenu(m_hInstance, MAKEINTRESOURCE(m_tnd.uID));
if (!hMenu)
return FALSE;
HMENU hSubMenu = ::GetSubMenu(hMenu, 0);
if (!hSubMenu)
return FALSE;
::SetMenuDefaultItem(hSubMenu, m_DefaultMenuItemID, m_DefaultMenuItemByPos);
return TRUE;
#endif
}
[/code]
|
|
|
|
|
Looking at the code, I don't actually see you doing anything with the submenu that you are checking a menu item in.
Usually, you load the menu, check the item, set the default and then use the menu handle in the trackmenupopup call.
When you call LoadMenu, you are creating a copy of the menu from the resources. Thus, if you call LoadMenu twice, you have two instances of the menu. As the code is, you are loading the menu, checking the item and the doing nothing with the menu. Thus you have a resource leak too.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
That's bad .
Thanks for the help!
|
|
|
|
|
Hi !
I'm a beginner.I have a problem.
How to add a function into CView class.Because I want CView support it.
Thanks a lot
|
|
|
|
|
Derive a class from CView, say CView2, and add your functions to CView2
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Hi,
What is your perference when it comes to STL containers? I know many programmers prefer the vector because it random-access. However, deque container is random-access and could be changed from front, middle and back. I prefer the list, but it is hard for me to access specific data inside the list mainly because of my inexperience with STL. Nonetheless, I prefer list because of the innovative way it manages insert and delete (does not need to move all data).
I am implementing deque a program. The program reads data from a file line by line. The program saves each line of data from the file into a character array. I want to "push" each character array into a deque. At the end, I use the unique function to delete all clones. For example let say I have a file with the following:
-------
123
231
123
321
-------
First, the program reads one line at a time and copy the line into a character array. Then the program copies the entire character array into the STL container. Once the program has reached the end of the file, then it will delete all clones such as "123" from the above example.
How do you push a *character array* into an STL container, specifically a deque?
Thanks,
Kuphryn
|
|
|
|
|
Each container has its place, but I definitely find myself using vector more than anything else. As far as your problem goes, you can use std::string to do what you want, you also might want to consider just using set instead of a deque if you don't care about order (set will automatically remove duplicates).
Chris Hafey
|
|
|
|
|
FYI if you reserve() data in a vector it doesn't have to allocate after each new insert until you exceed it's limit. And at that point it usually allocates 2x it's current data size (1000 -> 2000 -> 4000 etc.)
std::vector<std::string> data(1000);
as for your deque you can use
std::deque<std::string> data;
ifstream infile("filename);
std::string temp;
while (!infile.eof())
{
infile >> temp;
data.push_back(temp);
}
Todd Smith
|
|
|
|
|
Thanks everyone.
I am not familiar with the set container. Can you post a straightforward example of set declaration and insert?
Thanks,
Kuphryn
|
|
|
|
|
Using Visual C++ 6, I need to programmatically, discover what type of keyboard (Serial or PS2) is used on a computer, and what type of mouse (serial or PS2) is used. This needs to be done on Windows 95/98/NT/2000 and XP.
|
|
|
|
|
This registry key might be useful
HKEY_LOCAL_MACHINE\Enum\ACPI
enumerate the subkeys
Nish
p.s. chk for class "Keyboard" and class "Mouse"
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|