|
lol, nevermind, your answer was more clear than mind BTW...
|
|
|
|
|
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hey! There's no crying in programming
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for your reply.
But sorry for not working.
I change my fav icon id to 128. But not working.
These things always make me mad!(The things work fine with others, while not fine with me!)
Any reason?
|
|
|
|
|
1) I hope you've clean and rebuild it.
2) I hope there is no other icon id which have id 128.
3) if 1 & 2 is ok, then could you post the relevant section in resource.h?
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Sorry for not cleaning the project.
Just rebuild the project!
Thanks, all guys!^_^
|
|
|
|
|
I hope you didn't just took 128 from the example but understood what you were doing, right ?
128 was just an example. You had to track back in resource.h first the ID of your own icon.
so, to start back from the beginning, how did you add your icon in your program ?
|
|
|
|
|
I create a dialog based project.
then do my jobs.
I notify I need a more beautiful icon for my dialog, then I import a new icon.
And use CWnd::SetIcon to set the icon for the dialog.
And then I modify resource.h exchange myiconID and IDR_MAINFRAME's ID number.
Don't say 128 is the default smallest icon id?
|
|
|
|
|
fantasy1215 wrote: but how to make the exe file use the icon too in the explorer?
It always uses the default ugly MFC icon!
By making sure that all icons in your project's .ico file are correct. You likely just changed one of them and left the other one (or two) as default.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi all,
I am having this push_back error, this is my struct:
struct RMUpdates {
RMUpdates(): prdName(L""), nameVer(L""), link(L""), savePath(L"") {};
wstring prdName;
wstring nameVer;
wstring link;
wstring savePath;
};
struct RMproduct
{
RMproduct(){};
RMproduct(wstring szName, wstring serv, wstring version){m_Name = szName; m_serviceKey = serv; m_versionKey = version;};
wstring m_serviceKey;
wstring m_versionKey;
wstring m_Name;
wstring m_SerialNo;
wstring m_VersionNo;
wstring m_SiteCode;
vector<RMUpdates*>* updateList;
~RMproduct()
{
if (updateList !=NULL) {
vector<RMUpdates*>::iterator Iter;
Iter = updateList->begin();
for (; Iter < updateList->end(); Iter++)
delete *Iter;
updateList->clear();
}
delete updateList;
}
};
Now when i perform this:
RMproduct* prd
RMUpdates* update = new RMUpdates;
update->prdName = prd->m_Name.c_str();
update->nameVer = prd->m_Name.c_str();
update->nameVer.append(L" ");
update->nameVer.append(std::wstring(A2W(pDoGetLatestProductResponse->DoGetLatestProductResult->Version->c_str())));
update->link = DOWNLOADLINK;
update->savePath = SetDestination(update->link.c_str());
prd->updateList->push_back(update);
Then I will get an error here:
size_type size() const
{
return (_Myfirst == 0 ? 0 : _Mylast - _Myfirst);
}
Any advise?
thanks,
Jayjay
|
|
|
|
|
The member RMproduct::updateList is a vector pointer and you are not allocating it nor initializing it anywhere in your constructors.
Allocate updateList in both constructors - RMproduct() and RMproduct(wstring szName, wstring serv, wstring version) will solve the problem.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
What do you mean exactly?
here are the values passed:
update->prdName = prd->m_Name.c_str() Point
Point 4.3.1.54
update->nameVer = prd->m_Name.c_str();
update->nameVer.append(L" ");
update->nameVer.append(std::wstring(A2W(pDoGetLatestProductResponse->DoGetLatestProductResult->Version->c_str())));
update->link http:
update->savePath
C:\DOCUME~1\JONATH~1\LOCALS~1\Temp\ManagePoint431InstallerBuild_54.zip
Unhandled exception at 0x00496f56 in UpdateService.exe: 0xC0000005: Access violation reading location 0xcdcdcdd5.
Can you explain further what i need to do?
Thanks,
jayjay
|
|
|
|
|
Do you mean something like this:
prd->updateList = new vector<RMUpdates*>;
|
|
|
|
|
Yes! It should be done in the constructor. Since your destructor is deleting it.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
You got the exception while executing prd->updateList->push_back(update); . right?
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
yep problem solved Jijo many thanks!
|
|
|
|
|
monsieur_jj wrote: yep problem solved Jijo many thanks!
Always Welcome.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hai,
I am new to vc++ - MFC. How to create a bitmap button on a dialog based window. Help me. Thanks to all supports.
Regards,
Selvan
|
|
|
|
|
|
Hi,
1) You can use CBitmapButton to create a Button. For this you have to set OwnerDraw property of the button to TRUE.
(According to my experience you can Load only BMP images on this Button.)
2) You can create Button using CButton class. For this kind of button you can load any image using SetBitmap() method.
Regards,
Madyastha
|
|
|
|
|
Hi all,
I have made a sdi application and its view is divided into two horizontal parts using splitter. One view class is derived from CTreeView class and left side class is derived from CFormView. In form i have placed a list control..
Now i want to display a context menu on right click of every item of list control....
How can i implement this??
Thanks in advance
|
|
|
|
|
What's a "list control"? A listview or a listbox?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I recently made an application to connect to the computers com1/serial port. I use the Win32api functions CreateFile() function to create it. The SetupComm() function to set it up and the WriteFile() / ReadFile() to read/write from it.
What I would like to know is at what stage the comport's input/read buffer is cleared/flushed???? Is it only when the comport is initialized or is it after every ReadFile().
I would also like to know an easy was of flushing the input buffer. I have googled it and not had any luck.
Thanks
|
|
|
|
|
Flushing the input buffer
Flusing, in general, is for output buffers, in order to empty them.
My guess is that you want to get a character as soon as it arrives. In order to do that, you must use overlapped IO. This is a bit complex, but there are some ready-made classes you can use here on CP. Just search for them.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Hi,
Thanks for your reply.
No definitely the input buffer. This is so that the program will not read the same value from it twice.
Thanks
|
|
|
|